mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-26 04:57:54 +00:00
Let SUSparkleUserUpdaterDriver take a NSBundle instead of SUHost
This way we don't have to expose SUHost to public anymore, I think
This commit is contained in:
1 parent
5e87fe6daa
commit
d3ed152e1a
3 files changed
+6
-10
No files matched your search
Vendored
+1
-3
@@ -9,11 +9,9 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUUserUpdaterDriver.h"
|
||||
|
||||
@class SUHost;
|
||||
|
||||
@interface SUSparkleUserUpdaterDriver : NSObject <SUUserUpdaterDriver>
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host delegate:(id <SUUserUpdaterDriverDelegate>)delegate;
|
||||
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(id <SUUserUpdaterDriverDelegate>)delegate;
|
||||
|
||||
@property (nonatomic, readonly, getter=isUpdateInProgress) BOOL updateInProgress;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -83,11 +83,11 @@
|
||||
|
||||
#pragma mark Birth
|
||||
|
||||
- (instancetype)initWithHost:(SUHost *)host delegate:(id<SUUserUpdaterDriverDelegate>)delegate
|
||||
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(id<SUUserUpdaterDriverDelegate>)delegate
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_host = host;
|
||||
_host = [[SUHost alloc] initWithBundle:hostBundle];
|
||||
_delegate = delegate;
|
||||
}
|
||||
return self;
|
||||
|
||||
Vendored
+3
-5
@@ -40,11 +40,9 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
||||
|
||||
- (void)instantiateUpdater
|
||||
{
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
SUHost *host = [[SUHost alloc] initWithBundle:bundle];
|
||||
|
||||
id <SUUserUpdaterDriver> driver = [[SUSparkleUserUpdaterDriver alloc] initWithHost:host delegate:nil];
|
||||
self.updater = [[SUUpdater alloc] initWithHostBundle:bundle userUpdaterDriver:driver];
|
||||
NSBundle *hostBundle = [NSBundle mainBundle];
|
||||
id <SUUserUpdaterDriver> driver = [[SUSparkleUserUpdaterDriver alloc] initWithHostBundle:hostBundle delegate:nil];
|
||||
self.updater = [[SUUpdater alloc] initWithHostBundle:hostBundle userUpdaterDriver:driver];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
|
||||
Reference in new issue
Block a user