Changeset 13248
- Timestamp:
- Mar 10, 2012, 3:38:58 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 71 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Transmission.xcodeproj/project.pbxproj
r13202 r13248 241 241 A29E653613F1603100048D71 /* evutil_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = A29E653513F1603100048D71 /* evutil_rand.c */; }; 242 242 A2A1CB7A0BF29D5500AE959F /* PeerProgressIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A1CB780BF29D5500AE959F /* PeerProgressIndicatorCell.m */; }; 243 A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; };244 A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; };245 A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; };246 A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */; };243 A2A3065C0AAD24A80049E2AC /* UKFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306540AAD24A80049E2AC /* UKFileWatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 244 A2A3065E0AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306560AAD24A80049E2AC /* UKFNSubscribeFileWatcher.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 245 A2A306600AAD24A80049E2AC /* UKKQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A306580AAD24A80049E2AC /* UKKQueue.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 246 A2A306620AAD24A80049E2AC /* UKMainThreadProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = A2A3065A0AAD24A80049E2AC /* UKMainThreadProxy.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 247 247 A2A4E9210DE0F7E9000CE197 /* web.h in Headers */ = {isa = PBXBuildFile; fileRef = A29EBE530DC01FC9006CEE80 /* web.h */; }; 248 248 A2A4E9220DE0F7EB000CE197 /* web.c in Sources */ = {isa = PBXBuildFile; fileRef = A29EBE520DC01FC9006CEE80 /* web.c */; }; … … 1164 1164 A2ED7D8D0CEF431B00970975 /* FilterButton.h */, 1165 1165 A2ED7D8E0CEF431B00970975 /* FilterButton.m */, 1166 A28E1DDF0CFFD8EC00E16385 /* ButtonToolbarItem.h */, 1166 1167 A2C89D5F0CFCBF57004CC2BC /* ButtonToolbarItem.m */, 1167 A28E1DDF0CFFD8EC00E16385 /* ButtonToolbarItem.h */,1168 1168 A21979890D07B78400438EA7 /* GroupToolbarItem.h */, 1169 1169 A219798A0D07B78400438EA7 /* GroupToolbarItem.m */, … … 2731 2731 isa = XCBuildConfiguration; 2732 2732 buildSettings = { 2733 CLANG_ENABLE_OBJC_ARC = YES; 2733 2734 FRAMEWORK_SEARCH_PATHS = macosx; 2734 2735 GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch; … … 2889 2890 isa = XCBuildConfiguration; 2890 2891 buildSettings = { 2892 CLANG_ENABLE_OBJC_ARC = YES; 2891 2893 FRAMEWORK_SEARCH_PATHS = macosx; 2892 2894 GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch; … … 2998 3000 isa = XCBuildConfiguration; 2999 3001 buildSettings = { 3002 CLANG_ENABLE_OBJC_ARC = YES; 3000 3003 FRAMEWORK_SEARCH_PATHS = macosx; 3001 3004 GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch; -
trunk/macosx/AboutWindowController.m
r13162 r13248 44 44 value: nil table: @"InfoPlist"]]; 45 45 46 [[fTextView textStorage] setAttributedString: [[ [NSAttributedString alloc] initWithPath:47 [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil] autorelease]];46 [[fTextView textStorage] setAttributedString: [[NSAttributedString alloc] initWithPath: 47 [[NSBundle mainBundle] pathForResource: @"Credits" ofType: @"rtf"] documentAttributes: nil]]; 48 48 49 49 //size license button … … 66 66 - (void) windowWillClose: (id) sender 67 67 { 68 [fAboutBoxInstance autorelease];69 68 fAboutBoxInstance = nil; 70 69 } -
trunk/macosx/AddMagnetWindowController.h
r13162 r13248 35 35 IBOutlet NSPopUpButton * fGroupPopUp, * fPriorityPopUp; 36 36 37 Controller * fController;37 __unsafe_unretained Controller * fController; 38 38 39 39 Torrent * fTorrent; -
trunk/macosx/AddMagnetWindowController.m
r13162 r13248 54 54 { 55 55 fTorrent = torrent; 56 fDestination = [ [path stringByExpandingTildeInPath] retain];56 fDestination = [path stringByExpandingTildeInPath]; 57 57 58 58 fController = controller; … … 107 107 { 108 108 [[NSNotificationCenter defaultCenter] removeObserver: self]; 109 110 [fDestination release];111 112 [super dealloc];113 109 } 114 110 … … 219 215 if (!fDestination || ![fDestination isEqualToString: destination]) 220 216 { 221 [fDestination release]; 222 fDestination = [destination retain]; 217 fDestination = destination; 223 218 224 219 [fTorrent changeDownloadFolderBeforeUsing: fDestination]; … … 230 225 ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init]; 231 226 [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]]; 232 [iconTransformer release];233 227 } 234 228 … … 256 250 [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"]; 257 251 258 [alert release];259 252 260 253 if (returnCode == NSAlertSecondButtonReturn) -
trunk/macosx/AddWindowController.h
r13162 r13248 39 39 IBOutlet FileOutlineController * fFileController; 40 40 41 Controller * fController;41 __unsafe_unretained Controller * fController; 42 42 43 43 Torrent * fTorrent; -
trunk/macosx/AddWindowController.m
r13162 r13248 61 61 { 62 62 fTorrent = torrent; 63 fDestination = [ [path stringByExpandingTildeInPath] retain];63 fDestination = [path stringByExpandingTildeInPath]; 64 64 fLockDestination = lockDestination; 65 65 66 66 fController = controller; 67 67 68 fTorrentFile = [ [torrentFile stringByExpandingTildeInPath] retain];68 fTorrentFile = [torrentFile stringByExpandingTildeInPath]; 69 69 70 70 fDeleteTorrentInitial = deleteTorrent; … … 140 140 141 141 [fTimer invalidate]; 142 143 [fDestination release];144 [fTorrentFile release];145 146 [super dealloc];147 142 } 148 143 … … 317 312 if (!fDestination || ![fDestination isEqualToString: destination]) 318 313 { 319 [fDestination release]; 320 fDestination = [destination retain]; 314 fDestination = destination; 321 315 322 316 [fTorrent changeDownloadFolderBeforeUsing: fDestination]; … … 328 322 ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init]; 329 323 [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]]; 330 [iconTransformer release];331 324 } 332 325 … … 357 350 [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"]; 358 351 359 [alert release];360 352 361 353 if (returnCode == NSAlertSecondButtonReturn) -
trunk/macosx/BadgeView.m
r13162 r13248 49 49 } 50 50 51 - (void) dealloc52 {53 [fAttributes release];54 [super dealloc];55 }56 51 57 52 - (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate … … 114 109 [fAttributes setObject: stringShadow forKey: NSShadowAttributeName]; 115 110 116 [stringShadow release];117 111 } 118 112 -
trunk/macosx/Badger.m
r13162 r13248 38 38 BadgeView * view = [[BadgeView alloc] initWithLib: lib]; 39 39 [[NSApp dockTile] setContentView: view]; 40 [view release];41 40 42 41 fHashes = [[NSMutableSet alloc] init]; … … 49 48 { 50 49 [[NSNotificationCenter defaultCenter] removeObserver: self]; 51 52 [fHashes release];53 54 [super dealloc];55 50 } 56 51 -
trunk/macosx/BlocklistDownloader.h
r13162 r13248 38 38 NSURLDownload * fDownload; 39 39 40 BlocklistDownloaderViewController * fViewController;40 __unsafe_unretained BlocklistDownloaderViewController * fViewController; 41 41 42 42 NSString * fDestination; -
trunk/macosx/BlocklistDownloader.m
r13219 r13248 75 75 } 76 76 77 - (void) dealloc78 {79 [fDownload release];80 [fDestination release];81 [super dealloc];82 }83 77 84 78 - (void) cancelDownload … … 91 85 92 86 fDownloader = nil; 93 [self release];94 87 } 95 88 … … 102 95 - (void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path 103 96 { 104 [fDestination release]; 105 fDestination = [path retain]; 97 fDestination = path; 106 98 } 107 99 … … 130 122 131 123 fDownloader = nil; 132 [self release];133 124 } 134 125 … … 196 187 success = NO; 197 188 } 198 [unzip release];199 189 200 190 if (success) { … … 217 207 [zipinfo waitUntilExit]; 218 208 219 NSString * actualFilename = [[ [NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]220 encoding: NSUTF8StringEncoding] autorelease];209 NSString * actualFilename = [[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile] 210 encoding: NSUTF8StringEncoding]; 221 211 actualFilename = [actualFilename stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; 222 212 NSString * newBlocklistPath = [workingDirectory stringByAppendingPathComponent: actualFilename]; … … 225 215 [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL]; 226 216 227 [fDestination release]; 228 fDestination = [newBlocklistPath retain]; 217 fDestination = newBlocklistPath; 229 218 } 230 219 @catch(id exc) {} 231 [zipinfo release];232 220 } 233 221 } … … 267 255 268 256 fDownloader = nil; 269 [self release];270 257 } 271 258 -
trunk/macosx/BlocklistDownloaderViewController.h
r13162 r13248 30 30 @interface BlocklistDownloaderViewController : NSObject 31 31 { 32 PrefsController * fPrefsController;32 __unsafe_unretained PrefsController * fPrefsController; 33 33 34 34 IBOutlet NSWindow * fStatusWindow; -
trunk/macosx/BlocklistDownloaderViewController.m
r13162 r13248 38 38 @implementation BlocklistDownloaderViewController 39 39 40 #warning make gcd singleton 40 41 + (void) downloadWithPrefsController: (PrefsController *) prefsController 41 42 { … … 102 103 [fStatusWindow orderOut: self]; 103 104 104 [self release];105 105 } 106 106 … … 110 110 [fStatusWindow orderOut: self]; 111 111 112 NSAlert * alert = [[ [NSAlert alloc] init] autorelease];112 NSAlert * alert = [[NSAlert alloc] init]; 113 113 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Blocklist -> button")]; 114 114 [alert setMessageText: NSLocalizedString(@"Download of the blocklist failed.", "Blocklist -> message")]; … … 149 149 { 150 150 [[alert window] orderOut: self]; 151 [self release];152 151 } 153 152 -
trunk/macosx/BonjourController.m
r13162 r13248 27 27 @implementation BonjourController 28 28 29 #warning make gcd singleton 29 30 BonjourController * fDefaultController = nil; 30 31 + (BonjourController *) defaultController … … 35 36 } 36 37 37 - (void) dealloc38 {39 [fService release];40 [super dealloc];41 }42 38 43 39 - (void) startWithPort: (NSInteger) port … … 56 52 { 57 53 [fService stop]; 58 [fService release];59 54 fService = nil; 60 55 } -
trunk/macosx/ButtonToolbarItem.h
r13162 r13248 26 26 27 27 @interface ButtonToolbarItem : NSToolbarItem 28 {29 }30 28 31 29 @end -
trunk/macosx/ButtonToolbarItem.m
r13162 r13248 38 38 [menuItem setEnabled: [[self target] validateToolbarItem: self]]; 39 39 40 return [menuItem autorelease];40 return menuItem; 41 41 } 42 42 -
trunk/macosx/Controller.h
r13184 r13248 107 107 NSMutableSet * fAddingTransfers; 108 108 109 NSMutableSet * fAddWindows; 110 URLSheetWindowController * fUrlSheetController; 111 109 112 BOOL fGlobalPopoverShown; 110 113 BOOL fSoundPlaying; … … 128 131 - (void) openURL: (NSString *) urlString; 129 132 - (void) openURLShowSheet: (id) sender; 130 - (void) urlSheetDidEnd: (URLSheetWindowController *) controller url: (NSString *) urlString returnCode: (NSInteger) returnCode;131 133 132 134 - (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo; -
trunk/macosx/Controller.m
r13240 r13248 140 140 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [[NSNumber alloc] initWithBool: active], @"Active", 141 141 [[NSNumber alloc] initWithBool: byUser], @"ByUser", nil]; 142 [( Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)142 [(__bridge Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:) 143 143 withObject: dict waitUntilDone: NO]; 144 144 } … … 147 147 void * controller) 148 148 { 149 [( Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];149 [(__bridge Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct]; 150 150 return TR_RPC_NOREMOVE; //we'll do the remove manually 151 151 } … … 153 153 static void sleepCallback(void * controller, io_service_t y, natural_t messageType, void * messageArgument) 154 154 { 155 [( Controller *)controller sleepCallback: messageType argument: messageArgument];155 [(__bridge Controller *)controller sleepCallback: messageType argument: messageArgument]; 156 156 } 157 157 … … 173 173 174 174 [alert runModal]; 175 [alert release];176 175 177 176 //kill ourselves right away … … 183 182 184 183 //set custom value transformers 185 ExpandedPathToPathTransformer * pathTransformer = [[ [ExpandedPathToPathTransformer alloc] init] autorelease];184 ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init]; 186 185 [NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"]; 187 186 188 ExpandedPathToIconTransformer * iconTransformer = [[ [ExpandedPathToIconTransformer alloc] init] autorelease];187 ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init]; 189 188 [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"]; 190 189 … … 204 203 if ([alert runModal] == NSAlertSecondButtonReturn) 205 204 exit(0); 206 [alert release];207 205 208 206 [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"]; … … 343 341 fSoundPlaying = NO; 344 342 345 tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self);343 tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, (__bridge void *)(self)); 346 344 if (usesSpeedLimitSched) 347 345 [fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"]; 348 346 349 tr_sessionSetRPCCallback(fLib, rpcCallback, self);347 tr_sessionSetRPCCallback(fLib, rpcCallback, (__bridge void *)(self)); 350 348 351 349 [GrowlApplicationBridge setGrowlDelegate: self]; … … 369 367 [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly]; 370 368 [fWindow setToolbar: toolbar]; 371 [toolbar release];372 369 373 370 [fWindow setDelegate: self]; //do manually to avoid placement issue … … 439 436 IONotificationPortRef notify; 440 437 io_object_t iterator; 441 if ((fRootPort = IORegisterForSystemPower( self, & notify, sleepCallback, &iterator)))438 if ((fRootPort = IORegisterForSystemPower((__bridge void *)(self), & notify, sleepCallback, &iterator))) 442 439 CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes); 443 440 else … … 469 466 [waitToStartTorrents addObject: torrent]; 470 467 471 [torrent release];472 468 } 473 469 } … … 600 596 [fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"]; 601 597 602 [alert release];603 598 } 604 599 } … … 671 666 if ([fAutoImportTimer isValid]) 672 667 [fAutoImportTimer invalidate]; 673 [fAutoImportTimer release];674 668 } 675 669 … … 683 677 NSURLDownload * download = [downloadDict objectForKey: @"Download"]; 684 678 [download cancel]; 685 [download release]; 686 } 687 [fPendingTorrentDownloads release]; 679 } 688 680 } 689 681 … … 704 696 [fTableView saveCollapsedGroups]; 705 697 706 //remaining calls the same as dealloc707 [fInfoController release];708 [fMessageController release];709 [fPrefsController release];710 711 [fStatusBar release];712 [fFilterBar release];713 714 [fTorrents release];715 [fDisplayedTorrents release];716 717 [fAddingTransfers release];718 719 [fOverlayWindow release];720 [fBadger release];721 722 [fAutoImportedNames release];723 724 [fPreviewPanel release];725 726 698 //complete cleanup 727 699 tr_sessionClose(fLib); … … 751 723 { 752 724 [download cancel]; 725 726 [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; 727 if ([fPendingTorrentDownloads count] == 0) 728 fPendingTorrentDownloads = nil; 753 729 754 730 NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"), … … 757 733 [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]], 758 734 NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil); 759 760 [download release];761 735 } 762 736 else … … 767 741 -(void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path 768 742 { 769 if (!fPendingTorrentDownloads) 770 fPendingTorrentDownloads = [[NSMutableDictionary alloc] init]; 771 772 [fPendingTorrentDownloads setObject: [NSDictionary dictionaryWithObjectsAndKeys: 773 path, @"Path", download, @"Download", nil] forKey: [[download request] URL]]; 743 [(NSMutableDictionary *)[fPendingTorrentDownloads objectForKey: [[download request] URL]] setObject: path forKey: @"Path"]; 774 744 } 775 745 … … 784 754 [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; 785 755 if ([fPendingTorrentDownloads count] == 0) 786 {787 [fPendingTorrentDownloads release];788 756 fPendingTorrentDownloads = nil; 789 }790 791 [download release];792 757 } 793 758 … … 803 768 [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; 804 769 if ([fPendingTorrentDownloads count] == 0) 805 {806 [fPendingTorrentDownloads release];807 770 fPendingTorrentDownloads = nil; 808 }809 810 [download release];811 771 } 812 772 … … 902 862 deleteTorrent: deleteTorrentFile canToggleDelete: canToggleDelete]; 903 863 [addController showWindow: self]; 864 865 if (!fAddWindows) 866 fAddWindows = [NSMutableSet set]; 867 [fAddWindows addObject: addController]; 904 868 } 905 869 else … … 910 874 [torrent update]; 911 875 [fTorrents addObject: torrent]; 912 [torrent release];913 876 914 877 if (!fAddingTransfers) … … 924 887 { 925 888 Torrent * torrent = [addController torrent]; 926 [addController autorelease];927 889 928 890 if (add) … … 932 894 [torrent update]; 933 895 [fTorrents addObject: torrent]; 934 [torrent release];935 896 936 897 if (!fAddingTransfers) … … 943 904 { 944 905 [torrent closeRemoveTorrent: NO]; 945 [torrent release]; 946 } 906 } 907 908 [fAddWindows removeObject: addController]; 909 if ([fAddWindows count] == 0) 910 fAddWindows = nil; 947 911 } 948 912 … … 982 946 controller: self]; 983 947 [addController showWindow: self]; 948 949 if (!fAddWindows) 950 fAddWindows = [NSMutableSet set]; 951 [fAddWindows addObject: addController]; 984 952 } 985 953 else … … 990 958 [torrent update]; 991 959 [fTorrents addObject: torrent]; 992 [torrent release];993 960 994 961 if (!fAddingTransfers) … … 1003 970 { 1004 971 Torrent * torrent = [addController torrent]; 1005 [addController autorelease];1006 972 1007 973 if (add) … … 1011 977 [torrent update]; 1012 978 [fTorrents addObject: torrent]; 1013 [torrent release];1014 979 1015 980 if (!fAddingTransfers) … … 1022 987 { 1023 988 [torrent closeRemoveTorrent: NO]; 1024 [torrent release]; 1025 } 989 } 990 991 [fAddWindows removeObject: addController]; 992 if ([fAddWindows count] == 0) 993 fAddWindows = nil; 1026 994 } 1027 995 … … 1029 997 { 1030 998 NSDictionary * dict = [notification userInfo]; 1031 [self openFiles: [NSArray arrayWithObject: [dict objectForKey: @"File"]] addType: ADD_CREATED 1032 forcePath: [dict objectForKey: @"Path"]]; 1033 [dict release]; 999 [self openFiles: [NSArray arrayWithObject: [dict objectForKey: @"File"]] addType: ADD_CREATED forcePath: [dict objectForKey: @"Path"]]; 1034 1000 } 1035 1001 … … 1037 1003 { 1038 1004 [self openFiles: [dictionary objectForKey: @"Filenames"] addType: [[dictionary objectForKey: @"AddType"] intValue] forcePath: nil]; 1039 1040 [dictionary release];1041 1005 } 1042 1006 … … 1090 1054 if ([[alert suppressionButton] state] == NSOnState) 1091 1055 [fDefaults setBool: NO forKey: @"WarningInvalidOpen"]; 1092 [alert release];1093 1056 } 1094 1057 … … 1108 1071 if ([[alert suppressionButton] state] == NSOnState) 1109 1072 [fDefaults setBool: NO forKey: @"WarningInvalidOpen"]; 1110 [alert release];1111 1073 } 1112 1074 … … 1129 1091 if ([[alert suppressionButton] state]) 1130 1092 [fDefaults setBool: NO forKey: @"WarningDuplicate"]; 1131 [alert release];1132 1093 } 1133 1094 … … 1154 1115 if ([[alert suppressionButton] state]) 1155 1116 [fDefaults setBool: NO forKey: @"WarningDuplicate"]; 1156 [alert release];1157 1117 } 1158 1118 … … 1181 1141 NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString] 1182 1142 cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 60]; 1183 [[NSURLDownload alloc] initWithRequest: request delegate: self]; 1143 1144 if ([fPendingTorrentDownloads objectForKey: [request URL]]) 1145 { 1146 NSLog(@"Already downloading %@", [request URL]); 1147 return; 1148 } 1149 1150 NSURLDownload * download = [[NSURLDownload alloc] initWithRequest: request delegate: self]; 1151 1152 if (!fPendingTorrentDownloads) 1153 fPendingTorrentDownloads = [[NSMutableDictionary alloc] init]; 1154 1155 [fPendingTorrentDownloads setObject: [NSMutableDictionary dictionaryWithObject: download forKey: @"Download"] forKey: [request URL]]; 1184 1156 } 1185 1157 } … … 1187 1159 - (void) openURLShowSheet: (id) sender 1188 1160 { 1189 [[[URLSheetWindowController alloc] initWithController: self] beginSheetForWindow: fWindow]; 1190 } 1191 1192 - (void) urlSheetDidEnd: (URLSheetWindowController *) controller url: (NSString *) urlString returnCode: (NSInteger) returnCode 1161 if (!fUrlSheetController) 1162 { 1163 fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self]; 1164 1165 [NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; 1166 } 1167 } 1168 1169 - (void) urlSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo 1193 1170 { 1194 1171 if (returnCode == 1) 1172 { 1173 NSString * urlString = [fUrlSheetController urlString]; 1195 1174 [self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO]; 1196 1197 [controller release]; 1175 } 1176 1177 fUrlSheetController = nil; 1198 1178 } 1199 1179 … … 1277 1257 - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData 1278 1258 { 1279 [torrents retain];1280 1259 1281 1260 if ([fDefaults boolForKey: @"CheckRemove"]) … … 1340 1319 NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"), 1341 1320 NSLocalizedString(@"Cancel", "Removal confirm panel -> button"), nil, fWindow, self, 1342 nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), dict, message);1321 nil, @selector(removeSheetDidEnd:returnCode:contextInfo:), (__bridge void *)dict, message); 1343 1322 return; 1344 1323 } … … 1353 1332 if (returnCode == NSAlertDefaultReturn) 1354 1333 [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]]; 1355 else1356 [torrents release];1357 1358 [dict release];1359 1334 } 1360 1335 … … 1444 1419 1445 1420 [self fullUpdateUI]; 1446 1447 #warning why do we need them retained?1448 [torrents autorelease];1449 1421 } 1450 1422 … … 1488 1460 } 1489 1461 1490 NSAlert * alert = [[ [NSAlert alloc] init] autorelease];1462 NSAlert * alert = [[NSAlert alloc] init]; 1491 1463 [alert setMessageText: message]; 1492 1464 [alert setInformativeText: info]; … … 1502 1474 if (returnCode != NSAlertFirstButtonReturn) 1503 1475 { 1504 [torrents release];1505 1476 return; 1506 1477 } … … 1550 1521 if ([torrents count] == 0) 1551 1522 { 1552 [torrents release];1553 1523 return; 1554 1524 } … … 1587 1557 1588 1558 [alert runModal]; 1589 [alert release];1590 1559 } 1591 1560 … … 2301 2270 if (!newGroup) 2302 2271 { 2303 newGroup = [[ [TorrentGroup alloc] initWithGroup: groupValue] autorelease];2272 newGroup = [[TorrentGroup alloc] initWithGroup: groupValue]; 2304 2273 [groupsByIndex setObject: newGroup forKey: [NSNumber numberWithInteger: groupValue]]; 2305 2274 [fDisplayedTorrents addObject: newGroup]; … … 2347 2316 if (!group) 2348 2317 { 2349 group = [[ [TorrentGroup alloc] initWithGroup: groupValue] autorelease];2318 group = [[TorrentGroup alloc] initWithGroup: groupValue]; 2350 2319 [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]]; 2351 2320 [fDisplayedTorrents addObject: group]; … … 2410 2379 if (!group) 2411 2380 { 2412 group = [[ [TorrentGroup alloc] initWithGroup: groupValue] autorelease];2381 group = [[TorrentGroup alloc] initWithGroup: groupValue]; 2413 2382 [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]]; 2414 2383 } … … 2478 2447 if (fAddingTransfers) 2479 2448 { 2480 [fAddingTransfers release];2481 2449 fAddingTransfers = nil; 2482 2450 } … … 2503 2471 [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge]; 2504 2472 2505 [viewController release];2506 [popover release];2507 2473 } 2508 2474 else … … 2540 2506 for (NSInteger i = 0; i < groupMenuCount; i++) 2541 2507 { 2542 NSMenuItem * item = [ [groupMenu itemAtIndex: 0] retain];2508 NSMenuItem * item = [groupMenu itemAtIndex: 0]; 2543 2509 [groupMenu removeItemAtIndex: 0]; 2544 2510 [menu addItem: item]; 2545 [item release];2546 2511 } 2547 2512 } … … 2562 2527 [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]]; 2563 2528 [menu addItem: item]; 2564 [item release];2565 2529 } 2566 2530 } … … 2580 2544 [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]]; 2581 2545 [menu addItem: item]; 2582 [item release];2583 2546 } 2584 2547 } … … 2627 2590 notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil]; 2628 2591 2629 [dict release];2630 2592 } 2631 2593 … … 2679 2641 if ([fAutoImportTimer isValid]) 2680 2642 [fAutoImportTimer invalidate]; 2681 [fAutoImportTimer release];2682 2643 fAutoImportTimer = nil; 2683 2644 } 2684 2645 2685 2646 //check again in 10 seconds in case torrent file wasn't complete 2686 fAutoImportTimer = [ [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self2687 selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain];2647 fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self 2648 selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO]; 2688 2649 2689 2650 [self checkAutoImportDirectory]; … … 2697 2658 if ([fAutoImportTimer isValid]) 2698 2659 [fAutoImportTimer invalidate]; 2699 [fAutoImportTimer release];2700 2660 fAutoImportTimer = nil; 2701 2661 } 2702 2662 2703 if (fAutoImportedNames) 2704 { 2705 [fAutoImportedNames release]; 2706 fAutoImportedNames = nil; 2707 } 2663 fAutoImportedNames = nil; 2708 2664 2709 2665 [self checkAutoImportDirectory]; … … 2766 2722 } 2767 2723 2768 [newNames release];2769 2724 } 2770 2725 … … 3304 3259 { 3305 3260 [[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay]; 3306 [fStatusBar release];3307 3261 fStatusBar = nil; 3308 3262 } … … 3402 3356 { 3403 3357 [[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay]; 3404 [fFilterBar release];3405 3358 fFilterBar = nil; 3406 3359 } … … 3431 3384 - (void) beginPreviewPanelControl: (QLPreviewPanel *) panel 3432 3385 { 3433 fPreviewPanel = [panel retain];3386 fPreviewPanel = panel; 3434 3387 [fPreviewPanel setDelegate: self]; 3435 3388 [fPreviewPanel setDataSource: self]; … … 3438 3391 - (void) endPreviewPanelControl: (QLPreviewPanel *) panel 3439 3392 { 3440 [fPreviewPanel release];3441 3393 fPreviewPanel = nil; 3442 3394 } … … 3515 3467 3516 3468 [item setView: button]; 3517 [button release];3518 3469 3519 3470 const NSSize buttonSize = NSMakeSize(36.0, 25.0); … … 3521 3472 [item setMaxSize: buttonSize]; 3522 3473 3523 return [item autorelease];3474 return item; 3524 3475 } 3525 3476 … … 3601 3552 3602 3553 NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect]; 3603 [segmentedControl setCell: [[ [ToolbarSegmentedCell alloc] init] autorelease]];3554 [segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]]; 3604 3555 [groupItem setView: segmentedControl]; 3605 3556 NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell]; … … 3632 3583 NSLocalizedString(@"Resume All", "All toolbar item -> label"), nil]]; 3633 3584 3634 [segmentedControl release];3635 3585 3636 3586 [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; 3637 3587 3638 return [groupItem autorelease];3588 return groupItem; 3639 3589 } 3640 3590 else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED]) … … 3643 3593 3644 3594 NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect]; 3645 [segmentedControl setCell: [[ [ToolbarSegmentedCell alloc] init] autorelease]];3595 [segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]]; 3646 3596 [groupItem setView: segmentedControl]; 3647 3597 NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell]; … … 3674 3624 NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label"), nil]]; 3675 3625 3676 [segmentedControl release];3677 3626 3678 3627 [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh]; 3679 3628 3680 return [groupItem autorelease];3629 return groupItem; 3681 3630 } 3682 3631 else if ([ident isEqualToString: TOOLBAR_FILTER]) … … 4276 4225 [menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""]; 4277 4226 4278 return [menu autorelease];4227 return menu; 4279 4228 } 4280 4229 … … 4439 4388 if (torrentStruct == [torrent torrentStruct]) 4440 4389 { 4441 [torrent retain];4442 4390 break; 4443 4391 } … … 4454 4402 case TR_RPC_TORRENT_ADDED: 4455 4403 [self performSelectorOnMainThread: @selector(rpcAddTorrentStruct:) withObject: 4456 [ [NSValue valueWithPointer: torrentStruct] retain] waitUntilDone: NO];4404 [NSValue valueWithPointer: torrentStruct] waitUntilDone: NO]; 4457 4405 break; 4458 4406 … … 4493 4441 default: 4494 4442 NSAssert1(NO, @"Unknown RPC command received: %d", type); 4495 [torrent release];4496 4443 } 4497 4444 } … … 4501 4448 { 4502 4449 tr_torrent * torrentStruct = (tr_torrent *)[torrentStructPtr pointerValue]; 4503 [torrentStructPtr release];4504 4450 4505 4451 NSString * location = nil; … … 4518 4464 [torrent update]; 4519 4465 [fTorrents addObject: torrent]; 4520 [torrent release];4521 4466 4522 4467 if (!fAddingTransfers) … … 4529 4474 - (void) rpcRemoveTorrent: (Torrent *) torrent 4530 4475 { 4531 [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO]; 4532 [torrent release]; 4476 [self confirmRemoveTorrents: [NSArray arrayWithObject: torrent] deleteData: NO]; 4533 4477 } 4534 4478 4535 4479 - (void) rpcRemoveTorrentDeleteData: (Torrent *) torrent 4536 4480 { 4537 [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: YES]; 4538 [torrent release]; 4481 [self confirmRemoveTorrents: [NSArray arrayWithObject: torrent] deleteData: YES]; 4539 4482 } 4540 4483 … … 4542 4485 { 4543 4486 [torrent update]; 4544 [torrent release];4545 4487 4546 4488 [self updateUI]; … … 4559 4501 } 4560 4502 4561 [torrent release];4562 4503 } 4563 4504 … … 4570 4511 [fInfoController updateInfoStats]; 4571 4512 4572 [torrent release];4573 4513 } 4574 4514 -
trunk/macosx/CreatorWindowController.m
r13162 r13248 68 68 fStarted = NO; 69 69 70 fPath = [path retain];70 fPath = path; 71 71 fInfo = tr_metaInfoBuilderCreate([fPath UTF8String]); 72 72 … … 82 82 83 83 [alert runModal]; 84 [alert release]; 85 86 [self release]; 84 87 85 return nil; 88 86 } … … 98 96 99 97 [alert runModal]; 100 [alert release]; 101 102 [self release]; 98 103 99 return nil; 104 100 } … … 171 167 fInfo->pieceCount, [NSString stringForFileSize: fInfo->pieceSize]]]; 172 168 173 fLocation = [[[ [fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent:174 [name stringByAppendingPathExtension: @"torrent"]] retain];169 fLocation = [[[fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent: 170 [name stringByAppendingPathExtension: @"torrent"]]; 175 171 [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]]; 176 172 [fLocationField setToolTip: fLocation]; … … 185 181 - (void) dealloc 186 182 { 187 [fPath release]; 188 [fLocation release]; 189 190 [fTrackers release]; 183 191 184 192 185 if (fInfo) … … 195 188 [fTimer invalidate]; 196 189 197 [super dealloc];198 190 } 199 191 … … 215 207 if (result == NSFileHandlingPanelOKButton) 216 208 { 217 [fLocation release]; 218 fLocation = [[[panel URL] path] retain]; 209 fLocation = [[panel URL] path]; 219 210 220 211 [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]]; … … 262 253 } 263 254 264 - (void) windowWillClose: (NSNotification *) notification265 {266 [self autorelease];267 }268 269 255 - (void) cancelCreateProgress: (id) sender 270 256 { … … 373 359 BOOL added = NO; 374 360 375 for ( NSString * tracker in tempTrackers)361 for (__strong NSString * tracker in tempTrackers) 376 362 { 377 363 tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; … … 426 412 } 427 413 428 [alert release];429 414 430 415 if (returnCode == NSAlertFirstButtonReturn) … … 437 422 if (![[NSFileManager defaultManager] fileExistsAtPath: [fLocation stringByDeletingLastPathComponent]]) 438 423 { 439 NSAlert * alert = [[ [NSAlert alloc] init] autorelease];424 NSAlert * alert = [[NSAlert alloc] init]; 440 425 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> directory doesn't exist warning -> button")]; 441 426 [alert setMessageText: NSLocalizedString(@"The chosen torrent file location does not exist.", … … 458 443 NSInteger count = [pathComponents count]; 459 444 460 NSAlert * alert = [[ [NSAlert alloc] init] autorelease];445 NSAlert * alert = [[NSAlert alloc] init]; 461 446 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> file already exists warning -> button")]; 462 447 [alert setMessageText: NSLocalizedString(@"A torrent file with this name and directory cannot be created.", … … 523 508 524 509 default: 525 alert = [[ [NSAlert alloc] init] autorelease];510 alert = [[NSAlert alloc] init]; 526 511 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> failed -> button")]; 527 512 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Creation of \"%@\" failed.", -
trunk/macosx/DragOverlayView.m
r13162 r13248 55 55 paragraphStyle, NSParagraphStyleAttributeName, nil]; 56 56 57 [stringShadow release];58 [paragraphStyle release];59 57 } 60 58 return self; 61 59 } 62 60 63 - (void) dealloc64 {65 [fBadge release];66 67 [fMainLineAttributes release];68 [fSubLineAttributes release];69 70 [super dealloc];71 }72 61 73 62 - (void) setOverlay: (NSImage *) icon mainLine: (NSString *) mainLine subLine: (NSString *) subLine 74 63 { 75 [fBadge release];76 64 77 65 //create badge -
trunk/macosx/DragOverlayWindow.m
r13162 r13248 49 49 DragOverlayView * view = [[DragOverlayView alloc] initWithFrame: [self frame]]; 50 50 [self setContentView: view]; 51 [view release];52 51 53 52 [self setReleasedWhenClosed: NO]; … … 78 77 [[NSNotificationCenter defaultCenter] removeObserver: self]; 79 78 80 [fFadeInAnimation release];81 [fFadeOutAnimation release];82 79 83 [super dealloc];84 80 } 85 81 -
trunk/macosx/ExpandedPathToIconTransformer.h
r13162 r13248 26 26 27 27 @interface ExpandedPathToIconTransformer : NSValueTransformer 28 {29 }30 28 31 29 @end -
trunk/macosx/ExpandedPathToPathTransformer.h
r13162 r13248 26 26 27 27 @interface ExpandedPathToPathTransformer : NSValueTransformer 28 {29 }30 28 31 29 @end -
trunk/macosx/FileListNode.h
r13175 r13248 35 35 NSString * fName; 36 36 NSString * fPath; 37 Torrent * fTorrent;37 Torrent * __unsafe_unretained fTorrent; 38 38 uint64_t fSize; 39 39 NSImage * fIcon; … … 44 44 @property (nonatomic, readonly) NSString * path; 45 45 46 @property (nonatomic, readonly ) Torrent * torrent;46 @property (nonatomic, readonly, unsafe_unretained) Torrent * torrent; 47 47 48 48 @property (nonatomic, readonly) uint64_t size; -
trunk/macosx/FileListNode.m
r13175 r13248 81 81 { 82 82 //this object is essentially immutable after initial setup 83 return [self retain];83 return self; 84 84 } 85 85 86 - (void) dealloc87 {88 [fName release];89 [fPath release];90 [fIndexes release];91 92 [fIcon release];93 94 [fChildren release];95 96 [super dealloc];97 }98 86 99 87 - (NSString *) description … … 113 101 { 114 102 if (!fIcon) 115 fIcon = [[ [NSWorkspace sharedWorkspace] iconForFileType: fIsFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon)116 : [fName pathExtension]] retain];103 fIcon = [[NSWorkspace sharedWorkspace] iconForFileType: fIsFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) 104 : [fName pathExtension]]; 117 105 return fIcon; 118 106 } … … 134 122 { 135 123 fIsFolder = isFolder; 136 fName = [name retain];137 fPath = [path retain];124 fName = name; 125 fPath = path; 138 126 139 127 fIndexes = [[NSMutableIndexSet alloc] init]; -
trunk/macosx/FileNameCell.m
r13162 r13248 70 70 statusParagraphStyle, NSParagraphStyleAttributeName, nil]; 71 71 72 [paragraphStyle release];73 [statusParagraphStyle release];74 72 } 75 73 return self; 76 }77 78 - (void) dealloc79 {80 [fTitleAttributes release];81 [fStatusAttributes release];82 83 [super dealloc];84 }85 86 - (id) copyWithZone: (NSZone *) zone87 {88 FileNameCell * copy = [super copyWithZone: zone];89 90 copy->fTitleAttributes = [fTitleAttributes retain];91 copy->fStatusAttributes = [fStatusAttributes retain];92 93 return copy;94 74 } 95 75 … … 194 174 { 195 175 NSString * title = [(FileListNode *)[self objectValue] name]; 196 return [[ [NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease];176 return [[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes]; 197 177 } 198 178 … … 208 188 "Inspector -> Files tab -> file status string"), percentString, [NSString stringForFileSize: [node size]]]; 209 189 210 return [[ [NSAttributedString alloc] initWithString: status attributes: fStatusAttributes] autorelease];190 return [[NSAttributedString alloc] initWithString: status attributes: fStatusAttributes]; 211 191 } 212 192 -
trunk/macosx/FileOutlineController.h
r13162 r13248 30 30 @interface FileOutlineController : NSObject 31 31 { 32 Torrent * fTorrent;32 __unsafe_unretained Torrent * fTorrent; 33 33 NSMutableArray * fFileList; 34 34 -
trunk/macosx/FileOutlineController.m
r13169 r13248 74 74 } 75 75 76 - (void) dealloc77 {78 [fFileList release];79 [fFilterText release];80 81 [super dealloc];82 }83 84 76 - (FileOutlineView *) outlineView 85 77 { … … 93 85 [fFileList setArray: [fTorrent fileList]]; 94 86 95 [fFilterText release];96 87 fFilterText = nil; 97 88 … … 208 199 [fOutline reloadData]; 209 200 210 [fFilterText release]; 211 fFilterText = [text retain]; 201 fFilterText = text; 212 202 } 213 203 … … 522 512 [item setTag: FILE_CHECK_TAG]; 523 513 [menu addItem: item]; 524 [item release];525 514 526 515 item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Uncheck Selected", "File Outline -> Menu") … … 529 518 [item setTag: FILE_UNCHECK_TAG]; 530 519 [menu addItem: item]; 531 [item release];532 520 533 521 //only check selected … … 536 524 [item setTarget: self]; 537 525 [menu addItem: item]; 538 [item release];539 526 540 527 [menu addItem: [NSMenuItem separatorItem]]; … … 545 532 [item setSubmenu: priorityMenu]; 546 533 [menu addItem: item]; 547 [item release];548 534 549 535 item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"High", "File Outline -> Priority Menu") … … 553 539 [item setImage: [NSImage imageNamed: @"PriorityHighTemplate.png"]]; 554 540 [priorityMenu addItem: item]; 555 [item release];556 541 557 542 item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Normal", "File Outline -> Priority Menu") … … 561 546 [item setImage: [NSImage imageNamed: @"PriorityNormalTemplate.png"]]; 562 547 [priorityMenu addItem: item]; 563 [item release];564 548 565 549 item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Low", "File Outline -> Priority Menu") … … 569 553 [item setImage: [NSImage imageNamed: @"PriorityLowTemplate.png"]]; 570 554 [priorityMenu addItem: item]; 571 [item release]; 572 573 [priorityMenu release]; 555 574 556 575 557 [menu addItem: [NSMenuItem separatorItem]]; … … 580 562 [item setTarget: self]; 581 563 [menu addItem: item]; 582 [item release]; 583 584 return [menu autorelease]; 564 565 return menu; 585 566 } 586 567 -
trunk/macosx/FileOutlineView.m
r13162 r13248 36 36 FileNameCell * nameCell = [[FileNameCell alloc] init]; 37 37 [[self tableColumnWithIdentifier: @"Name"] setDataCell: nameCell]; 38 [nameCell release];39 38 40 39 FilePriorityCell * priorityCell = [[FilePriorityCell alloc] init]; 41 40 [[self tableColumnWithIdentifier: @"Priority"] setDataCell: priorityCell]; 42 [priorityCell release];43 41 44 42 [self setAutoresizesOutlineColumn: NO]; … … 48 46 } 49 47 50 - (void) dealloc51 {52 [super dealloc];53 }54 48 55 49 - (void) mouseDown: (NSEvent *) event -
trunk/macosx/FilePriorityCell.m
r13162 r13248 102 102 NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: options owner: controlView userInfo: userInfo]; 103 103 [controlView addTrackingArea: area]; 104 [area release];105 104 } 106 105 -
trunk/macosx/FilterBarController.m
r13162 r13248 129 129 [[NSNotificationCenter defaultCenter] removeObserver: self]; 130 130 131 [super dealloc];132 131 } 133 132 … … 266 265 for (NSInteger i = 0; i < groupMenuCount; i++) 267 266 { 268 NSMenuItem * item = [ [groupMenu itemAtIndex: 0] retain];267 NSMenuItem * item = [groupMenu itemAtIndex: 0]; 269 268 [groupMenu removeItemAtIndex: 0]; 270 269 [menu addItem: item]; 271 [item release];272 270 } 273 271 } -
trunk/macosx/FilterBarView.m
r13162 r13248 38 38 } 39 39 40 - (void) dealloc41 {42 [fGradient release];43 [super dealloc];44 }45 40 46 41 - (BOOL) mouseDownCanMoveWindow -
trunk/macosx/GlobalOptionsPopoverViewController.m
r13170 r13248 141 141 - (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor 142 142 { 143 [fInitialString release]; 144 fInitialString = [[control stringValue] retain]; 143 fInitialString = [control stringValue]; 145 144 146 145 return YES; … … 153 152 { 154 153 [control setStringValue: fInitialString]; 155 [fInitialString release];156 154 fInitialString = nil; 157 155 } -
trunk/macosx/GroupToolbarItem.m
r13162 r13248 27 27 @implementation GroupToolbarItem 28 28 29 - (void) dealloc30 {31 [fIdentifiers release];32 [super dealloc];33 }34 29 35 30 - (void) setIdentifiers: (NSArray *) identifiers 36 31 { 37 [fIdentifiers release]; 38 fIdentifiers = [identifiers retain]; 32 fIdentifiers = identifiers; 39 33 } 40 34 … … 45 39 for (NSInteger i = 0; i < [control segmentCount]; i++) 46 40 [control setEnabled: [[self target] validateToolbarItem: 47 [[ [NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]] autorelease]] forSegment: i];41 [[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]]] forSegment: i]; 48 42 } 49 43 … … 64 58 65 59 [menu addItem: addItem]; 66 [addItem release];67 60 } 68 61 69 [menu release];70 62 [self setMenuFormRepresentation: menuItem]; 71 [menuItem release];72 63 } 73 64 … … 79 70 for (NSInteger i = 0; i < count; i++) 80 71 [[[menuItem submenu] itemAtIndex: i] setEnabled: [[self target] validateToolbarItem: 81 [[ [NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]] autorelease]]];72 [[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]]]]; 82 73 83 74 return menuItem; -
trunk/macosx/GroupsController.m
r13162 r13248 55 55 NSData * data; 56 56 if ((data = [[NSUserDefaults standardUserDefaults] dataForKey: @"GroupDicts"])) 57 fGroups = [ [NSKeyedUnarchiver unarchiveObjectWithData: data] retain];57 fGroups = [NSKeyedUnarchiver unarchiveObjectWithData: data]; 58 58 else if ((data = [[NSUserDefaults standardUserDefaults] dataForKey: @"Groups"])) //handle old groups 59 59 { 60 fGroups = [ [NSUnarchiver unarchiveObjectWithData: data] retain];60 fGroups = [NSUnarchiver unarchiveObjectWithData: data]; 61 61 [[NSUserDefaults standardUserDefaults] removeObjectForKey: @"Groups"]; 62 62 [self saveGroups]; … … 108 108 } 109 109 110 - (void) dealloc111 {112 [fGroups release];113 [super dealloc];114 }115 110 116 111 - (NSInteger) numberOfGroups … … 305 300 306 301 [item setImage: icon]; 307 [icon release];308 302 } 309 303 else … … 311 305 312 306 [menu addItem: item]; 313 [item release];314 307 315 308 for (NSMutableDictionary * dict in fGroups) … … 327 320 328 321 [item setImage: icon]; 329 [icon release];330 322 } 331 323 else … … 333 325 334 326 [menu addItem: item]; 335 [item release]; 336 } 337 338 return [menu autorelease]; 327 } 328 329 return menu; 339 330 } 340 331 … … 363 354 [tempDict removeObjectForKey: @"Icon"]; 364 355 [groups addObject: tempDict]; 365 [tempDict release];366 356 } 367 357 … … 388 378 [NSColor whiteColor]] endingColor: color]; 389 379 [gradient drawInBezierPath: bp angle: 270.0]; 390 [gradient release];391 380 392 381 //inside … … 395 384 endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]]; 396 385 [gradient drawInBezierPath: bp angle: 270.0]; 397 [gradient release];398 386 399 387 [icon unlockFocus]; 400 388 401 389 [dict setObject: icon forKey: @"Icon"]; 402 [icon release];403 390 404 391 return icon; -
trunk/macosx/GroupsPrefsController.m
r13162 r13248 383 383 if (location) 384 384 { 385 ExpandedPathToPathTransformer * pathTransformer = [[ [ExpandedPathToPathTransformer alloc] init] autorelease];385 ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init]; 386 386 [[fCustomLocationPopUp itemAtIndex: 0] setTitle: [pathTransformer transformedValue: location]]; 387 ExpandedPathToIconTransformer * iconTransformer = [[ [ExpandedPathToIconTransformer alloc] init] autorelease];387 ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init]; 388 388 [[fCustomLocationPopUp itemAtIndex: 0] setImage: [iconTransformer transformedValue: location]]; 389 389 } -
trunk/macosx/InfoActivityViewController.m
r13162 r13248 63 63 [[NSNotificationCenter defaultCenter] removeObserver: self]; 64 64 65 [fTorrents release]; 66 67 [super dealloc]; 65 68 66 } 69 67 … … 71 69 { 72 70 //don't check if it's the same in case the metadata changed 73 [fTorrents release]; 74 fTorrents = [torrents retain]; 71 fTorrents = torrents; 75 72 76 73 fSet = NO; -
trunk/macosx/InfoFileViewController.m
r13162 r13248 62 62 } 63 63 64 - (void) dealloc65 {66 [fTorrents release];67 68 [super dealloc];69 }70 64 71 65 - (void) setInfoForTorrents: (NSArray *) torrents 72 66 { 73 67 //don't check if it's the same in case the metadata changed 74 [fTorrents release]; 75 fTorrents = [torrents retain]; 68 fTorrents = torrents; 76 69 77 70 fSet = NO; -
trunk/macosx/InfoGeneralViewController.m
r13162 r13248 45 45 } 46 46 47 - (void) dealloc48 {49 [fTorrents release];50 51 [super dealloc];52 }53 47 54 48 - (void) setInfoForTorrents: (NSArray *) torrents 55 49 { 56 50 //don't check if it's the same in case the metadata changed 57 [fTorrents release]; 58 fTorrents = [torrents retain]; 51 fTorrents = torrents; 59 52 60 53 fSet = NO; -
trunk/macosx/InfoOptionsViewController.m
r13162 r13248 69 69 [[NSNotificationCenter defaultCenter] removeObserver: self]; 70 70 71 [fTorrents release]; 72 73 [super dealloc]; 71 74 72 } 75 73 … … 77 75 { 78 76 //don't check if it's the same in case the metadata changed 79 [fTorrents release]; 80 fTorrents = [torrents retain]; 77 fTorrents = torrents; 81 78 82 79 fSet = NO; … … 447 444 - (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor 448 445 { 449 [fInitialString release]; 450 fInitialString = [[control stringValue] retain]; 446 fInitialString = [control stringValue]; 451 447 452 448 return YES; … … 459 455 { 460 456 [control setStringValue: fInitialString]; 461 [fInitialString release];462 457 fInitialString = nil; 463 458 } -
trunk/macosx/InfoPeersViewController.m
r13162 r13248 99 99 } 100 100 101 - (void) dealloc102 {103 [fTorrents release];104 105 [fPeers release];106 [fWebSeeds release];107 108 [fWebSeedTableAnimation release];109 110 [super dealloc];111 }112 101 113 102 #warning subclass? … … 115 104 { 116 105 //don't check if it's the same in case the metadata changed 117 [fTorrents release]; 118 fTorrents = [torrents retain]; 106 fTorrents = torrents; 119 107 120 108 fSet = NO; … … 244 232 [self setWebSeedTableHidden: !fWebSeeds animate: NO]; 245 233 246 [fPeers release];247 234 fPeers = nil; 248 [fWebSeeds release];249 235 fWebSeeds = nil; 250 236 } … … 451 437 if (animation == fWebSeedTableAnimation) 452 438 { 453 [fWebSeedTableAnimation release];454 439 fWebSeedTableAnimation = nil; 455 440 } … … 461 446 { 462 447 [fWebSeedTableAnimation stopAnimation]; // jumps to end frame 463 [fWebSeedTableAnimation release];464 448 fWebSeedTableAnimation = nil; 465 449 } … … 476 460 if ([fTorrents count] == 0) 477 461 { 478 [fPeers release];479 462 fPeers = nil; 480 463 [fPeerTable reloadData]; … … 494 477 if (!hasWebSeeds) 495 478 { 496 [fWebSeeds release];497 479 fWebSeeds = nil; 498 480 [fWebSeedTable reloadData]; … … 511 493 { 512 494 [fWebSeedTableAnimation stopAnimation]; 513 [fWebSeedTableAnimation release];514 495 fWebSeedTableAnimation = nil; 515 496 } -
trunk/macosx/InfoTabButtonBack.m
r13162 r13248 38 38 } 39 39 40 - (void) dealloc41 {42 [fGradient release];43 [super dealloc];44 }45 40 46 41 - (void) drawRect: (NSRect) rect -
trunk/macosx/InfoTabButtonCell.m
r13162 r13248 38 38 39 39 //expects the icon to currently be set as the image 40 fIcon = [ [self image] retain];40 fIcon = [self image]; 41 41 [self setSelectedTab: fSelected]; 42 42 } … … 46 46 [[NSNotificationCenter defaultCenter] removeObserver: self]; 47 47 48 [fIcon release];49 [super dealloc];50 48 } 51 49 … … 86 84 87 85 [gradient drawInRect: tabRect angle: 270.0]; 88 [gradient release];89 86 90 87 if (fIcon) … … 102 99 103 100 [self setImage: tabImage]; 104 [tabImage release];105 101 } 106 102 -
trunk/macosx/InfoTrackersViewController.m
r13162 r13248 75 75 } 76 76 77 - (void) dealloc78 {79 [fTorrents release];80 [fTrackers release];81 [fTrackerCell release];82 83 [super dealloc];84 }85 77 86 78 - (void) setInfoForTorrents: (NSArray *) torrents 87 79 { 88 80 //don't check if it's the same in case the metadata changed 89 [fTorrents release]; 90 fTorrents = [torrents retain]; 81 fTorrents = torrents; 91 82 92 83 fSet = NO; … … 107 98 108 99 if ([fTorrents count] == 1) 109 fTrackers = [[ [fTorrents objectAtIndex: 0] allTrackerStats] retain];100 fTrackers = [[fTorrents objectAtIndex: 0] allTrackerStats]; 110 101 else 111 102 { … … 122 113 [fTrackerTable reloadData]; 123 114 124 [oldTrackers release];125 115 } 126 116 else … … 131 121 NSArray * tierAndTrackerBeingAdded = [fTrackers objectsAtIndexes: addedIndexes]; 132 122 133 [fTrackers release]; 134 fTrackers = [[[fTorrents objectAtIndex: 0] allTrackerStats] retain]; 123 fTrackers = [[fTorrents objectAtIndex: 0] allTrackerStats]; 135 124 [fTrackers addObjectsFromArray: tierAndTrackerBeingAdded]; 136 125 … … 150 139 - (void) clearView 151 140 { 152 [fTrackers release];153 141 fTrackers = nil; 154 142 } … … 232 220 233 221 //reset table with either new or old value 234 [fTrackers release]; 235 fTrackers = [[torrent allTrackerStats] retain]; 222 fTrackers = [torrent allTrackerStats]; 236 223 237 224 [fTrackerTable setTrackers: fTrackers]; … … 267 254 if (numberSelected == 0) 268 255 { 269 [fTrackers release];270 256 fTrackers = nil; 271 257 … … 394 380 if ([[alert suppressionButton] state] == NSOnState) 395 381 [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningRemoveTrackers"]; 396 [alert release];397 382 398 383 if (result != NSAlertFirstButtonReturn) … … 408 393 409 394 //reset table with either new or old value 410 [fTrackers release];411 395 fTrackers = [[NSMutableArray alloc] init]; 412 396 for (Torrent * torrent in fTorrents) -
trunk/macosx/InfoWindowController.m
r13162 r13248 141 141 [fViewController saveViewSize]; 142 142 143 [fGeneralViewController dealloc]; 144 [fActivityViewController dealloc]; 145 [fTrackersViewController dealloc]; 146 [fPeersViewController dealloc]; 147 [fFileViewController dealloc]; 148 [fOptionsViewController dealloc]; 149 150 [fTorrents release]; 151 152 [super dealloc]; 143 144 153 145 } 154 146 … … 158 150 return; 159 151 160 [fTorrents release]; 161 fTorrents = [torrents retain]; 152 fTorrents = torrents; 162 153 163 154 [self resetInfo]; -
trunk/macosx/MessageWindowController.m
r13162 r13248 105 105 [fFilterField setFrame: filterButtonFrame]; 106 106 107 fAttributes = [[[[ [fMessageTable tableColumnWithIdentifier: @"Message"] dataCell] attributedStringValue]108 attributesAtIndex: 0 effectiveRange: NULL] retain];107 fAttributes = [[[[fMessageTable tableColumnWithIdentifier: @"Message"] dataCell] attributedStringValue] 108 attributesAtIndex: 0 effectiveRange: NULL]; 109 109 110 110 //select proper level in popup button … … 136 136 137 137 [fTimer invalidate]; 138 [fLock release]; 139 140 [fMessages release]; 141 [fDisplayedMessages release]; 142 143 [fAttributes release]; 144 145 [super dealloc]; 138 139 140 146 141 } 147 142 … … 392 387 NSArray * descriptors = [[NSArray alloc] initWithObjects: descriptor, nil]; 393 388 NSArray * sortedMessages = [fDisplayedMessages sortedArrayUsingDescriptors: descriptors]; 394 [descriptors release];395 389 396 390 //create the text to output … … 412 406 413 407 [alert runModal]; 414 [alert release];415 408 } 416 409 } -
trunk/macosx/NSImageAdditions.m
r13162 r13248 40 40 [coloredImage unlockFocus]; 41 41 42 return [coloredImage autorelease];42 return coloredImage; 43 43 } 44 44 -
trunk/macosx/NSMutableArrayAdditions.m
r13162 r13248 32 32 return; 33 33 34 id object = [ [self objectAtIndex: fromIndex] retain];34 id object = [self objectAtIndex: fromIndex]; 35 35 36 36 //shift objects - more efficient than simply removing the object and re-inserting the object … … 47 47 [self replaceObjectAtIndex: toIndex withObject: object]; 48 48 49 [object release];50 49 } 51 50 -
trunk/macosx/NSStringAdditions.m
r13162 r13248 51 51 + (NSString *) formattedUInteger: (NSUInteger) value 52 52 { 53 NSNumberFormatter * numberFormatter = [[ [NSNumberFormatter alloc] init] autorelease];53 NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init]; 54 54 [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle]; 55 55 [numberFormatter setMaximumFractionDigits: 0]; … … 239 239 240 240 NSString * fileSizeString = [numberFormatter stringFromNumber: [NSNumber numberWithFloat: convertedSize]]; 241 [numberFormatter release];242 241 243 242 if (!notAllowedUnit || ![unit isEqualToString: notAllowedUnit]) -
trunk/macosx/PeerProgressIndicatorCell.m
r13162 r13248 31 31 @implementation PeerProgressIndicatorCell 32 32 33 - (id) copyWithZone: (NSZone *) zone34 {35 PeerProgressIndicatorCell * copy = [super copyWithZone: zone];36 copy->fAttributes = [fAttributes retain];37 38 return copy;39 }40 41 - (void) dealloc42 {43 [fAttributes release];44 [super dealloc];45 }46 47 33 - (void) setSeed: (BOOL) seed 48 34 { … … 61 47 fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], NSFontAttributeName, 62 48 paragraphStyle, NSParagraphStyleAttributeName, nil]; 63 [paragraphStyle release];64 49 } 65 50 … … 71 56 if (fAttributes) 72 57 { 73 [fAttributes release];74 58 fAttributes = nil; 75 59 } -
trunk/macosx/PiecesView.h
r13162 r13248 33 33 NSColor * fGreenAvailabilityColor, * fBluePieceColor; 34 34 35 Torrent * fTorrent;35 __unsafe_unretained Torrent * fTorrent; 36 36 NSInteger fNumPieces, fAcross, fWidth, fExtraBorder; 37 37 } -
trunk/macosx/PiecesView.m
r13162 r13248 49 49 { 50 50 //store box colors 51 fGreenAvailabilityColor = [ [NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain];52 fBluePieceColor = [ [NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain];51 fGreenAvailabilityColor = [NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0]; 52 fBluePieceColor = [NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0]; 53 53 54 54 //actually draw the box … … 60 60 tr_free(fPieces); 61 61 62 [fGreenAvailabilityColor release]; 63 [fBluePieceColor release]; 64 65 [super dealloc]; 62 66 63 } 67 64 … … 88 85 endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]]; 89 86 [gradient drawInRect: [self bounds] angle: 90.0]; 90 [gradient release];91 87 [back unlockFocus]; 92 88 93 89 [self setImage: back]; 94 [back release];95 90 96 91 [self setNeedsDisplay]; -
trunk/macosx/PortChecker.h
r13162 r13248 35 35 @interface PortChecker : NSObject 36 36 { 37 id fDelegate;37 __unsafe_unretained id fDelegate; 38 38 port_status_t fStatus; 39 39 -
trunk/macosx/PortChecker.m
r13162 r13248 59 59 [fTimer invalidate]; 60 60 61 [fConnection release];62 [fPortProbeData release];63 [super dealloc];64 61 } 65 62 … … 96 93 { 97 94 NSString * probeString = [[NSString alloc] initWithData: fPortProbeData encoding: NSUTF8StringEncoding]; 98 [fPortProbeData release];99 95 fPortProbeData = nil; 100 96 … … 110 106 [self callBackWithStatus: PORT_STATUS_ERROR]; 111 107 } 112 [probeString release];113 108 } 114 109 else -
trunk/macosx/PredicateEditorRowTemplateAny.h
r13162 r13248 26 26 27 27 @interface PredicateEditorRowTemplateAny : NSPredicateEditorRowTemplate 28 {29 }30 28 31 29 @end -
trunk/macosx/PrefsController.m
r13225 r13248 128 128 fRPCWhitelistArray = [[fDefaults arrayForKey: @"RPCWhitelist"] mutableCopy]; 129 129 if (!fRPCWhitelistArray) 130 fRPCWhitelistArray = [ [NSMutableArray arrayWithObject: @"127.0.0.1"] retain];130 fRPCWhitelistArray = [NSMutableArray arrayWithObject: @"127.0.0.1"]; 131 131 [self updateRPCWhitelist]; 132 132 … … 156 156 { 157 157 [fPortChecker cancelProbe]; 158 [fPortChecker release]; 159 } 160 161 [fRPCWhitelistArray release]; 162 163 [fRPCPassword release]; 164 165 [super dealloc]; 158 } 159 160 161 166 162 } 167 163 … … 177 173 [toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL]; 178 174 [[self window] setToolbar: toolbar]; 179 [toolbar release];180 175 181 176 [self setPrefView: nil]; … … 312 307 else 313 308 { 314 [item release];315 309 return nil; 316 310 } 317 311 318 return [item autorelease];312 return item; 319 313 } 320 314 … … 398 392 { 399 393 [fPortChecker cancelProbe]; 400 [fPortChecker release];401 394 } 402 395 BOOL delay = natStatusChanged || tr_sessionIsPortForwardingEnabled(fHandle); … … 426 419 break; 427 420 } 428 [fPortChecker release];429 421 fPortChecker = nil; 430 422 } … … 437 429 NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES); 438 430 439 for ( NSString * directory in directories)431 for (__strong NSString * directory in directories) 440 432 { 441 433 directory = [directory stringByAppendingPathComponent: @"Sounds"]; … … 445 437 { 446 438 NSArray * directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: directory error: NULL]; 447 for ( NSString * sound in directoryContents)439 for (__strong NSString * sound in directoryContents) 448 440 { 449 441 sound = [sound stringByDeletingPathExtension]; … … 702 694 + (NSDate *) timeSumToDate: (NSInteger) sum 703 695 { 704 NSDateComponents * comps = [[ [NSDateComponents alloc] init] autorelease];696 NSDateComponents * comps = [[NSDateComponents alloc] init]; 705 697 [comps setHour: sum / 60]; 706 698 [comps setMinute: sum % 60]; … … 711 703 - (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor 712 704 { 713 [fInitialString release]; 714 fInitialString = [[control stringValue] retain]; 705 fInitialString = [control stringValue]; 715 706 716 707 return YES; … … 723 714 { 724 715 [control setStringValue: fInitialString]; 725 [fInitialString release];726 716 fInitialString = nil; 727 717 } … … 759 749 { 760 750 NSString * bundleID = [[NSBundle mainBundle] bundleIdentifier]; 761 const OSStatus result = LSSetDefaultHandlerForURLScheme((CFStringRef)@"magnet", ( CFStringRef)bundleID);751 const OSStatus result = LSSetDefaultHandlerForURLScheme((CFStringRef)@"magnet", (__bridge CFStringRef)bundleID); 762 752 if (result != noErr) 763 753 NSLog(@"Failed setting default magnet link handler"); … … 983 973 - (void) setRPCPassword: (id) sender 984 974 { 985 [fRPCPassword release];986 975 fRPCPassword = [[sender stringValue] copy]; 987 976 … … 999 988 strlen(RPC_KEYCHAIN_NAME), RPC_KEYCHAIN_NAME, &passwordLength, (void **)&password, NULL); 1000 989 1001 [fRPCPassword release];1002 990 if (password != NULL) 1003 991 { -
trunk/macosx/PrefsWindow.h
r13162 r13248 26 26 27 27 @interface PrefsWindow : NSWindow 28 {29 }30 28 31 29 @end -
trunk/macosx/ProgressGradients.m
r13162 r13248 41 41 NSGradient * progressGradient = [[NSGradient alloc] initWithColorsAndLocations: baseColor, 0.0, color2, 0.5, color3, 0.5, 42 42 baseColor, 1.0, nil]; 43 return [progressGradient autorelease];43 return progressGradient; 44 44 } 45 45 -
trunk/macosx/StatsWindowController.m
r13162 r13248 127 127 [fTimer invalidate]; 128 128 129 [fStatsWindowInstance autorelease];130 129 fStatsWindowInstance = nil; 131 130 } -
trunk/macosx/StatusBarController.m
r13162 r13248 91 91 [[NSNotificationCenter defaultCenter] removeObserver: self]; 92 92 93 [super dealloc];94 93 } 95 94 -
trunk/macosx/StatusBarView.m
r13162 r13248 53 53 [[NSNotificationCenter defaultCenter] removeObserver: self]; 54 54 55 [fGradient release];56 [super dealloc];57 55 } 58 56 -
trunk/macosx/Torrent.m
r13219 r13248 63 63 void startQueueCallback(tr_torrent * torrent, void * torrentData) 64 64 { 65 [( Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO];65 [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO]; 66 66 } 67 67 … … 72 72 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status", 73 73 [NSNumber numberWithBool: wasRunning], @"WasRunning", nil]; 74 [( Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO];74 [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO]; 75 75 } 76 76 } … … 78 78 void ratioLimitHitCallback(tr_torrent * torrent, void * torrentData) 79 79 { 80 [( Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO];80 [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO]; 81 81 } 82 82 83 83 void idleLimitHitCallback(tr_torrent * torrent, void * torrentData) 84 84 { 85 [( Torrent *)torrentData performSelectorOnMainThread: @selector(idleLimitHit) withObject: nil waitUntilDone: NO];85 [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(idleLimitHit) withObject: nil waitUntilDone: NO]; 86 86 } 87 87 88 88 void metadataCallback(tr_torrent * torrent, void * torrentData) 89 89 { 90 [( Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO];90 [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO]; 91 91 } 92 92 … … 212 212 if (fFileStat) 213 213 tr_torrentFilesFree(fFileStat, [self fileCount]); 214 215 [fPreviousFinishedIndexes release];216 [fPreviousFinishedIndexesDate release];217 218 [fHashString release];219 220 [fIcon release];221 222 [fFileList release];223 [fFlatFileList release];224 225 [fTimeMachineExclude release];226 227 [super dealloc];228 214 } 229 215 … … 235 221 - (id) copyWithZone: (NSZone *) zone 236 222 { 237 return [self retain];223 return self; 238 224 } 239 225 … … 244 230 { 245 231 [self setTimeMachineExclude: NO forPath: fTimeMachineExclude]; 246 [fTimeMachineExclude release];247 232 fTimeMachineExclude = nil; 248 233 } … … 283 268 - (void) setPreviousFinishedPieces: (NSIndexSet *) indexes 284 269 { 285 [fPreviousFinishedIndexes release]; 286 fPreviousFinishedIndexes = [indexes retain]; 287 288 [fPreviousFinishedIndexesDate release]; 270 fPreviousFinishedIndexes = indexes; 271 289 272 fPreviousFinishedIndexesDate = indexes != nil ? [[NSDate alloc] init] : nil; 290 273 } … … 531 514 532 515 [alert runModal]; 533 [alert release];534 516 535 517 return; … … 553 535 554 536 [alert runModal]; 555 [alert release];556 537 } 557 538 … … 597 578 if ([[alert suppressionButton] state] == NSOnState) 598 579 [fDefaults setBool: NO forKey: @"WarningRemainingSpace"]; 599 [alert release];600 580 601 581 return result != NSAlertFirstButtonReturn; … … 612 592 #warning replace kGenericFolderIcon stuff with NSImageNameFolder on 10.6 613 593 if (!fIcon) 614 fIcon = [[ [NSWorkspace sharedWorkspace] iconForFileType: [self isFolder] ? NSFileTypeForHFSTypeCode(kGenericFolderIcon)615 : [[self name] pathExtension]] retain];594 fIcon = [[NSWorkspace sharedWorkspace] iconForFileType: [self isFolder] ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) 595 : [[self name] pathExtension]]; 616 596 return fIcon; 617 597 } … … 656 636 TrackerNode * tracker = [[TrackerNode alloc] initWithTrackerStat: &stats[i] torrent: self]; 657 637 [trackers addObject: tracker]; 658 [tracker release];659 638 } 660 639 … … 1549 1528 { 1550 1529 [self setTimeMachineExclude: NO forPath: fTimeMachineExclude]; 1551 [fTimeMachineExclude release];1552 1530 fTimeMachineExclude = nil; 1553 1531 } … … 1557 1535 { 1558 1536 [self setTimeMachineExclude: YES forPath: currentLocation]; 1559 fTimeMachineExclude = [currentLocation retain];1537 fTimeMachineExclude = currentLocation; 1560 1538 } 1561 1539 } … … 1652 1630 if (!fHandle) 1653 1631 { 1654 [self release];1655 1632 return nil; 1656 1633 } … … 1659 1636 fInfo = tr_torrentInfo(fHandle); 1660 1637 1661 tr_torrentSetQueueStartCallback(fHandle, startQueueCallback, self);1662 tr_torrentSetCompletenessCallback(fHandle, completenessChangeCallback, self);1663 tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, self);1664 tr_torrentSetIdleLimitHitCallback(fHandle, idleLimitHitCallback, self);1665 tr_torrentSetMetadataCallback(fHandle, metadataCallback, self);1638 tr_torrentSetQueueStartCallback(fHandle, startQueueCallback, (__bridge void *)(self)); 1639 tr_torrentSetCompletenessCallback(fHandle, completenessChangeCallback, (__bridge void *)(self)); 1640 tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, (__bridge void *)(self)); 1641 tr_torrentSetIdleLimitHitCallback(fHandle, idleLimitHitCallback, (__bridge void *)(self)); 1642 tr_torrentSetMetadataCallback(fHandle, metadataCallback, (__bridge void *)(self)); 1666 1643 1667 1644 fHashString = [[NSString alloc] initWithUTF8String: fInfo->hashString]; … … 1678 1655 name: @"GroupValueRemoved" object: nil]; 1679 1656 1680 fTimeMachineExclude = [timeMachineExclude retain];1657 fTimeMachineExclude = timeMachineExclude; 1681 1658 [self update]; 1682 1659 … … 1721 1698 node = [[FileListNode alloc] initWithFolderName: name path: path torrent: self]; 1722 1699 [fileList addObject: node]; 1723 [node release];1724 1700 } 1725 1701 … … 1734 1710 [fileList addObject: node]; 1735 1711 [flatFileList addObject: node]; 1736 [node release];1737 1712 } 1738 1713 } … … 1747 1722 { 1748 1723 FileListNode * node = [[FileListNode alloc] initWithFileName: [self name] path: @"" size: [self size] index: 0 torrent: self]; 1749 fFileList = [[NSArray arrayWithObject: node] retain]; 1750 fFlatFileList = [fFileList retain]; 1751 [node release]; 1724 fFileList = [NSArray arrayWithObject: node]; 1725 fFlatFileList = fFileList; 1752 1726 } 1753 1727 } … … 1785 1759 1786 1760 [parent insertChild: node]; 1787 [node release];1788 1761 } 1789 1762 … … 1822 1795 case TR_SEED: 1823 1796 case TR_PARTIAL_SEED: 1797 { 1824 1798 //simpler to create a new dictionary than to use statusInfo - avoids retention chicanery 1825 1799 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self … … 1832 1806 { 1833 1807 NSDictionary * quarantineProperties = [NSDictionary dictionaryWithObject: (NSString *)kLSQuarantineTypeOtherDownload forKey: (NSString *)kLSQuarantineTypeKey]; 1834 if (LSSetItemAttribute(&ref, kLSRolesAll, kLSItemQuarantineProperties, quarantineProperties) != noErr)1808 if (LSSetItemAttribute(&ref, kLSRolesAll, kLSItemQuarantineProperties, (__bridge void *)quarantineProperties) != noErr) 1835 1809 NSLog(@"Failed to quarantine: %@", dataLocation); 1836 1810 } … … 1839 1813 1840 1814 break; 1815 } 1841 1816 1842 1817 case TR_LEECH: … … 1844 1819 break; 1845 1820 } 1846 [statusInfo release];1847 1821 1848 1822 [self update]; … … 1919 1893 - (void) setTimeMachineExclude: (BOOL) exclude forPath: (NSString *) path 1920 1894 { 1921 CSBackupSetItemExcluded(( CFURLRef)[NSURL fileURLWithPath: path], exclude, true);1895 CSBackupSetItemExcluded((__bridge CFURLRef)[NSURL fileURLWithPath: path], exclude, true); 1922 1896 } 1923 1897 -
trunk/macosx/TorrentCell.m
r13162 r13248 110 110 [fStatusAttributes setObject: paragraphStyle forKey: NSParagraphStyleAttributeName]; 111 111 112 [paragraphStyle release]; 113 114 fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain]; 115 fBarBorderColor = [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.2] retain]; 116 fBarMinimalBorderColor = [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.015] retain]; 112 113 fBluePieceColor = [NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0]; 114 fBarBorderColor = [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.2]; 115 fBarMinimalBorderColor = [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.015]; 117 116 } 118 117 return self; … … 243 242 NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: rowOptions owner: controlView userInfo: rowInfo]; 244 243 [controlView addTrackingArea: area]; 245 [rowInfo release];246 [area release];247 244 } 248 245 … … 261 258 userInfo: controlInfo]; 262 259 [controlView addTrackingArea: area]; 263 [controlInfo release];264 [area release];265 260 266 261 //reveal button … … 278 273 userInfo: revealInfo]; 279 274 [controlView addTrackingArea: area]; 280 [revealInfo release];281 [area release];282 275 283 276 //action button … … 294 287 area = [[NSTrackingArea alloc] initWithRect: actionButtonRect options: actionOptions owner: controlView userInfo: actionInfo]; 295 288 [controlView addTrackingArea: area]; 296 [actionInfo release];297 [area release];298 289 } 299 290 … … 361 352 ofColor: [NSColor whiteColor]] endingColor: darkGroupColor]; 362 353 [gradient drawInBezierPath: bp angle: 90.0]; 363 [gradient release];364 354 } 365 355 … … 694 684 fraction: ([fDefaults boolForKey: @"SmallView"] ? 0.25 : 1.0) respectFlipped: YES hints: nil]; 695 685 696 [bitmap release];697 686 } 698 687 … … 829 818 { 830 819 NSString * title = [(Torrent *)[self representedObject] name]; 831 return [[ [NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease];820 return [[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes]; 832 821 } 833 822 834 823 - (NSAttributedString *) attributedStatusString: (NSString *) string 835 824 { 836 return [[ [NSAttributedString alloc] initWithString: string attributes: fStatusAttributes] autorelease];825 return [[NSAttributedString alloc] initWithString: string attributes: fStatusAttributes]; 837 826 } 838 827 -
trunk/macosx/TorrentGroup.m
r13162 r13248 42 42 } 43 43 44 - (void) dealloc45 {46 [fTorrents release];47 [super dealloc];48 }49 44 50 45 - (NSString *) description -
trunk/macosx/TorrentTableView.m
r13171 r13248 91 91 [[NSNotificationCenter defaultCenter] removeObserver: self]; 92 92 93 [fCollapsedGroups release]; 94 95 [fPiecesBarAnimation release]; 96 [fMenuTorrent release]; 97 98 [fSelectedValues release]; 99 100 [fTorrentCell release]; 101 102 [super dealloc]; 93 94 95 96 103 97 } 104 98 … … 392 386 //if pushing a button, don't change the selected rows 393 387 if (pushed) 394 fSelectedValues = [ [self selectedValues] retain];388 fSelectedValues = [self selectedValues]; 395 389 396 390 [super mouseDown: event]; 397 391 398 [fSelectedValues release];399 392 fSelectedValues = nil; 400 393 … … 638 631 [infoViewController updateInfo]; 639 632 640 [infoViewController release];641 [popover release];642 633 } 643 634 else 644 635 { 645 636 //update file action menu 646 fMenuTorrent = [ [self itemAtRow: row] retain];637 fMenuTorrent = [self itemAtRow: row]; 647 638 648 639 //update global limit check … … 656 647 [fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: self]; 657 648 658 [fMenuTorrent release];659 649 fMenuTorrent = nil; 660 650 } … … 695 685 [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]]; 696 686 [menu addItem: item]; 697 [item release];698 687 } 699 688 } … … 724 713 [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]]; 725 714 [menu addItem: item]; 726 [item release];727 715 } 728 716 } … … 837 825 - (void) togglePiecesBar 838 826 { 839 //stop previous animation840 if (fPiecesBarAnimation)841 [fPiecesBarAnimation release];842 843 827 NSMutableArray * progressMarks = [NSMutableArray arrayWithCapacity: 16]; 844 for (NSAnimationProgress i = 0.0625; i <= 1.0; i += 0.0625)828 for (NSAnimationProgress i = 1.0/16; i <= 1.0; i += 1.0/16) 845 829 [progressMarks addObject: [NSNumber numberWithFloat: i]]; 846 830 … … 857 841 if (animation == fPiecesBarAnimation) 858 842 { 859 [fPiecesBarAnimation release];860 843 fPiecesBarAnimation = nil; 861 844 } -
trunk/macosx/TrackerCell.m
r13219 r13248 84 84 paragraphStyle, NSParagraphStyleAttributeName, nil]; 85 85 86 [paragraphStyle release];87 86 } 88 87 return self; 89 }90 91 - (void) dealloc92 {93 [fNameAttributes release];94 [fStatusAttributes release];95 96 [super dealloc];97 }98 99 - (id) copyWithZone: (NSZone *) zone100 {101 TrackerCell * copy = [super copyWithZone: zone];102 103 copy->fNameAttributes = [fNameAttributes retain];104 copy->fStatusAttributes = [fStatusAttributes retain];105 106 return copy;107 88 } 108 89 … … 243 224 { 244 225 [fTrackerIconCache setObject: icon forKey: baseAddress]; 245 [icon release];246 226 247 227 [[self controlView] setNeedsDisplay: YES]; … … 303 283 { 304 284 NSString * name = [(TrackerNode *)[self objectValue] host]; 305 return [[ [NSAttributedString alloc] initWithString: name attributes: fNameAttributes] autorelease];285 return [[NSAttributedString alloc] initWithString: name attributes: fNameAttributes]; 306 286 } 307 287 308 288 - (NSAttributedString *) attributedStatusWithString: (NSString *) statusString 309 289 { 310 return [[ [NSAttributedString alloc] initWithString: statusString attributes: fStatusAttributes] autorelease];290 return [[NSAttributedString alloc] initWithString: statusString attributes: fStatusAttributes]; 311 291 } 312 292 … … 314 294 { 315 295 NSString * countString = count != -1 ? [NSString stringWithFormat: @"%d", count] : NSLocalizedString(@"N/A", "tracker peer stat"); 316 return [[ [NSAttributedString alloc] initWithString: countString attributes: fStatusAttributes] autorelease];296 return [[NSAttributedString alloc] initWithString: countString attributes: fStatusAttributes]; 317 297 } 318 298 -
trunk/macosx/TrackerNode.h
r13175 r13248 32 32 tr_tracker_stat fStat; 33 33 34 Torrent * fTorrent;34 __unsafe_unretained Torrent * fTorrent; 35 35 } 36 36 37 @property (nonatomic, readonly ) Torrent * torrent;37 @property (nonatomic, readonly, assign) Torrent * torrent; 38 38 39 39 - (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent; -
trunk/macosx/TrackerNode.m
r13175 r13248 29 29 30 30 #warning remove ivars in header when 64-bit only (or it compiles in 32-bit mode) 31 #warning make weak when 10.7-only (not assign) 31 32 @synthesize torrent = fTorrent; 32 33 … … 36 37 { 37 38 fStat = *stat; 38 fTorrent = torrent; //weak reference 39 #warning make __weak when 10.7-only 40 fTorrent = torrent; 39 41 } 40 42 … … 50 52 { 51 53 //this object is essentially immutable after initial setup 52 return [self retain];54 return self; 53 55 } 54 56 … … 113 115 114 116 dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastAnnounceTime]]; 115 [dateFormatter release];116 117 } 117 118 else … … 184 185 185 186 dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastScrapeTime]]; 186 [dateFormatter release];187 187 } 188 188 else -
trunk/macosx/TrackerTableView.h
r13162 r13248 29 29 @interface TrackerTableView : NSTableView 30 30 { 31 //weak references 32 Torrent * fTorrent; 33 NSArray * fTrackers; 31 __unsafe_unretained Torrent * fTorrent; 32 __unsafe_unretained NSArray * fTrackers; 34 33 } 35 34 -
trunk/macosx/URLSheetWindow.xib
r12940 r13248 3 3 <data> 4 4 <int key="IBDocument.SystemTarget">1060</int> 5 <string key="IBDocument.SystemVersion">11 B26</string>6 <string key="IBDocument.InterfaceBuilderVersion"> 1617</string>7 <string key="IBDocument.AppKitVersion">1138 </string>8 <string key="IBDocument.HIToolboxVersion">56 6.00</string>5 <string key="IBDocument.SystemVersion">11D50</string> 6 <string key="IBDocument.InterfaceBuilderVersion">2182</string> 7 <string key="IBDocument.AppKitVersion">1138.32</string> 8 <string key="IBDocument.HIToolboxVersion">568.00</string> 9 9 <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> 10 10 <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> 11 <string key="NS.object.0"> 1617</string>11 <string key="NS.object.0">2182</string> 12 12 </object> 13 13 <array key="IBDocument.IntegratedClassDependencies"> … … 23 23 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 24 24 </array> 25 <dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/> 25 <object class="NSMutableDictionary" key="IBDocument.Metadata"> 26 <string key="NS.key.0">PluginDependencyRecalculationVersion</string> 27 <integer value="1" key="NS.object.0"/> 28 </object> 26 29 <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> 27 30 <object class="NSCustomObject" id="1001"> … … 47 50 <string key="NSWindowContentMinSize">{400, 177}</string> 48 51 <object class="NSView" key="NSWindowView" id="892541411"> 49 < nilkey="NSNextResponder"/>52 <reference key="NSNextResponder"/> 50 53 <int key="NSvFlags">256</int> 51 54 <array class="NSMutableArray" key="NSSubviews"> … … 55 58 <string key="NSFrame">{{20, 50}, {360, 80}}</string> 56 59 <reference key="NSSuperview" ref="892541411"/> 60 <reference key="NSWindow"/> 61 <reference key="NSNextKeyView" ref="9691643"/> 57 62 <bool key="NSEnabled">YES</bool> 58 63 <object class="NSTextFieldCell" key="NSCell" id="139057847"> … … 92 97 <string key="NSFrame">{{304, 12}, {82, 32}}</string> 93 98 <reference key="NSSuperview" ref="892541411"/> 99 <reference key="NSWindow"/> 100 <reference key="NSNextKeyView"/> 94 101 <bool key="NSEnabled">YES</bool> 95 102 <object class="NSButtonCell" key="NSCell" id="62424678"> … … 113 120 <string key="NSFrame">{{222, 12}, {82, 32}}</string> 114 121 <reference key="NSSuperview" ref="892541411"/> 122 <reference key="NSWindow"/> 123 <reference key="NSNextKeyView" ref="794131740"/> 115 124 <bool key="NSEnabled">YES</bool> 116 125 <object class="NSButtonCell" key="NSCell" id="341887532"> … … 134 143 <string key="NSFrame">{{17, 140}, {366, 17}}</string> 135 144 <reference key="NSSuperview" ref="892541411"/> 145 <reference key="NSWindow"/> 146 <reference key="NSNextKeyView" ref="1066788818"/> 136 147 <bool key="NSEnabled">YES</bool> 137 148 <object class="NSTextFieldCell" key="NSCell" id="830118733"> … … 160 171 </array> 161 172 <string key="NSFrameSize">{400, 177}</string> 173 <reference key="NSSuperview"/> 174 <reference key="NSWindow"/> 175 <reference key="NSNextKeyView" ref="459786882"/> 162 176 </object> 163 177 <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string> … … 203 217 </object> 204 218 <object class="IBConnectionRecord"> 219 <object class="IBOutletConnection" key="connection"> 220 <string key="label">fCancelButton</string> 221 <reference key="source" ref="1001"/> 222 <reference key="destination" ref="9691643"/> 223 </object> 224 <int key="connectionID">22</int> 225 </object> 226 <object class="IBConnectionRecord"> 205 227 <object class="IBActionConnection" key="connection"> 206 228 <string key="label">openURLEndSheet:</string> … … 208 230 <reference key="destination" ref="794131740"/> 209 231 </object> 210 <int key="connectionID"> 18</int>232 <int key="connectionID">23</int> 211 233 </object> 212 234 <object class="IBConnectionRecord"> … … 216 238 <reference key="destination" ref="9691643"/> 217 239 </object> 218 <int key="connectionID"> 19</int>240 <int key="connectionID">24</int> 219 241 </object> 220 242 <object class="IBConnectionRecord"> … … 225 247 </object> 226 248 <int key="connectionID">21</int> 227 </object>228 <object class="IBConnectionRecord">229 <object class="IBOutletConnection" key="connection">230 <string key="label">fCancelButton</string>231 <reference key="source" ref="1001"/>232 <reference key="destination" ref="9691643"/>233 </object>234 <int key="connectionID">22</int>235 249 </object> 236 250 </array> … … 355 369 <dictionary class="NSMutableDictionary" key="localizations"/> 356 370 <nil key="sourceID"/> 357 <int key="maxID">2 2</int>371 <int key="maxID">24</int> 358 372 </object> 359 373 <object class="IBClassDescriber" key="IBDocument.Classes"> … … 362 376 <string key="className">URLSheetWindowController</string> 363 377 <string key="superclassName">NSWindowController</string> 378 <dictionary class="NSMutableDictionary" key="actions"> 379 <string key="openURLCancelEndSheet:">id</string> 380 <string key="openURLEndSheet:">id</string> 381 </dictionary> 382 <dictionary class="NSMutableDictionary" key="actionInfosByName"> 383 <object class="IBActionInfo" key="openURLCancelEndSheet:"> 384 <string key="name">openURLCancelEndSheet:</string> 385 <string key="candidateClassName">id</string> 386 </object> 387 <object class="IBActionInfo" key="openURLEndSheet:"> 388 <string key="name">openURLEndSheet:</string> 389 <string key="candidateClassName">id</string> 390 </object> 391 </dictionary> 364 392 <dictionary class="NSMutableDictionary" key="outlets"> 365 393 <string key="fCancelButton">NSButton</string> … … 401 429 <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> 402 430 <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> 403 < integer value="1060" key="NS.object.0"/>431 <real value="1070" key="NS.object.0"/> 404 432 </object> 405 433 <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> -
trunk/macosx/URLSheetWindowController.h
r13162 r13248 33 33 IBOutlet NSButton * fOpenButton, * fCancelButton; 34 34 35 Controller * fController;35 __unsafe_unretained Controller * fController; 36 36 } 37 37 38 38 - (id) initWithController: (Controller *) controller; 39 - (void) beginSheetForWindow: (NSWindow *) window;40 39 41 - (void) openURLEndSheet: (id) sender; 42 - (void) openURLCancelEndSheet: (id) sender; 40 - (IBAction) openURLEndSheet: (id) sender; 41 - (IBAction) openURLCancelEndSheet: (id) sender; 42 43 - (NSString *) urlString; 43 44 44 45 @end -
trunk/macosx/URLSheetWindowController.m
r13162 r13248 81 81 } 82 82 83 - (IBAction) beginSheetForWindow: (NSWindow *) window 84 { 85 [NSApp beginSheet: [self window] modalForWindow: window modalDelegate: self 86 didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; 87 } 88 89 - (void) openURLEndSheet: (id) sender 83 - (IBAction) openURLEndSheet: (id) sender 90 84 { 91 85 [[self window] orderOut: sender]; … … 93 87 } 94 88 95 - ( void) openURLCancelEndSheet: (id) sender89 - (IBAction) openURLCancelEndSheet: (id) sender 96 90 { 97 91 [[self window] orderOut: sender]; … … 99 93 } 100 94 101 - ( void) sheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo95 - (NSString *) urlString 102 96 { 103 [urlString release]; 104 urlString = [[fTextField stringValue] retain]; 105 [fController urlSheetDidEnd: self url: urlString returnCode: returnCode]; 97 return [fTextField stringValue]; 106 98 } 107 99
Note: See TracChangeset
for help on using the changeset viewer.