Permalink
Browse files

Now reporting 64-bit capability of the host system.

Showing GHz to the user instead of MHz for the clock speed reading.
  • Loading branch information...
2 parents c3f2c69 + 918217f commit 44a547341d58b8d6510a215cc3b74b4455fc9f55 @andymatuschak andymatuschak committed Jul 5, 2008
View
16 SUSystemProfiler.m
@@ -56,12 +56,24 @@ - (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle
}
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cputype",@"CPU Type", [NSNumber numberWithInt:value], visibleCPUType,nil] forKeys:profileDictKeys]];
}
+ error = sysctlbyname("hw.cpu64bit_capable", &value, &length, NULL, 0);
+ if(error != 0)
+ error = sysctlbyname("hw.optional.x86_64", &value, &length, NULL, 0); //x86 specific
+ if(error != 0)
+ error = sysctlbyname("hw.optional.64bitops", &value, &length, NULL, 0); //PPC specific
+
+ BOOL is64bit = NO;
+
+ if (error == 0) {
+ is64bit = value == 1;
+ [profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpu64bit", @"CPU is 64-Bit?", [NSNumber numberWithBool:is64bit], is64bit ? @"Yes" : @"No", nil] forKeys:profileDictKeys]];
+ }
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
if (error == 0) {
NSString *visibleCPUSubType;
if (cpuType == 7) {
// Intel
- visibleCPUSubType = @"Intel"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
+ visibleCPUSubType = is64bit ? @"Intel Core 2" : @"Intel Core"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
} else if (cpuType == 18) {
// PowerPC
switch(value) {
@@ -116,7 +128,7 @@ - (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle
SInt32 gestaltInfo;
err = Gestalt(gestaltProcClkSpeedMHz,&gestaltInfo);
if (err == noErr)
- [profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (MHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithInt:gestaltInfo],nil] forKeys:profileDictKeys]];
+ [profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (GHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithDouble:gestaltInfo/1000.0],nil] forKeys:profileDictKeys]];
// amount of RAM
err = Gestalt(gestaltPhysicalRAMSizeInMegabytes,&gestaltInfo);
View
1 SUUpdater.m
@@ -129,6 +129,7 @@ - (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d
driver = [d retain];
if ([driver delegate] == nil) { [driver setDelegate:delegate]; }
+ NSLog(@"Checking %@", [self feedURL]);
[driver checkForUpdatesAtURL:[self feedURL] hostBundle:hostBundle];
}
View
6 en.lproj/SUUpdatePermissionPrompt.nib/info.nib
@@ -3,18 +3,18 @@
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
- <string>658</string>
+ <string>667</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
- <integer>39</integer>
<integer>6</integer>
+ <integer>39</integer>
</array>
<key>IBSystem Version</key>
- <string>9C7010</string>
+ <string>9D34</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
View
BIN en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib
Binary file not shown.

0 comments on commit 44a5473

Please sign in to comment.