Remove delegate property from SPUStandardUserDriverProtocol

Also remove delegate from user driver core component and popup titlebar user driver.
This commit is contained in:
Zorg committed 2016-08-13 09:00:51 -04:00
1 parent b58773cb5e
commit 92b94343f4
7 files changed
+6 -29

No files matched your search

+2 -1
View File
@@ -24,6 +24,7 @@
@property (nonatomic, readonly) SUHost *host;
@property (nonatomic, readonly) SPUUserDriverCoreComponent *coreComponent;
@property (nonatomic, weak, nullable, readonly) id <SPUStandardUserDriverDelegate> delegate;
@property (nonatomic) SUStatusController *checkingController;
@property (nonatomic) SUUpdateAlert *activeUpdateAlert;
@@ -48,7 +49,7 @@
if (self != nil) {
_host = [[SUHost alloc] initWithBundle:hostBundle];
_delegate = delegate;
_coreComponent = [[SPUUserDriverCoreComponent alloc] initWithDelegate:delegate];
_coreComponent = [[SPUUserDriverCoreComponent alloc] init];
}
return self;
}
-5
View File
@@ -19,11 +19,6 @@
*/
@protocol SPUStandardUserDriverProtocol <NSObject>
/*!
Readable and writable property for this user driver's delegate
*/
@property (nonatomic, weak, nullable, readonly) id <SPUStandardUserDriverDelegate> delegate;
/*!
Indicates whether or not an update is in progress as far as the user's perspective is concerned
-4
View File
@@ -14,10 +14,6 @@
SU_EXPORT @interface SPUUserDriverCoreComponent : NSObject
- (instancetype)initWithDelegate:(id<SPUStandardUserDriverDelegate>)delegate;
@property (nonatomic, readonly, weak) id<SPUStandardUserDriverDelegate> delegate;
- (void)showCanCheckForUpdates:(BOOL)canCheckForUpdates;
@property (nonatomic, readonly) BOOL canCheckForUpdates;
-13
View File
@@ -7,7 +7,6 @@
//
#import "SPUUserDriverCoreComponent.h"
#import "SPUStandardUserDriverDelegate.h"
#ifdef _APPKITDEFINES_H
#error This is a "core" class and should NOT import AppKit
@@ -26,24 +25,12 @@
@implementation SPUUserDriverCoreComponent
@synthesize delegate = _delegate;
@synthesize canCheckForUpdates = _canCheckForUpdates;
@synthesize installUpdateHandler = _installUpdateHandler;
@synthesize updateCheckStatusCompletion = _updateCheckStatusCompletion;
@synthesize downloadStatusCompletion = _downloadStatusCompletion;
@synthesize acknowledgement = _acknowledgement;
#pragma mark Birth
- (instancetype)initWithDelegate:(id<SPUStandardUserDriverDelegate>)delegate
{
self = [super init];
if (self != nil) {
_delegate = delegate;
}
return self;
}
#pragma mark Is Update Busy?
- (void)showCanCheckForUpdates:(BOOL)canCheckForUpdates
+1 -1
View File
@@ -13,6 +13,6 @@
@interface SUPopUpTitlebarUserDriver : NSObject <SPUUserDriver, SPUStandardUserDriverProtocol>
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle window:(NSWindow *)window delegate:(id<SPUStandardUserDriverDelegate>)delegate;
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle window:(NSWindow *)window;
@end
+2 -4
View File
@@ -28,7 +28,6 @@
@implementation SUPopUpTitlebarUserDriver
@synthesize delegate = _delegate;
@synthesize hostBundle = _hostBundle;
@synthesize window = _window;
@synthesize coreComponent = _coreComponent;
@@ -39,14 +38,13 @@
@synthesize expectedContentLength = _expectedContentLength;
@synthesize contentLengthDownloaded = _contentLengthDownloaded;
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle window:(NSWindow *)window delegate:(id<SPUStandardUserDriverDelegate>)delegate
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle window:(NSWindow *)window
{
self = [super init];
if (self != nil) {
_hostBundle = hostBundle;
_window = window;
_delegate = delegate;
_coreComponent = [[SPUUserDriverCoreComponent alloc] initWithDelegate:delegate];
_coreComponent = [[SPUUserDriverCoreComponent alloc] init];
}
return self;
}
@@ -34,7 +34,7 @@
// If the user is holding down command, we use the popup title user driver instead
id<SPUUserDriver, SPUStandardUserDriverProtocol> userDriver;
if (([NSEvent modifierFlags] & NSCommandKeyMask) != 0) {
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithHostBundle:hostBundle window:self.window delegate:nil];
userDriver = [[SUPopUpTitlebarUserDriver alloc] initWithHostBundle:hostBundle window:self.window];
} else {
userDriver = [[SPUStandardUserDriver alloc] initWithHostBundle:hostBundle delegate:nil];
}