Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allowed host applications that include Sparkle 1.5 or greater to once…

… again allow Sparkle updating of ClickToFlash

Signed-off-by: Jonathan 'Wolf' Rentzsch <jwr.git@redshed.net>
  • Loading branch information...
commit 181c096da517bfb002fa96045f8edbd8a2fb94f6 1 parent 53f25ff
Simone Manganelli authored committed
Showing with 9 additions and 9 deletions.
  1. +9 −9 SparkleManager.m
View
18 SparkleManager.m
@@ -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;
}
@@ -62,8 +61,6 @@ - (SUUpdater*)_updater {
if (_updater)
return _updater;
- NSAssert(_canUpdate, nil);
-
NSString *frameworksPath = [[NSBundle bundleForClass:[self class]] privateFrameworksPath];
NSAssert(frameworksPath, nil);
@@ -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);
@@ -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];
}
Please sign in to comment.
Something went wrong with that request. Please try again.