mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Numerous minor changes courtesy Sean McBride. Mostly clarifications.
This commit is contained in:
1 parent
2049194376
commit
a7148d97ff
19 files changed
+153
-112
No files matched your search
@@ -57,7 +57,7 @@
|
||||
NSString *tmp = [[[dst stringByDeletingPathExtension] stringByAppendingString:@".old"] stringByAppendingPathExtension:[dst pathExtension]];
|
||||
BOOL res = NO;
|
||||
struct stat sb;
|
||||
if((stat([src UTF8String], &sb) != 0) || (stat([tmp UTF8String], &sb) == 0) || stat([dst UTF8String], &sb) != 0)
|
||||
if((stat([src fileSystemRepresentation], &sb) != 0) || (stat([tmp fileSystemRepresentation], &sb) == 0) || stat([dst fileSystemRepresentation], &sb) != 0)
|
||||
return false;
|
||||
|
||||
NSString *command = [NSString stringWithFormat:@"mv -f \"%@\" \"%@\" && cp -f -R \"%@\" \"%@\" && rm -rf \"%@\" && chown -R %d:%d \"%@\"",
|
||||
@@ -73,7 +73,7 @@
|
||||
AuthorizationRef auth;
|
||||
if(AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth) == errAuthorizationSuccess)
|
||||
{
|
||||
char const* arguments[] = { "-c", [command UTF8String], NULL };
|
||||
char const* arguments[] = { "-c", [command fileSystemRepresentation], NULL };
|
||||
if(AuthorizationExecuteWithPrivileges(auth, "/bin/sh", kAuthorizationFlagDefaults, (char**)arguments, NULL) == errAuthorizationSuccess)
|
||||
{
|
||||
int status;
|
||||
|
||||
+2
-2
@@ -88,9 +88,9 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA
|
||||
|
||||
- (NSString *) stripHTML {
|
||||
|
||||
NSInteger len = [self length];
|
||||
NSUInteger len = [self length];
|
||||
NSMutableString *s = [NSMutableString stringWithCapacity: len];
|
||||
NSInteger i = 0, level = 0;
|
||||
NSUInteger i = 0, level = 0;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
|
||||
|
||||
+8
-6
@@ -36,14 +36,16 @@
|
||||
- (id)init;
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
[self setTask:[[[NSTask alloc] init] autorelease]];
|
||||
[self setOutputPipe:[[[NSPipe alloc] init] autorelease]];
|
||||
[self setInputPipe:[[[NSPipe alloc] init] autorelease]];
|
||||
|
||||
[self setTask:[[[NSTask alloc] init] autorelease]];
|
||||
[self setOutputPipe:[[[NSPipe alloc] init] autorelease]];
|
||||
[self setInputPipe:[[[NSPipe alloc] init] autorelease]];
|
||||
[[self task] setStandardInput:[self inputPipe]];
|
||||
[[self task] setStandardOutput:[self outputPipe]];
|
||||
}
|
||||
|
||||
[[self task] setStandardInput:[self inputPipe]];
|
||||
[[self task] setStandardOutput:[self outputPipe]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context)
|
||||
Also trim white space, remove HTML when appropriate.
|
||||
*/
|
||||
|
||||
NSString *description, *link, *title;
|
||||
NSString *description, *normalizedLink, *title;
|
||||
BOOL nilDescription = NO;
|
||||
|
||||
/*Description*/
|
||||
@@ -505,9 +505,9 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context)
|
||||
|
||||
/*Link*/
|
||||
|
||||
link = [rssItem objectForKey: linkKey];
|
||||
normalizedLink = [rssItem objectForKey: linkKey];
|
||||
|
||||
if ([NSString stringIsEmpty: link]) {
|
||||
if ([NSString stringIsEmpty: normalizedLink]) {
|
||||
|
||||
/*Try to get a URL from the description.*/
|
||||
|
||||
@@ -517,21 +517,21 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context)
|
||||
|
||||
if ([stringComponents count] > 1) {
|
||||
|
||||
link = [stringComponents objectAtIndex: 1];
|
||||
normalizedLink = [stringComponents objectAtIndex: 1];
|
||||
|
||||
stringComponents = [link componentsSeparatedByString: @"\""];
|
||||
stringComponents = [normalizedLink componentsSeparatedByString: @"\""];
|
||||
|
||||
link = [stringComponents objectAtIndex: 0];
|
||||
normalizedLink = [stringComponents objectAtIndex: 0];
|
||||
} /*if*/
|
||||
} /*if*/
|
||||
} /*if*/
|
||||
|
||||
if (link == nil)
|
||||
link = @"";
|
||||
if (normalizedLink == nil)
|
||||
normalizedLink = @"";
|
||||
|
||||
link = [link trimWhiteSpace];
|
||||
normalizedLink = [normalizedLink trimWhiteSpace];
|
||||
|
||||
[rssItem setObject: link forKey: linkKey];
|
||||
[rssItem setObject: normalizedLink forKey: linkKey];
|
||||
|
||||
/*Title*/
|
||||
|
||||
@@ -703,7 +703,7 @@ NSComparisonResult compareNewsItems(id item1, id item2, void *context)
|
||||
} /*if*/
|
||||
} /*for*/
|
||||
|
||||
value = [valueMutable copy];
|
||||
value = [[valueMutable trimWhiteSpace] retain];
|
||||
|
||||
[valueMutable autorelease];
|
||||
|
||||
|
||||
+60
-57
@@ -13,65 +13,68 @@
|
||||
|
||||
- initWithDictionary:(NSDictionary *)dict
|
||||
{
|
||||
[super init];
|
||||
[self setTitle:[dict objectForKey:@"title"]];
|
||||
[self setDate:[dict objectForKey:@"pubDate"]];
|
||||
[self setDescription:[dict objectForKey:@"description"]];
|
||||
|
||||
id enclosure = [dict objectForKey:@"enclosure"];
|
||||
[self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
|
||||
[self setMD5Sum:[enclosure objectForKey:@"sparkle:md5Sum"]];
|
||||
|
||||
[self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||
|
||||
// Find the appropriate release notes URL.
|
||||
if ([dict objectForKey:@"sparkle:releaseNotesLink"])
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]];
|
||||
[self setTitle:[dict objectForKey:@"title"]];
|
||||
[self setDate:[dict objectForKey:@"pubDate"]];
|
||||
[self setDescription:[dict objectForKey:@"description"]];
|
||||
|
||||
id enclosure = [dict objectForKey:@"enclosure"];
|
||||
[self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
|
||||
[self setMD5Sum:[enclosure objectForKey:@"sparkle:md5Sum"]];
|
||||
|
||||
[self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||
|
||||
// Find the appropriate release notes URL.
|
||||
if ([dict objectForKey:@"sparkle:releaseNotesLink"])
|
||||
{
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]];
|
||||
}
|
||||
else if ([[self description] hasPrefix:@"http://"]) // if the description starts with http://, use that.
|
||||
{
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[self description]]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setReleaseNotesURL:nil];
|
||||
}
|
||||
|
||||
NSString *minVersion = [dict objectForKey:@"sparkle:minimumSystemVersion"];
|
||||
if(minVersion)
|
||||
[self setMinimumSystemVersion:minVersion];
|
||||
else
|
||||
[self setMinimumSystemVersion:@"10.3.0"];//sparkle doesn't run on 10.2-, so we don't have to worry about it
|
||||
|
||||
// Try to find a version string.
|
||||
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
|
||||
// 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec.
|
||||
// 2. If there isn't a version attribute, Sparkle will parse the path in the enclosure, expecting
|
||||
// that it will look like this: http://something.com/YourApp_0.5.zip. It'll read whatever's between the last
|
||||
// underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension.
|
||||
// The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle.
|
||||
// Feel free to change the separator string to a hyphen or something more suited to your needs if you like.
|
||||
NSString *newVersion = [enclosure objectForKey:@"sparkle:version"];
|
||||
if (!newVersion) // no sparkle:version attribute
|
||||
{
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1)
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
}
|
||||
[self setFileVersion:newVersion];
|
||||
|
||||
NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
|
||||
if (shortVersionString)
|
||||
{
|
||||
if (![[self fileVersion] isEqualToString:shortVersionString])
|
||||
shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", [self fileVersion]];
|
||||
[self setVersionString:shortVersionString];
|
||||
}
|
||||
else
|
||||
[self setVersionString:[self fileVersion]];
|
||||
}
|
||||
else if ([[self description] hasPrefix:@"http://"]) // if the description starts with http://, use that.
|
||||
{
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[self description]]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setReleaseNotesURL:nil];
|
||||
}
|
||||
|
||||
NSString *minVersion = [dict objectForKey:@"sparkle:minimumSystemVersion"];
|
||||
if(minVersion)
|
||||
[self setMinimumSystemVersion:minVersion];
|
||||
else
|
||||
[self setMinimumSystemVersion:@"10.3.0"];//sparkle doesn't run on 10.2-, so we don't have to worry about it
|
||||
|
||||
// Try to find a version string.
|
||||
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
|
||||
// 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec.
|
||||
// 2. If there isn't a version attribute, Sparkle will parse the path in the enclosure, expecting
|
||||
// that it will look like this: http://something.com/YourApp_0.5.zip. It'll read whatever's between the last
|
||||
// underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension.
|
||||
// The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle.
|
||||
// Feel free to change the separator string to a hyphen or something more suited to your needs if you like.
|
||||
NSString *newVersion = [enclosure objectForKey:@"sparkle:version"];
|
||||
if (!newVersion) // no sparkle:version attribute
|
||||
{
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1)
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
}
|
||||
[self setFileVersion:newVersion];
|
||||
|
||||
NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
|
||||
if (shortVersionString)
|
||||
{
|
||||
if (![[self fileVersion] isEqualToString:shortVersionString])
|
||||
shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", [self fileVersion]];
|
||||
[self setVersionString:shortVersionString];
|
||||
}
|
||||
else
|
||||
[self setVersionString:[self fileVersion]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
NSBundle *hostBundle;
|
||||
}
|
||||
|
||||
- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle;
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle;
|
||||
|
||||
- (IBAction)relaunchNow:sender;
|
||||
- (IBAction)relaunchLater:sender;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
@implementation SUAutomaticUpdateAlert
|
||||
|
||||
- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb;
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb;
|
||||
{
|
||||
updateItem = [item retain];
|
||||
hostBundle = [hb retain];
|
||||
@@ -19,12 +19,12 @@
|
||||
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUAutomaticUpdateAlert" ofType:@"nib"];
|
||||
if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations.
|
||||
{
|
||||
NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingString:@"/Sparkle.framework"];
|
||||
NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"];
|
||||
NSBundle *framework = [NSBundle bundleWithPath:frameworkPath];
|
||||
path = [framework pathForResource:@"SUAutomaticUpdateAlert" ofType:@"nib"];
|
||||
}
|
||||
|
||||
[super initWithWindowNibPath:path owner:self];
|
||||
self = [super initWithWindowNibPath:path owner:self];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
|
||||
return self;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 __MyCompanyName__. All rights reserved.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
NSBundle *hostBundle;
|
||||
}
|
||||
|
||||
- initWithHostBundle:(NSBundle *)hostBundle;
|
||||
- (id)initWithHostBundle:(NSBundle *)hostBundle;
|
||||
|
||||
// Pass 0 for the max progress value to get an indeterminate progress bar.
|
||||
// Pass nil for the status text to not show it.
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
|
||||
@implementation SUStatusController
|
||||
|
||||
- initWithHostBundle:(NSBundle *)hb
|
||||
- (id)initWithHostBundle:(NSBundle *)hb
|
||||
{
|
||||
hostBundle = [hb retain];
|
||||
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUStatus" ofType:@"nib"];
|
||||
if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations.
|
||||
{
|
||||
NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingString:@"/Sparkle.framework"];
|
||||
NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"];
|
||||
NSBundle *framework = [NSBundle bundleWithPath:frameworkPath];
|
||||
path = [framework pathForResource:@"SUStatus" ofType:@"nib"];
|
||||
}
|
||||
[super initWithWindowNibPath:path owner:self];
|
||||
self = [super initWithWindowNibPath:path owner:self];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
return self;
|
||||
}
|
||||
@@ -119,5 +119,3 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
+ (NSDictionary *)modelTranslationTable
|
||||
{
|
||||
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUModelTranslation" ofType:@"plist"];
|
||||
return [[NSDictionary alloc] initWithContentsOfFile:path];
|
||||
return [[[NSDictionary alloc] initWithContentsOfFile:path] autorelease];
|
||||
}
|
||||
|
||||
+ (NSMutableArray *)systemProfileInformationArrayWithHostBundle:(NSBundle *)hostBundle
|
||||
@@ -30,7 +30,7 @@
|
||||
int value = 0 ;
|
||||
unsigned long length = sizeof(value) ;
|
||||
|
||||
// OS version (Apple recommends using SystemVersion.plist instead of Gestalt() here, don't ask me why).
|
||||
// OS version
|
||||
NSString *currentSystemVersion = SUSystemVersionString();
|
||||
if (currentSystemVersion != nil)
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion,nil] forKeys:profileDictKeys]];
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ typedef enum
|
||||
BOOL webViewFinishedLoading;
|
||||
}
|
||||
|
||||
- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle;
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle;
|
||||
- (void)setDelegate:delegate;
|
||||
|
||||
- (IBAction)installUpdate:sender;
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@
|
||||
|
||||
@implementation SUUpdateAlert
|
||||
|
||||
- initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb
|
||||
{
|
||||
hostBundle = [hb retain];
|
||||
updateItem = [item retain];
|
||||
@@ -21,12 +21,12 @@
|
||||
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUUpdateAlert" ofType:@"nib"];
|
||||
if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations.
|
||||
{
|
||||
NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingString:@"/Sparkle.framework"];
|
||||
NSString *frameworkPath = [[hostBundle sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"];
|
||||
NSBundle *framework = [NSBundle bundleWithPath:frameworkPath];
|
||||
path = [framework pathForResource:@"SUUpdateAlert" ofType:@"nib"];
|
||||
}
|
||||
|
||||
[super initWithWindowNibPath:path owner:self];
|
||||
self = [super initWithWindowNibPath:path owner:self];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
return self;
|
||||
}
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
- (NSString *)descriptionText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available%Cyou have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem versionString], 0x2014, [hostBundle displayVersion]];
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available%Cyou have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem versionString], 0x2014, [hostBundle displayVersion]];
|
||||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:frame
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@
|
||||
return [SUUpdater alloc];
|
||||
}
|
||||
|
||||
- init
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 __MyCompanyName__. All rights reserved.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUUSERDEFAULTS_H
|
||||
@@ -32,7 +32,7 @@
|
||||
*/
|
||||
- (void)setIdentifier:(NSString *)identifier;
|
||||
|
||||
- objectForKey:(NSString *)defaultName;
|
||||
- (id)objectForKey:(NSString *)defaultName;
|
||||
- (void)setObject:(id)value forKey:(NSString *)defaultName;
|
||||
- (BOOL)boolForKey:(NSString *)defaultName;
|
||||
- (void)setBool:(BOOL)value forKey:(NSString *)defaultName;
|
||||
|
||||
+18
-7
@@ -3,7 +3,7 @@
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 __MyCompanyName__. All rights reserved.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Sparkle.h"
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
- (void)setIdentifier:(NSString *)anIdentifier
|
||||
{
|
||||
[identifier autorelease];
|
||||
identifier = [anIdentifier copy];
|
||||
}
|
||||
|
||||
@@ -36,10 +37,15 @@
|
||||
[NSException raise:@"SUUserDefaultsMissingIdentifier" format:@"You must set the SUUserDefaults identifier before using it."];
|
||||
}
|
||||
|
||||
- objectForKey:(NSString *)defaultName
|
||||
- (id)objectForKey:(NSString *)defaultName
|
||||
{
|
||||
[self verifyIdentifier];
|
||||
return (id)CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPropertyListRef obj = CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050
|
||||
return [NSMakeCollectable(obj) autorelease];
|
||||
#else
|
||||
return [(id)obj autorelease];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)setObject:(id)value forKey:(NSString *)defaultName;
|
||||
@@ -51,12 +57,17 @@
|
||||
|
||||
- (BOOL)boolForKey:(NSString *)defaultName
|
||||
{
|
||||
BOOL value;
|
||||
[self verifyIdentifier];
|
||||
CFPropertyListRef plr = (CFPropertyListRef)CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
CFPropertyListRef plr = CFPreferencesCopyValue((CFStringRef)defaultName, (CFStringRef)identifier, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
if (plr == NULL)
|
||||
return NO;
|
||||
else
|
||||
return CFBooleanGetValue((CFBooleanRef)plr);
|
||||
value = NO;
|
||||
else {
|
||||
value = (BOOL)CFBooleanGetValue((CFBooleanRef)plr);
|
||||
CFRelease(plr);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (void)setBool:(BOOL)value forKey:(NSString *)defaultName
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 12/21/07.
|
||||
// Copyright 2007 __MyCompanyName__. All rights reserved.
|
||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#endif
|
||||
|
||||
// This returns a version string of the form X.Y.Z
|
||||
inline NSString* SUSystemVersionString(void)
|
||||
static inline NSString* SUSystemVersionString(void)
|
||||
{
|
||||
SInt32 major, minor, bugfix;
|
||||
OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major);
|
||||
@@ -31,7 +31,7 @@ inline NSString* SUSystemVersionString(void)
|
||||
NSString* verStr = nil;
|
||||
if (!err1 && !err2 && !err3)
|
||||
{
|
||||
verStr = [NSString stringWithFormat:@"%ld.%ld.%ld", major, minor, bugfix];
|
||||
verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];
|
||||
}
|
||||
return verStr;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; };
|
||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
61407C390A4099050009F71F /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; };
|
||||
6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6196CFE309C71ADE000DC222 /* SUStatusController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6196CFFA09C72149000DC222 /* SUStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6196CFE409C71ADE000DC222 /* SUStatusController.m */; };
|
||||
61A225930D1C3ADD00430CCD /* NSBundle+SUAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 61A225910D1C3ADD00430CCD /* NSBundle+SUAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -469,6 +470,7 @@
|
||||
61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */,
|
||||
61A2262B0D1C58FD00430CCD /* SUUserDefaults.h in Headers */,
|
||||
61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */,
|
||||
6160E7E10D3B4A8800E9CD71 /* NTSynchronousTask.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -904,7 +906,19 @@
|
||||
ppc,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
|
||||
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
|
||||
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
|
||||
GCC_WARN_MISSING_PARENTHESES = YES;
|
||||
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
|
||||
GCC_WARN_SHADOW = YES;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
||||
"MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4;
|
||||
@@ -915,7 +929,7 @@
|
||||
"SDKROOT[arch=i386]" = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
"SDKROOT[arch=ppc]" = /Developer/SDKs/MacOSX10.3.9.sdk;
|
||||
VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc";
|
||||
WARNING_CFLAGS = "-wall";
|
||||
WARNING_CFLAGS = "-Wall";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -929,7 +943,20 @@
|
||||
x86_64,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
|
||||
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
|
||||
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
|
||||
GCC_WARN_MISSING_PARENTHESES = YES;
|
||||
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
|
||||
GCC_WARN_SHADOW = YES;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.4;
|
||||
"MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4;
|
||||
@@ -942,7 +969,7 @@
|
||||
"SDKROOT[arch=ppc]" = /Developer/SDKs/MacOSX10.3.9.sdk;
|
||||
"SDKROOT[arch=x86_64]" = /Developer/SDKs/MacOSX10.5.sdk;
|
||||
VALID_ARCHS = "ppc7400 ppc970 i386 x86_64 ppc";
|
||||
WARNING_CFLAGS = "-wall";
|
||||
WARNING_CFLAGS = "-Wall";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user