Compare commits

...
10 Commits
11 changed files with 52 additions and 35 deletions

No files matched your search

+2 -2
View File
@@ -34,8 +34,8 @@
}
// Initializes with data from a dictionary provided by the RSS class.
- initWithDictionary:(NSDictionary *)dict;
- initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error;
- (NSString *)title;
- (NSString *)versionString;
-1
View File
@@ -49,7 +49,6 @@
- (void)installWithToolAndRelaunch:(BOOL)relaunch;
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
- (void)installWithToolAndRelaunch:(BOOL)relaunch;
- (void)cleanUpDownload;
- (void)abortUpdate;
+11 -7
View File
@@ -163,13 +163,17 @@
- (void)unarchiver:(SUUnarchiver *)unarchiver requiresPasswordReturnedViaInvocation:(NSInvocation *)invocation
{
SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:host];
NSString *password = nil;
if([prompt run])
{
password = [prompt password];
}
[prompt release];
NSString *password = @"";
// some users reported sparkle is asking for password randomly
// HACK: do not open prompt and pass empty string as a password
//
// SUPasswordPrompt *prompt = [[SUPasswordPrompt alloc] initWithHost:host];
// NSString *password = nil;
// if([prompt run])
// {
// password = [prompt password];
// }
// [prompt release];
[invocation setArgument:&password atIndex:2];
[invocation invoke];
}
+11 -9
View File
@@ -140,15 +140,17 @@
- (BOOL)allowsAutomaticUpdates
{
BOOL allowAutoUpdates = YES; // Defaults to YES.
if( [host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] )
allowAutoUpdates = [host boolForInfoDictionaryKey: SUAllowsAutomaticUpdatesKey];
// UK 2007-08-31: Give delegate a chance to modify this choice:
if( delegate && [delegate respondsToSelector: @selector(updateAlert:shouldAllowAutoUpdate:)] )
[delegate updateAlert: self shouldAllowAutoUpdate: &allowAutoUpdates];
return allowAutoUpdates;
// BOOL allowAutoUpdates = YES; // Defaults to YES.
// if( [host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] )
// allowAutoUpdates = [host boolForInfoDictionaryKey: SUAllowsAutomaticUpdatesKey];
//
// // UK 2007-08-31: Give delegate a chance to modify this choice:
// if( delegate && [delegate respondsToSelector: @selector(updateAlert:shouldAllowAutoUpdate:)] )
// [delegate updateAlert: self shouldAllowAutoUpdate: &allowAutoUpdates];
//
// return allowAutoUpdates;
return NO; // HACK: darwin
}
- (void)awakeFromNib
+1
View File
@@ -27,6 +27,7 @@ extern NSString * const SUUpdateDriverFinishedNotification;
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
- (void)abortUpdate;
- (BOOL)finished;
- (void)setFinished:(BOOL) finished;
- (SUHost*)host;
- (void)setHost:(SUHost*)newHost;
+4
View File
@@ -35,6 +35,10 @@ NSString * const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
- (BOOL)finished { return finished; }
- (void)setFinished:(BOOL) _finished {
finished = _finished;
}
- (void)dealloc
{
[host release];
+4 -2
View File
@@ -27,12 +27,12 @@
+ (SUUpdater *)sharedUpdater;
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
- initForBundle:(NSBundle *)bundle;
- (instancetype)initForBundle:(NSBundle *)bundle;
- (NSBundle *)hostBundle;
- (void)setDelegate:(id)delegate;
- delegate;
- (id)delegate;
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
- (BOOL)automaticallyChecksForUpdates;
@@ -73,6 +73,8 @@
- (BOOL)updateInProgress;
-(void) checkForUpdatesInBgReachabilityCheckWithDriver: (SUUpdateDriver*)inDriver;
@end
+13 -11
View File
@@ -239,7 +239,7 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SCNetworkConnectionFlags flags = 0;
BOOL isNetworkReachable = YES;
BOOL isNetworkReachable = NO;
// Don't perform automatic checks on unconnected laptops or dial-up connections that aren't online:
NSMutableDictionary* theDict = [NSMutableDictionary dictionary];
@@ -250,20 +250,21 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
Boolean reachabilityResult = NO;
// If the feed's using a file:// URL, we won't be able to use reachability.
if (reachability != NULL) {
reachabilityResult = YES;
SCNetworkReachabilityGetFlags(reachability, &flags);
CFRelease(reachability);
}
if( reachabilityResult )
{
BOOL needsConnection = ((flags & kSCNetworkFlagsConnectionRequired) != 0);
BOOL reachable = (flags & kSCNetworkFlagsReachable) == kSCNetworkFlagsReachable;
BOOL automatic = (flags & kSCNetworkFlagsConnectionAutomatic) == kSCNetworkFlagsConnectionAutomatic;
BOOL local = (flags & kSCNetworkFlagsIsLocalAddress) == kSCNetworkFlagsIsLocalAddress;
//NSLog(@"reachable = %s, automatic = %s, local = %s", (reachable?"YES":"NO"), (automatic?"YES":"NO"), (local?"YES":"NO"));
// NSLog(@"reachable = %s, needsConnection = %s, local = %s", (reachable?"YES":"NO"), (needsConnection?"YES":"NO"), (local?"YES":"NO"));
if( !(reachable || automatic || local) )
isNetworkReachable = NO;
if (local || (reachable && !needsConnection))
isNetworkReachable = YES;
}
// If the network's not reachable, we pass a nil driver into checkForUpdatesWithDriver, which will then reschedule the next update so we try again later.
@@ -406,12 +407,13 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
- (BOOL)automaticallyDownloadsUpdates
{
// If the SUAllowsAutomaticUpdatesKey exists and is set to NO, return NO.
if ([host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] && [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] == NO)
return NO;
// Otherwise, automatically downloading updates is allowed. Does the user want it?
return [host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
return NO; // HACK: darwin
// // If the SUAllowsAutomaticUpdatesKey exists and is set to NO, return NO.
// if ([host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] && [host boolForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] == NO)
// return NO;
//
// // Otherwise, automatically downloading updates is allowed. Does the user want it?
// return [host boolForUserDefaultsKey:SUAutomaticallyUpdateKey];
}
- (void)setFeedURL:(NSURL *)feedURL
+5 -1
View File
@@ -6,8 +6,10 @@
// Copyright 2009 Elgato Systems GmbH. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#ifndef SUVERSIONDISPLAYPROTOCOL_H
#define SUVERSIONDISPLAYPROTOCOL_H
#import <Cocoa/Cocoa.h>
/*!
@protocol
@@ -25,3 +27,5 @@
-(void) formatVersion: (NSString**)inOutVersionA andVersion: (NSString**)inOutVersionB;
@end
#endif
-1
View File
@@ -663,7 +663,6 @@
55C14F04136EF6DB00649790 /* SULog.h */,
55C14F05136EF6DB00649790 /* SULog.m */,
);
includeInIndex = 1;
name = "Other Sources";
sourceTree = "<group>";
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"