Skip to content

Commit

Permalink
Allowed host applications that include Sparkle 1.5 or greater to once…
Browse files Browse the repository at this point in the history
… again allow Sparkle updating of ClickToFlash

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information
Simone Manganelli authored and rentzsch committed Apr 22, 2009
1 parent 53f25ff commit 181c096
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions SparkleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ + (id)sharedManager {
- (id)init {
self = [super init];
if (self) {
// We can try to update is Sparkle isn't already loaded in our host.
_canUpdate = !objc_getClass("SUUpdater");
_canUpdate = NO;
}
return self;
}
Expand All @@ -62,8 +61,6 @@ - (SUUpdater*)_updater {
if (_updater)
return _updater;

NSAssert(_canUpdate, nil);

NSString *frameworksPath = [[NSBundle bundleForClass:[self class]] privateFrameworksPath];
NSAssert(frameworksPath, nil);

Expand All @@ -82,10 +79,13 @@ - (SUUpdater*)_updater {
Class updaterClass = objc_getClass("SUUpdater");
NSAssert(updaterClass, nil);

_updater = [updaterClass updaterForBundle:clickToFlashBundle];
NSAssert(_updater, nil);

[_updater setDelegate:self];
if ([updaterClass respondsToSelector:@selector(updaterForBundle:)]) {
_canUpdate = YES;
_updater = [updaterClass updaterForBundle:clickToFlashBundle];
NSAssert(_updater, nil);

[_updater setDelegate:self];
}
}

if (error) NSLog(@"error loading ClickToFlash's Sparkle: %@", error);
Expand All @@ -103,8 +103,8 @@ - (void)startAutomaticallyCheckingForUpdates {
if (!checkedForUpdate) {
checkedForUpdate = YES;

SUUpdater *updater = [self _updater];
if (_canUpdate) {
SUUpdater *updater = [self _updater];
[updater checkForUpdatesInBackground];
[updater setAutomaticallyChecksForUpdates:YES];
}
Expand Down

0 comments on commit 181c096

Please sign in to comment.