Clean up last bit of warnings

This commit is contained in:
Zorg committed 2016-03-03 19:59:16 -05:00
1 parent 62fa723564
commit 045de30926
2 files changed
+14 -6

No files matched your search

+9 -4
View File
@@ -141,8 +141,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
// We wait until the second launch, unless explicitly overridden via SUPromptUserOnFirstLaunchKey.
shouldPrompt = [self.host objectForKey:SUPromptUserOnFirstLaunchKey] || hasLaunchedBefore;
}
#warning the logic for having launched before needs to be more intelligent now that Sparkle can through an XPC service and is re-entrant
if (!hasLaunchedBefore) {
[self.host setBool:YES forUserDefaultsKey:SUHasLaunchedBeforeKey];
}
@@ -151,7 +150,10 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
NSArray *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host];
// Always say we're sending the system profile here so that the delegate displays the parameters it would send.
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
profileInfo = [profileInfo arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:YES]];
NSArray *feedParameters = [self.delegate feedParametersForUpdater:self sendingSystemProfile:YES];
if (feedParameters != nil) {
profileInfo = [profileInfo arrayByAddingObjectsFromArray:feedParameters];
}
}
[self.userDriver requestUpdatePermissionWithSystemProfile:profileInfo reply:^(SUUpdatePermissionPromptResult *result) {
@@ -503,7 +505,10 @@ static void SUCheckForUpdatesInBgReachabilityCheck(__weak SUUpdater *updater, SU
NSArray *parameters = @[];
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
parameters = [parameters arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile]];
NSArray *feedParameters = [self.delegate feedParametersForUpdater:self sendingSystemProfile:sendingSystemProfile];
if (feedParameters != nil) {
parameters = [parameters arrayByAddingObjectsFromArray:feedParameters];
}
}
if (sendingSystemProfile)
{
+5 -2
View File
@@ -76,7 +76,8 @@ static NSString * const UPDATED_VERSION = @"2.0";
assert(bundleURL != nil);
// Copy main bundle into server directory
NSURL *destinationBundleURL = [serverDirectoryURL URLByAppendingPathComponent:bundleURL.lastPathComponent];
NSString *lastBundleURLComponent = bundleURL.lastPathComponent;
NSURL *destinationBundleURL = [serverDirectoryURL URLByAppendingPathComponent:lastBundleURLComponent];
NSError *copyBundleError = nil;
if (![fileManager copyItemAtURL:bundleURL toURL:destinationBundleURL error:&copyBundleError]) {
NSLog(@"Failed to copy main bundle into server directory with error %@", copyBundleError);
@@ -142,7 +143,9 @@ static NSString * const UPDATED_VERSION = @"2.0";
// Obtain the file attributes to get the file size of our update later
NSError *fileAttributesError = nil;
NSDictionary *archiveFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:archiveURL.path error:&fileAttributesError];
NSString *archiveURLPath = archiveURL.path;
assert(archiveURLPath != nil);
NSDictionary *archiveFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:archiveURLPath error:&fileAttributesError];
if (archiveFileAttributes == nil) {
NSLog(@"Failed to retrieve file attributes from archive with error %@", fileAttributesError);
assert(NO);