Use NSHost to obtain computer’s name

This commit is contained in:
Allan Odgaard
2013-04-17 10:47:20 +07:00
parent 72dd8e2047
commit 0e290fd599
2 changed files with 2 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ static NSString* DisplayName (NSURL* url, size_t numberOfParents = 0)
{
NSString* res = nil;
if([[url scheme] isEqualToString:[kURLLocationComputer scheme]])
res = CFBridgingRelease(SCDynamicStoreCopyComputerName(NULL, NULL));
res = [[NSHost currentHost] localizedName];
else if([[url scheme] isEqualToString:[kURLLocationBundles scheme]])
res = @"Bundles";
else // if([url isFileURL])

View File

@@ -35,7 +35,7 @@
self.rootItem = [FSItem itemWithURL:anURL];
self.rootItem.icon = [NSImage imageNamed:NSImageNameComputer]; // FIXME Assigning to property of type OakFileIconImage
self.rootItem.name = CFBridgingRelease(SCDynamicStoreCopyComputerName(NULL, NULL));
self.rootItem.name = [[NSHost currentHost] localizedName];
self.rootItem.children = [self volumeList];
}
return self;