Fix disableUpdateManager not working as advertised

This bug did not affect the automatic disabling of the module when run from the App Store! That one was and is working as advertised.
This commit is contained in:
Andreas Linde 2012-08-21 23:54:13 +02:00
parent b471b6b66a
commit a227ff9f7a
3 changed files with 15 additions and 0 deletions

View File

@ -163,6 +163,14 @@
} }
- (void)setDisableUpdateManager:(BOOL)disableUpdateManager {
if (_updateManager) {
[_updateManager setDisableUpdateManager:disableUpdateManager];
}
_disableUpdateManager = disableUpdateManager;
}
- (void)setUpdateURL:(NSString *)anUpdateURL { - (void)setUpdateURL:(NSString *)anUpdateURL {
// ensure url ends with a trailing slash // ensure url ends with a trailing slash
if (![anUpdateURL hasSuffix:@"/"]) { if (![anUpdateURL hasSuffix:@"/"]) {

View File

@ -342,6 +342,7 @@
_lastCheck = nil; _lastCheck = nil;
_uuid = [[self executableUUID] retain]; _uuid = [[self executableUUID] retain];
_sendUsageData = YES; _sendUsageData = YES;
_disableUpdateManager = NO;
// set defaults // set defaults
self.showDirectInstallOption = NO; self.showDirectInstallOption = NO;
@ -494,6 +495,7 @@
- (void)showCheckForUpdateAlert { - (void)showCheckForUpdateAlert {
if (_isAppStoreEnvironment) return; if (_isAppStoreEnvironment) return;
if ([self isUpdateManagerDisabled]) return;
if (!_updateAlertShowing) { if (!_updateAlertShowing) {
if ([self hasNewerMandatoryVersion]) { if ([self hasNewerMandatoryVersion]) {
@ -762,6 +764,7 @@
- (void)checkForUpdate { - (void)checkForUpdate {
if (_isAppStoreEnvironment && !_checkForTracker) return; if (_isAppStoreEnvironment && !_checkForTracker) return;
if ([self isUpdateManagerDisabled]) return;
if ([self expiryDateReached]) return; if ([self expiryDateReached]) return;
@ -884,6 +887,8 @@
// begin the startup process // begin the startup process
- (void)startManager { - (void)startManager {
if ([self isUpdateManagerDisabled]) return;
BITHockeyLog(@"INFO: Start UpdateManager"); BITHockeyLog(@"INFO: Start UpdateManager");
if ([self expiryDateReached]) return; if ([self expiryDateReached]) return;

View File

@ -64,6 +64,8 @@
// Contains the tracker config if received from server // Contains the tracker config if received from server
@property (nonatomic, retain) NSDictionary *trackerConfig; @property (nonatomic, retain) NSDictionary *trackerConfig;
// used by BITHockeyManager if disable status is changed
@property (nonatomic, getter = isUpdateManagerDisabled) BOOL disableUpdateManager;
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment; - (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment;