diff --git a/NTSynchronousTask.h b/NTSynchronousTask.h index 58fd4098..01d659fb 100644 --- a/NTSynchronousTask.h +++ b/NTSynchronousTask.h @@ -10,16 +10,6 @@ #define NTSYNCHRONOUSTASK_H @interface NTSynchronousTask : NSObject -{ -@private - NSTask *mv_task; - NSPipe *mv_outputPipe; - NSPipe *mv_inputPipe; - - NSData* mv_output; - BOOL mv_done; - int mv_result; -} @property (readonly, retain) NSData *output; @property (readonly) int result; diff --git a/SUAppcastItem.h b/SUAppcastItem.h index dd740fd8..b20ddb6e 100644 --- a/SUAppcastItem.h +++ b/SUAppcastItem.h @@ -10,28 +10,6 @@ #define SUAPPCASTITEM_H @interface SUAppcastItem : NSObject -{ -@private - NSString *title; - NSDate *date; - NSString *itemDescription; - - NSURL *releaseNotesURL; - - NSString *DSASignature; - NSString *minimumSystemVersion; - NSString *maximumSystemVersion; - - NSURL *fileURL; - NSString *versionString; - NSString *displayVersionString; - - NSDictionary *deltaUpdates; - - NSDictionary *propertiesDictionary; - - NSURL *infoURL; // UK 2007-08-31 -} @property (copy, readonly) NSString *title; @property (copy, readonly) NSDate *date; @property (copy, readonly) NSString *itemDescription; @@ -43,7 +21,7 @@ @property (copy, readonly) NSString *versionString; @property (copy, readonly) NSString *displayVersionString; @property (copy, readonly) NSDictionary *deltaUpdates; -@property (retain, readonly) NSURL *infoURL; +@property (retain, readonly) NSURL *infoURL; // UK 2007-08-31 // Initializes with data from a dictionary provided by the RSS class. - (instancetype)initWithDictionary:(NSDictionary *)dict; diff --git a/SUAppcastItem.m b/SUAppcastItem.m index 4f086fde..c21a100d 100644 --- a/SUAppcastItem.m +++ b/SUAppcastItem.m @@ -27,6 +27,7 @@ @property (copy, readwrite) NSString *displayVersionString; @property (copy, readwrite) NSDictionary *deltaUpdates; @property (retain, readwrite) NSURL *infoURL; +@property (readwrite, copy) NSDictionary *propertiesDictionary; @end @implementation SUAppcastItem @@ -42,6 +43,7 @@ @synthesize releaseNotesURL; @synthesize title; @synthesize versionString; +@synthesize propertiesDictionary; - (BOOL)isDeltaUpdate { @@ -161,7 +163,7 @@ { NSMutableDictionary *deltas = [NSMutableDictionary dictionary]; NSArray *deltaDictionaries = dict[@"deltas"]; - for (NSDictionary *deltaDictionary in [deltaDictionaries objectEnumerator]) { + for (NSDictionary *deltaDictionary in deltaDictionaries) { NSMutableDictionary *fakeAppCastDict = [dict mutableCopy]; [fakeAppCastDict removeObjectForKey:@"deltas"]; fakeAppCastDict[@"enclosure"] = deltaDictionary; @@ -189,13 +191,8 @@ self.versionString = nil; self.displayVersionString = nil; self.infoURL = nil; - [propertiesDictionary release]; + self.propertiesDictionary = nil; [super dealloc]; } -- (NSDictionary *)propertiesDictionary -{ - return propertiesDictionary; -} - @end diff --git a/SUAutomaticUpdateAlert.h b/SUAutomaticUpdateAlert.h index 2c7cce65..7a9022d9 100644 --- a/SUAutomaticUpdateAlert.h +++ b/SUAutomaticUpdateAlert.h @@ -21,11 +21,7 @@ typedef enum } SUAutomaticInstallationChoice; @class SUAppcastItem, SUHost; -@interface SUAutomaticUpdateAlert : SUWindowController { - SUAppcastItem *updateItem; - id delegate; - SUHost *host; -} +@interface SUAutomaticUpdateAlert : SUWindowController - (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle delegate:(id)delegate; - (IBAction)installNow:sender; diff --git a/SUAutomaticUpdateAlert.m b/SUAutomaticUpdateAlert.m index dfe67320..36da1ec6 100644 --- a/SUAutomaticUpdateAlert.m +++ b/SUAutomaticUpdateAlert.m @@ -10,16 +10,25 @@ #import "SUHost.h" +@interface SUAutomaticUpdateAlert () +@property (retain) SUAppcastItem *updateItem; +@property (assign) id delegate; +@property (retain) SUHost *host; +@end + @implementation SUAutomaticUpdateAlert +@synthesize delegate; +@synthesize host; +@synthesize updateItem; - (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:(id)del { self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"]; if (self) { - updateItem = [item retain]; - delegate = del; - host = [aHost retain]; + self.updateItem = item; + self.delegate = del; + self.host = aHost; [self setShouldCascadeWindows:NO]; [[self window] center]; } @@ -28,8 +37,8 @@ - (void)dealloc { - [host release]; - [updateItem release]; + self.host = nil; + self.updateItem = nil; [super dealloc]; } diff --git a/SUDiskImageUnarchiver.m b/SUDiskImageUnarchiver.m index 6ddb9ad6..c2f6bd9f 100644 --- a/SUDiskImageUnarchiver.m +++ b/SUDiskImageUnarchiver.m @@ -49,11 +49,10 @@ CFUUIDRef uuid = CFUUIDCreate(NULL); if (uuid) { - CFStringRef uuidString = CFUUIDCreateString(NULL, uuid); + NSString *uuidString = CFBridgingRelease(CFUUIDCreateString(NULL, uuid)); if (uuidString) { - mountPoint = [@"/Volumes" stringByAppendingPathComponent:(NSString*)uuidString]; - CFRelease(uuidString); + mountPoint = [@"/Volumes" stringByAppendingPathComponent:uuidString]; } CFRelease(uuid); } diff --git a/SUHost.h b/SUHost.h index 3026dd86..520b9f56 100644 --- a/SUHost.h +++ b/SUHost.h @@ -13,7 +13,6 @@ @interface SUHost : NSObject { @private - NSBundle *bundle; NSString *defaultsDomain; BOOL usesStandardUserDefaults; } diff --git a/SUHost.m b/SUHost.m index ea9fa472..cf7a016a 100644 --- a/SUHost.m +++ b/SUHost.m @@ -184,7 +184,7 @@ } CFPropertyListRef obj = CFPreferencesCopyAppValue((CFStringRef)defaultName, (CFStringRef)defaultsDomain); - return [(id)CFMakeCollectable(obj) autorelease]; + return CFBridgingRelease(obj); } - (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName; diff --git a/SUStatusController.h b/SUStatusController.h index 58fb35a4..aa1d7d81 100644 --- a/SUStatusController.h +++ b/SUStatusController.h @@ -13,14 +13,8 @@ @class SUHost; @interface SUStatusController : SUWindowController -{ -@private - double progressValue, maxProgressValue; - NSString *title, *statusText, *buttonTitle; - IBOutlet NSButton *actionButton; - IBOutlet NSProgressIndicator* progressBar; - SUHost *host; -} +@property (assign) IBOutlet NSButton *actionButton; +@property (assign) IBOutlet NSProgressIndicator* progressBar; @property (copy) NSString *statusText; @property double progressValue; diff --git a/SUStatusController.m b/SUStatusController.m index 1792e8e3..0eecff39 100644 --- a/SUStatusController.m +++ b/SUStatusController.m @@ -26,6 +26,8 @@ @synthesize title; @synthesize buttonTitle; @synthesize host; +@synthesize actionButton; +@synthesize progressBar; - (instancetype)initWithHost:(SUHost *)aHost { diff --git a/SUUpdateAlert.h b/SUUpdateAlert.h index 4888e7e5..17650b8e 100644 --- a/SUUpdateAlert.h +++ b/SUUpdateAlert.h @@ -26,8 +26,6 @@ typedef enum @interface SUUpdateAlert : SUWindowController { SUAppcastItem *updateItem; SUHost *host; - id delegate; - id versionDisplayer; IBOutlet WebView *releaseNotesView; IBOutlet NSTextField *description; diff --git a/SUUpdatePermissionPrompt.h b/SUUpdatePermissionPrompt.h index ea50a02e..d3882e85 100644 --- a/SUUpdatePermissionPrompt.h +++ b/SUUpdatePermissionPrompt.h @@ -27,7 +27,6 @@ typedef enum { IBOutlet NSView *moreInfoView; IBOutlet NSButton *moreInfoButton; IBOutlet NSTableView *profileTableView; - BOOL isShowingMoreInfo, shouldSendProfile; } + (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d; - (IBAction)toggleMoreInfo:(id)sender; diff --git a/SUUpdatePermissionPrompt.m b/SUUpdatePermissionPrompt.m index 010eea44..ae25a228 100644 --- a/SUUpdatePermissionPrompt.m +++ b/SUUpdatePermissionPrompt.m @@ -11,6 +11,10 @@ #import "SUHost.h" #import "SUConstants.h" +@interface SUUpdatePermissionPrompt () +@property BOOL isShowingMoreInfo, shouldSendProfile; +@end + @implementation SUUpdatePermissionPrompt - (BOOL)shouldAskAboutProfile @@ -25,8 +29,8 @@ { host = [aHost retain]; delegate = d; - isShowingMoreInfo = NO; - shouldSendProfile = [self shouldAskAboutProfile]; + self.isShowingMoreInfo = NO; + self.shouldSendProfile = [self shouldAskAboutProfile]; systemProfileInformationArray = [profile retain]; [self setShouldCascadeWindows:NO]; } @@ -80,9 +84,7 @@ - (IBAction)toggleMoreInfo:(id)sender { - [self willChangeValueForKey:@"isShowingMoreInfo"]; - isShowingMoreInfo = !isShowingMoreInfo; - [self didChangeValueForKey:@"isShowingMoreInfo"]; + self.isShowingMoreInfo = !_isShowingMoreInfo; NSView *contentView = [[self window] contentView]; NSRect contentViewFrame = [contentView frame]; @@ -92,7 +94,7 @@ NSRect profileMoreInfoButtonFrame = [moreInfoButton frame]; NSRect descriptionFrame = [descriptionTextField frame]; - if (isShowingMoreInfo) + if (_isShowingMoreInfo) { // Add the subview contentViewFrame.size.height += profileMoreInfoViewFrame.size.height; @@ -120,7 +122,7 @@ [[self window] setFrame:windowFrame display:YES animate:YES]; [contentView setFrame:contentViewFrame]; [contentView setNeedsDisplay:YES]; - [moreInfoView setHidden:(!isShowingMoreInfo)]; + [moreInfoView setHidden:(!_isShowingMoreInfo)]; } - (IBAction)finishPrompt:(id)sender @@ -128,7 +130,7 @@ if (![delegate respondsToSelector:@selector(updatePermissionPromptFinishedWithResult:)]) { [NSException raise:@"SUInvalidDelegate" format:@"SUUpdatePermissionPrompt's delegate (%@) doesn't respond to updatePermissionPromptFinishedWithResult:!", delegate]; } - [host setBool:shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey]; + [host setBool:_shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey]; [delegate updatePermissionPromptFinishedWithResult:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck)]; [[self window] close]; [NSApp stopModal]; diff --git a/SUUpdater.h b/SUUpdater.h index f6a0806b..90bda895 100644 --- a/SUUpdater.h +++ b/SUUpdater.h @@ -17,14 +17,11 @@ @interface SUUpdater : NSObject { @private - NSTimer *checkTimer; SUUpdateDriver *driver; - NSString *customUserAgentString; SUHost *host; - IBOutlet id delegate; } -@property (assign) id delegate; +@property (assign) IBOutlet id delegate; + (SUUpdater *)sharedUpdater; + (SUUpdater *)updaterForBundle:(NSBundle *)bundle;