Changeset 13248


Ignore:
Timestamp:
Mar 10, 2012, 3:38:58 AM (10 years ago)
Author:
livings124
Message:

#4822 Enable Automatic Reference Counting

Location:
trunk
Files:
71 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r13202 r13248  
    241241                A29E653613F1603100048D71 /* evutil_rand.c in Sources */ = {isa = PBXBuildFile; fileRef = A29E653513F1603100048D71 /* evutil_rand.c */; };
    242242                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"; }; };
    247247                A2A4E9210DE0F7E9000CE197 /* web.h in Headers */ = {isa = PBXBuildFile; fileRef = A29EBE530DC01FC9006CEE80 /* web.h */; };
    248248                A2A4E9220DE0F7EB000CE197 /* web.c in Sources */ = {isa = PBXBuildFile; fileRef = A29EBE520DC01FC9006CEE80 /* web.c */; };
     
    11641164                                A2ED7D8D0CEF431B00970975 /* FilterButton.h */,
    11651165                                A2ED7D8E0CEF431B00970975 /* FilterButton.m */,
     1166                                A28E1DDF0CFFD8EC00E16385 /* ButtonToolbarItem.h */,
    11661167                                A2C89D5F0CFCBF57004CC2BC /* ButtonToolbarItem.m */,
    1167                                 A28E1DDF0CFFD8EC00E16385 /* ButtonToolbarItem.h */,
    11681168                                A21979890D07B78400438EA7 /* GroupToolbarItem.h */,
    11691169                                A219798A0D07B78400438EA7 /* GroupToolbarItem.m */,
     
    27312731                        isa = XCBuildConfiguration;
    27322732                        buildSettings = {
     2733                                CLANG_ENABLE_OBJC_ARC = YES;
    27332734                                FRAMEWORK_SEARCH_PATHS = macosx;
    27342735                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
     
    28892890                        isa = XCBuildConfiguration;
    28902891                        buildSettings = {
     2892                                CLANG_ENABLE_OBJC_ARC = YES;
    28912893                                FRAMEWORK_SEARCH_PATHS = macosx;
    28922894                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
     
    29983000                        isa = XCBuildConfiguration;
    29993001                        buildSettings = {
     3002                                CLANG_ENABLE_OBJC_ARC = YES;
    30003003                                FRAMEWORK_SEARCH_PATHS = macosx;
    30013004                                GCC_PREFIX_HEADER = macosx/Transmission_Prefix.pch;
  • trunk/macosx/AboutWindowController.m

    r13162 r13248  
    4444                                        value: nil table: @"InfoPlist"]];
    4545   
    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]];
    4848   
    4949    //size license button
     
    6666- (void) windowWillClose: (id) sender
    6767{
    68         [fAboutBoxInstance autorelease];
    6968    fAboutBoxInstance = nil;
    7069}
  • trunk/macosx/AddMagnetWindowController.h

    r13162 r13248  
    3535    IBOutlet NSPopUpButton * fGroupPopUp, * fPriorityPopUp;
    3636   
    37     Controller * fController;
     37    __unsafe_unretained Controller * fController;
    3838   
    3939    Torrent * fTorrent;
  • trunk/macosx/AddMagnetWindowController.m

    r13162 r13248  
    5454    {
    5555        fTorrent = torrent;
    56         fDestination = [[path stringByExpandingTildeInPath] retain];
     56        fDestination = [path stringByExpandingTildeInPath];
    5757       
    5858        fController = controller;
     
    107107{
    108108    [[NSNotificationCenter defaultCenter] removeObserver: self];
    109    
    110     [fDestination release];
    111    
    112     [super dealloc];
    113109}
    114110
     
    219215    if (!fDestination || ![fDestination isEqualToString: destination])
    220216    {
    221         [fDestination release];
    222         fDestination = [destination retain];
     217        fDestination = destination;
    223218       
    224219        [fTorrent changeDownloadFolderBeforeUsing: fDestination];
     
    230225    ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
    231226    [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]];
    232     [iconTransformer release];
    233227}
    234228
     
    256250        [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"];
    257251   
    258     [alert release];
    259252   
    260253    if (returnCode == NSAlertSecondButtonReturn)
  • trunk/macosx/AddWindowController.h

    r13162 r13248  
    3939    IBOutlet FileOutlineController * fFileController;
    4040   
    41     Controller * fController;
     41    __unsafe_unretained Controller * fController;
    4242   
    4343    Torrent * fTorrent;
  • trunk/macosx/AddWindowController.m

    r13162 r13248  
    6161    {
    6262        fTorrent = torrent;
    63         fDestination = [[path stringByExpandingTildeInPath] retain];
     63        fDestination = [path stringByExpandingTildeInPath];
    6464        fLockDestination = lockDestination;
    6565       
    6666        fController = controller;
    6767       
    68         fTorrentFile = [[torrentFile stringByExpandingTildeInPath] retain];
     68        fTorrentFile = [torrentFile stringByExpandingTildeInPath];
    6969       
    7070        fDeleteTorrentInitial = deleteTorrent;
     
    140140   
    141141    [fTimer invalidate];
    142    
    143     [fDestination release];
    144     [fTorrentFile release];
    145    
    146     [super dealloc];
    147142}
    148143
     
    317312    if (!fDestination || ![fDestination isEqualToString: destination])
    318313    {
    319         [fDestination release];
    320         fDestination = [destination retain];
     314        fDestination = destination;
    321315       
    322316        [fTorrent changeDownloadFolderBeforeUsing: fDestination];
     
    328322    ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
    329323    [fLocationImageView setImage: [iconTransformer transformedValue: fDestination]];
    330     [iconTransformer release];
    331324}
    332325
     
    357350        [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"];
    358351   
    359     [alert release];
    360352   
    361353    if (returnCode == NSAlertSecondButtonReturn)
  • trunk/macosx/BadgeView.m

    r13162 r13248  
    4949}
    5050
    51 - (void) dealloc
    52 {
    53     [fAttributes release];
    54     [super dealloc];
    55 }
    5651
    5752- (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
     
    114109        [fAttributes setObject: stringShadow forKey: NSShadowAttributeName];
    115110       
    116         [stringShadow release];
    117111    }
    118112   
  • trunk/macosx/Badger.m

    r13162 r13248  
    3838        BadgeView * view = [[BadgeView alloc] initWithLib: lib];
    3939        [[NSApp dockTile] setContentView: view];
    40         [view release];
    4140       
    4241        fHashes = [[NSMutableSet alloc] init];
     
    4948{
    5049    [[NSNotificationCenter defaultCenter] removeObserver: self];
    51    
    52     [fHashes release];
    53    
    54     [super dealloc];
    5550}
    5651
  • trunk/macosx/BlocklistDownloader.h

    r13162 r13248  
    3838    NSURLDownload * fDownload;
    3939   
    40     BlocklistDownloaderViewController * fViewController;
     40    __unsafe_unretained BlocklistDownloaderViewController * fViewController;
    4141   
    4242    NSString * fDestination;
  • trunk/macosx/BlocklistDownloader.m

    r13219 r13248  
    7575}
    7676
    77 - (void) dealloc
    78 {
    79     [fDownload release];
    80     [fDestination release];
    81     [super dealloc];
    82 }
    8377
    8478- (void) cancelDownload
     
    9185   
    9286    fDownloader = nil;
    93     [self release];
    9487}
    9588
     
    10295- (void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
    10396{
    104     [fDestination release];
    105     fDestination = [path retain];
     97    fDestination = path;
    10698}
    10799
     
    130122   
    131123    fDownloader = nil;
    132     [self release];
    133124}
    134125
     
    196187                        success = NO;
    197188                }
    198                 [unzip release];
    199189               
    200190                if (success) {
     
    217207                                [zipinfo waitUntilExit];
    218208                               
    219                                 NSString * actualFilename = [[[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]
    220                                                 encoding: NSUTF8StringEncoding] autorelease];
     209                                NSString * actualFilename = [[NSString alloc] initWithData: [zipinfoOutput readDataToEndOfFile]
     210                                                encoding: NSUTF8StringEncoding];
    221211                                actualFilename = [actualFilename stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
    222212                                NSString * newBlocklistPath = [workingDirectory stringByAppendingPathComponent: actualFilename];
     
    225215                                [[NSFileManager defaultManager] removeItemAtPath: fDestination error: NULL];
    226216               
    227                 [fDestination release];
    228                 fDestination = [newBlocklistPath retain];
     217                fDestination = newBlocklistPath;
    229218                        }
    230219            @catch(id exc) {}
    231                         [zipinfo release];
    232220                }               
    233221        }
     
    267255   
    268256    fDownloader = nil;
    269     [self release];
    270257}
    271258
  • trunk/macosx/BlocklistDownloaderViewController.h

    r13162 r13248  
    3030@interface BlocklistDownloaderViewController : NSObject
    3131{   
    32     PrefsController * fPrefsController;
     32    __unsafe_unretained PrefsController * fPrefsController;
    3333   
    3434    IBOutlet NSWindow * fStatusWindow;
  • trunk/macosx/BlocklistDownloaderViewController.m

    r13162 r13248  
    3838@implementation BlocklistDownloaderViewController
    3939
     40#warning make gcd singleton
    4041+ (void) downloadWithPrefsController: (PrefsController *) prefsController
    4142{
     
    102103    [fStatusWindow orderOut: self];
    103104   
    104     [self release];
    105105}
    106106
     
    110110    [fStatusWindow orderOut: self];
    111111   
    112     NSAlert * alert = [[[NSAlert alloc] init] autorelease];
     112    NSAlert * alert = [[NSAlert alloc] init];
    113113    [alert addButtonWithTitle: NSLocalizedString(@"OK", "Blocklist -> button")];
    114114    [alert setMessageText: NSLocalizedString(@"Download of the blocklist failed.", "Blocklist -> message")];
     
    149149{
    150150    [[alert window] orderOut: self];
    151     [self release];
    152151}
    153152
  • trunk/macosx/BonjourController.m

    r13162 r13248  
    2727@implementation BonjourController
    2828
     29#warning make gcd singleton
    2930BonjourController * fDefaultController = nil;
    3031+ (BonjourController *) defaultController
     
    3536}
    3637
    37 - (void) dealloc
    38 {
    39     [fService release];
    40     [super dealloc];
    41 }
    4238
    4339- (void) startWithPort: (NSInteger) port
     
    5652{
    5753    [fService stop];
    58     [fService release];
    5954    fService = nil;
    6055}
  • trunk/macosx/ButtonToolbarItem.h

    r13162 r13248  
    2626
    2727@interface ButtonToolbarItem : NSToolbarItem
    28 {
    29 }
    3028
    3129@end
  • trunk/macosx/ButtonToolbarItem.m

    r13162 r13248  
    3838    [menuItem setEnabled: [[self target] validateToolbarItem: self]];
    3939   
    40     return [menuItem autorelease];
     40    return menuItem;
    4141}
    4242
  • trunk/macosx/Controller.h

    r13184 r13248  
    107107    NSMutableSet                    * fAddingTransfers;
    108108   
     109    NSMutableSet                    * fAddWindows;
     110    URLSheetWindowController        * fUrlSheetController;
     111   
    109112    BOOL                            fGlobalPopoverShown;
    110113    BOOL                            fSoundPlaying;
     
    128131- (void) openURL: (NSString *) urlString;
    129132- (void) openURLShowSheet: (id) sender;
    130 - (void) urlSheetDidEnd: (URLSheetWindowController *) controller url: (NSString *) urlString returnCode: (NSInteger) returnCode;
    131133
    132134- (void) quitSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo;
  • trunk/macosx/Controller.m

    r13240 r13248  
    140140    NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [[NSNumber alloc] initWithBool: active], @"Active",
    141141                                [[NSNumber alloc] initWithBool: byUser], @"ByUser", nil];
    142     [(Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
     142    [(__bridge Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
    143143        withObject: dict waitUntilDone: NO];
    144144}
     
    147147                                            void * controller)
    148148{
    149     [(Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
     149    [(__bridge Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
    150150    return TR_RPC_NOREMOVE; //we'll do the remove manually
    151151}
     
    153153static void sleepCallback(void * controller, io_service_t y, natural_t messageType, void * messageArgument)
    154154{
    155     [(Controller *)controller sleepCallback: messageType argument: messageArgument];
     155    [(__bridge Controller *)controller sleepCallback: messageType argument: messageArgument];
    156156}
    157157
     
    173173       
    174174        [alert runModal];
    175         [alert release];
    176175       
    177176        //kill ourselves right away
     
    183182   
    184183    //set custom value transformers
    185     ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease];
     184    ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init];
    186185    [NSValueTransformer setValueTransformer: pathTransformer forName: @"ExpandedPathToPathTransformer"];
    187186   
    188     ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease];
     187    ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
    189188    [NSValueTransformer setValueTransformer: iconTransformer forName: @"ExpandedPathToIconTransformer"];
    190189   
     
    204203        if ([alert runModal] == NSAlertSecondButtonReturn)
    205204            exit(0);
    206         [alert release];
    207205       
    208206        [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningLegal"];
     
    343341        fSoundPlaying = NO;
    344342       
    345         tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, self);
     343        tr_sessionSetAltSpeedFunc(fLib, altSpeedToggledCallback, (__bridge void *)(self));
    346344        if (usesSpeedLimitSched)
    347345            [fDefaults setBool: tr_sessionUsesAltSpeed(fLib) forKey: @"SpeedLimit"];
    348346       
    349         tr_sessionSetRPCCallback(fLib, rpcCallback, self);
     347        tr_sessionSetRPCCallback(fLib, rpcCallback, (__bridge void *)(self));
    350348       
    351349        [GrowlApplicationBridge setGrowlDelegate: self];
     
    369367    [toolbar setDisplayMode: NSToolbarDisplayModeIconOnly];
    370368    [fWindow setToolbar: toolbar];
    371     [toolbar release];
    372369   
    373370    [fWindow setDelegate: self]; //do manually to avoid placement issue
     
    439436    IONotificationPortRef notify;
    440437    io_object_t iterator;
    441     if ((fRootPort = IORegisterForSystemPower(self, & notify, sleepCallback, &iterator)))
     438    if ((fRootPort = IORegisterForSystemPower((__bridge void *)(self), & notify, sleepCallback, &iterator)))
    442439        CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notify), kCFRunLoopCommonModes);
    443440    else
     
    469466                    [waitToStartTorrents addObject: torrent];
    470467               
    471                 [torrent release];
    472468            }
    473469        }
     
    600596                [fDefaults setBool: ([[alert suppressionButton] state] != NSOnState) forKey: @"WarningDonate"];
    601597           
    602             [alert release];
    603598        }
    604599    }
     
    671666        if ([fAutoImportTimer isValid])
    672667            [fAutoImportTimer invalidate];
    673         [fAutoImportTimer release];
    674668    }
    675669   
     
    683677            NSURLDownload * download = [downloadDict objectForKey: @"Download"];
    684678            [download cancel];
    685             [download release];
    686         }
    687         [fPendingTorrentDownloads release];
     679        }
    688680    }
    689681   
     
    704696    [fTableView saveCollapsedGroups];
    705697   
    706     //remaining calls the same as dealloc
    707     [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    
    726698    //complete cleanup
    727699    tr_sessionClose(fLib);
     
    751723    {
    752724        [download cancel];
     725       
     726        [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
     727        if ([fPendingTorrentDownloads count] == 0)
     728            fPendingTorrentDownloads = nil;
    753729       
    754730        NSRunAlertPanel(NSLocalizedString(@"Torrent download failed", "Download not a torrent -> title"),
     
    757733            [[[[download request] URL] absoluteString] stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding]],
    758734            NSLocalizedString(@"OK", "Download not a torrent -> button"), nil, nil);
    759        
    760         [download release];
    761735    }
    762736    else
     
    767741-(void) download: (NSURLDownload *) download didCreateDestination: (NSString *) path
    768742{
    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"];
    774744}
    775745
     
    784754    [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
    785755    if ([fPendingTorrentDownloads count] == 0)
    786     {
    787         [fPendingTorrentDownloads release];
    788756        fPendingTorrentDownloads = nil;
    789     }
    790    
    791     [download release];
    792757}
    793758
     
    803768    [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
    804769    if ([fPendingTorrentDownloads count] == 0)
    805     {
    806         [fPendingTorrentDownloads release];
    807770        fPendingTorrentDownloads = nil;
    808     }
    809    
    810     [download release];
    811771}
    812772
     
    902862                                                    deleteTorrent: deleteTorrentFile canToggleDelete: canToggleDelete];
    903863            [addController showWindow: self];
     864           
     865            if (!fAddWindows)
     866                fAddWindows = [NSMutableSet set];
     867            [fAddWindows addObject: addController];
    904868        }
    905869        else
     
    910874            [torrent update];
    911875            [fTorrents addObject: torrent];
    912             [torrent release];
    913876           
    914877            if (!fAddingTransfers)
     
    924887{
    925888    Torrent * torrent = [addController torrent];
    926     [addController autorelease];
    927889   
    928890    if (add)
     
    932894        [torrent update];
    933895        [fTorrents addObject: torrent];
    934         [torrent release];
    935896       
    936897        if (!fAddingTransfers)
     
    943904    {
    944905        [torrent closeRemoveTorrent: NO];
    945         [torrent release];
    946     }
     906    }
     907   
     908    [fAddWindows removeObject: addController];
     909    if ([fAddWindows count] == 0)
     910        fAddWindows = nil;
    947911}
    948912
     
    982946                                                        controller: self];
    983947        [addController showWindow: self];
     948       
     949        if (!fAddWindows)
     950            fAddWindows = [NSMutableSet set];
     951        [fAddWindows addObject: addController];
    984952    }
    985953    else
     
    990958        [torrent update];
    991959        [fTorrents addObject: torrent];
    992         [torrent release];
    993960       
    994961        if (!fAddingTransfers)
     
    1003970{
    1004971    Torrent * torrent = [addController torrent];
    1005     [addController autorelease];
    1006972   
    1007973    if (add)
     
    1011977        [torrent update];
    1012978        [fTorrents addObject: torrent];
    1013         [torrent release];
    1014979       
    1015980        if (!fAddingTransfers)
     
    1022987    {
    1023988        [torrent closeRemoveTorrent: NO];
    1024         [torrent release];
    1025     }
     989    }
     990   
     991    [fAddWindows removeObject: addController];
     992    if ([fAddWindows count] == 0)
     993        fAddWindows = nil;
    1026994}
    1027995
     
    1029997{
    1030998    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"]];
    10341000}
    10351001
     
    10371003{
    10381004    [self openFiles: [dictionary objectForKey: @"Filenames"] addType: [[dictionary objectForKey: @"AddType"] intValue] forcePath: nil];
    1039    
    1040     [dictionary release];
    10411005}
    10421006
     
    10901054    if ([[alert suppressionButton] state] == NSOnState)
    10911055        [fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
    1092     [alert release];
    10931056}
    10941057
     
    11081071    if ([[alert suppressionButton] state] == NSOnState)
    11091072        [fDefaults setBool: NO forKey: @"WarningInvalidOpen"];
    1110     [alert release];
    11111073}
    11121074
     
    11291091    if ([[alert suppressionButton] state])
    11301092        [fDefaults setBool: NO forKey: @"WarningDuplicate"];
    1131     [alert release];
    11321093}
    11331094
     
    11541115    if ([[alert suppressionButton] state])
    11551116        [fDefaults setBool: NO forKey: @"WarningDuplicate"];
    1156     [alert release];
    11571117}
    11581118
     
    11811141        NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: urlString]
    11821142                                    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]];
    11841156    }
    11851157}
     
    11871159- (void) openURLShowSheet: (id) sender
    11881160{
    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
    11931170{
    11941171    if (returnCode == 1)
     1172    {
     1173        NSString * urlString = [fUrlSheetController urlString];
    11951174        [self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO];
    1196    
    1197     [controller release];
     1175    }
     1176   
     1177    fUrlSheetController = nil;
    11981178}
    11991179
     
    12771257- (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData
    12781258{
    1279     [torrents retain];
    12801259
    12811260    if ([fDefaults boolForKey: @"CheckRemove"])
     
    13401319            NSBeginAlertSheet(title, NSLocalizedString(@"Remove", "Removal confirm panel -> button"),
    13411320                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);
    13431322            return;
    13441323        }
     
    13531332    if (returnCode == NSAlertDefaultReturn)
    13541333        [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]];
    1355     else
    1356         [torrents release];
    1357    
    1358     [dict release];
    13591334}
    13601335
     
    14441419   
    14451420    [self fullUpdateUI];
    1446    
    1447     #warning why do we need them retained?
    1448     [torrents autorelease];
    14491421}
    14501422
     
    14881460        }
    14891461       
    1490         NSAlert * alert = [[[NSAlert alloc] init] autorelease];
     1462        NSAlert * alert = [[NSAlert alloc] init];
    14911463        [alert setMessageText: message];
    14921464        [alert setInformativeText: info];
     
    15021474        if (returnCode != NSAlertFirstButtonReturn)
    15031475        {
    1504             [torrents release];
    15051476            return;
    15061477        }
     
    15501521    if ([torrents count] == 0)
    15511522    {
    1552         [torrents release];
    15531523        return;
    15541524    }
     
    15871557           
    15881558            [alert runModal];
    1589             [alert release];
    15901559        }
    15911560       
     
    23012270                        if (!newGroup)
    23022271                        {
    2303                             newGroup = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
     2272                            newGroup = [[TorrentGroup alloc] initWithGroup: groupValue];
    23042273                            [groupsByIndex setObject: newGroup forKey: [NSNumber numberWithInteger: groupValue]];
    23052274                            [fDisplayedTorrents addObject: newGroup];
     
    23472316            if (!group)
    23482317            {
    2349                 group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
     2318                group = [[TorrentGroup alloc] initWithGroup: groupValue];
    23502319                [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]];
    23512320                [fDisplayedTorrents addObject: group];
     
    24102379                if (!group)
    24112380                {
    2412                     group = [[[TorrentGroup alloc] initWithGroup: groupValue] autorelease];
     2381                    group = [[TorrentGroup alloc] initWithGroup: groupValue];
    24132382                    [groupsByIndex setObject: group forKey: [NSNumber numberWithInteger: groupValue]];
    24142383                }
     
    24782447    if (fAddingTransfers)
    24792448    {
    2480         [fAddingTransfers release];
    24812449        fAddingTransfers = nil;
    24822450    }
     
    25032471        [popover showRelativeToRect: [sender frame] ofView: sender preferredEdge: NSMaxYEdge];
    25042472       
    2505         [viewController release];
    2506         [popover release];
    25072473    }
    25082474    else
     
    25402506        for (NSInteger i = 0; i < groupMenuCount; i++)
    25412507        {
    2542             NSMenuItem * item = [[groupMenu itemAtIndex: 0] retain];
     2508            NSMenuItem * item = [groupMenu itemAtIndex: 0];
    25432509            [groupMenu removeItemAtIndex: 0];
    25442510            [menu addItem: item];
    2545             [item release];
    25462511        }
    25472512    }
     
    25622527            [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]];
    25632528            [menu addItem: item];
    2564             [item release];
    25652529        }
    25662530    }
     
    25802544            [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]];
    25812545            [menu addItem: item];
    2582             [item release];
    25832546        }
    25842547    }
     
    26272590            notificationName: GROWL_AUTO_SPEED_LIMIT iconData: nil priority: 0 isSticky: NO clickContext: nil];
    26282591   
    2629     [dict release];
    26302592}
    26312593
     
    26792641            if ([fAutoImportTimer isValid])
    26802642                [fAutoImportTimer invalidate];
    2681             [fAutoImportTimer release];
    26822643            fAutoImportTimer = nil;
    26832644        }
    26842645       
    26852646        //check again in 10 seconds in case torrent file wasn't complete
    2686         fAutoImportTimer = [[NSTimer scheduledTimerWithTimeInterval: 10.0 target: self
    2687             selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO] retain];
     2647        fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self
     2648            selector: @selector(checkAutoImportDirectory) userInfo: nil repeats: NO];
    26882649       
    26892650        [self checkAutoImportDirectory];
     
    26972658        if ([fAutoImportTimer isValid])
    26982659            [fAutoImportTimer invalidate];
    2699         [fAutoImportTimer release];
    27002660        fAutoImportTimer = nil;
    27012661    }
    27022662   
    2703     if (fAutoImportedNames)
    2704     {
    2705         [fAutoImportedNames release];
    2706         fAutoImportedNames = nil;
    2707     }
     2663    fAutoImportedNames = nil;
    27082664   
    27092665    [self checkAutoImportDirectory];
     
    27662722    }
    27672723   
    2768     [newNames release];
    27692724}
    27702725
     
    33043259    {
    33053260        [[fStatusBar view] removeFromSuperviewWithoutNeedingDisplay];
    3306         [fStatusBar release];
    33073261        fStatusBar = nil;
    33083262    }
     
    34023356    {
    34033357        [[fFilterBar view] removeFromSuperviewWithoutNeedingDisplay];
    3404         [fFilterBar release];
    34053358        fFilterBar = nil;
    34063359    }
     
    34313384- (void) beginPreviewPanelControl: (QLPreviewPanel *) panel
    34323385{
    3433     fPreviewPanel = [panel retain];
     3386    fPreviewPanel = panel;
    34343387    [fPreviewPanel setDelegate: self];
    34353388    [fPreviewPanel setDataSource: self];
     
    34383391- (void) endPreviewPanelControl: (QLPreviewPanel *) panel
    34393392{
    3440     [fPreviewPanel release];
    34413393    fPreviewPanel = nil;
    34423394}
     
    35153467   
    35163468    [item setView: button];
    3517     [button release];
    35183469   
    35193470    const NSSize buttonSize = NSMakeSize(36.0, 25.0);
     
    35213472    [item setMaxSize: buttonSize];
    35223473   
    3523     return [item autorelease];
     3474    return item;
    35243475}
    35253476
     
    36013552       
    36023553        NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
    3603         [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
     3554        [segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]];
    36043555        [groupItem setView: segmentedControl];
    36053556        NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
     
    36323583                                        NSLocalizedString(@"Resume All", "All toolbar item -> label"), nil]];
    36333584       
    3634         [segmentedControl release];
    36353585       
    36363586        [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
    36373587       
    3638         return [groupItem autorelease];
     3588        return groupItem;
    36393589    }
    36403590    else if ([ident isEqualToString: TOOLBAR_PAUSE_RESUME_SELECTED])
     
    36433593       
    36443594        NSSegmentedControl * segmentedControl = [[NSSegmentedControl alloc] initWithFrame: NSZeroRect];
    3645         [segmentedControl setCell: [[[ToolbarSegmentedCell alloc] init] autorelease]];
     3595        [segmentedControl setCell: [[ToolbarSegmentedCell alloc] init]];
    36463596        [groupItem setView: segmentedControl];
    36473597        NSSegmentedCell * segmentedCell = (NSSegmentedCell *)[segmentedControl cell];
     
    36743624                                        NSLocalizedString(@"Resume Selected", "Selected toolbar item -> label"), nil]];
    36753625       
    3676         [segmentedControl release];
    36773626       
    36783627        [groupItem setVisibilityPriority: NSToolbarItemVisibilityPriorityHigh];
    36793628       
    3680         return [groupItem autorelease];
     3629        return groupItem;
    36813630    }
    36823631    else if ([ident isEqualToString: TOOLBAR_FILTER])
     
    42764225    [menu addItemWithTitle: NSLocalizedString(@"Speed Limit", "Dock item") action: @selector(toggleSpeedLimit:) keyEquivalent: @""];
    42774226   
    4278     return [menu autorelease];
     4227    return menu;
    42794228}
    42804229
     
    44394388                if (torrentStruct == [torrent torrentStruct])
    44404389                {
    4441                     [torrent retain];
    44424390                    break;
    44434391                }
     
    44544402            case TR_RPC_TORRENT_ADDED:
    44554403                [self performSelectorOnMainThread: @selector(rpcAddTorrentStruct:) withObject:
    4456                     [[NSValue valueWithPointer: torrentStruct] retain] waitUntilDone: NO];
     4404                    [NSValue valueWithPointer: torrentStruct] waitUntilDone: NO];
    44574405                break;
    44584406           
     
    44934441            default:
    44944442                NSAssert1(NO, @"Unknown RPC command received: %d", type);
    4495                 [torrent release];
    44964443        }
    44974444    }
     
    45014448{
    45024449    tr_torrent * torrentStruct = (tr_torrent *)[torrentStructPtr pointerValue];
    4503     [torrentStructPtr release];
    45044450   
    45054451    NSString * location = nil;
     
    45184464    [torrent update];
    45194465    [fTorrents addObject: torrent];
    4520     [torrent release];
    45214466   
    45224467    if (!fAddingTransfers)
     
    45294474- (void) rpcRemoveTorrent: (Torrent *) torrent
    45304475{
    4531     [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO];
    4532     [torrent release];
     4476    [self confirmRemoveTorrents: [NSArray arrayWithObject: torrent] deleteData: NO];
    45334477}
    45344478
    45354479- (void) rpcRemoveTorrentDeleteData: (Torrent *) torrent
    45364480{
    4537     [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: YES];
    4538     [torrent release];
     4481    [self confirmRemoveTorrents: [NSArray arrayWithObject: torrent] deleteData: YES];
    45394482}
    45404483
     
    45424485{
    45434486    [torrent update];
    4544     [torrent release];
    45454487   
    45464488    [self updateUI];
     
    45594501    }
    45604502   
    4561     [torrent release];
    45624503}
    45634504
     
    45704511        [fInfoController updateInfoStats];
    45714512   
    4572     [torrent release];
    45734513}
    45744514
  • trunk/macosx/CreatorWindowController.m

    r13162 r13248  
    6868        fStarted = NO;
    6969       
    70         fPath = [path retain];
     70        fPath = path;
    7171        fInfo = tr_metaInfoBuilderCreate([fPath UTF8String]);
    7272       
     
    8282           
    8383            [alert runModal];
    84             [alert release];
    85            
    86             [self release];
     84           
    8785            return nil;
    8886        }
     
    9896           
    9997            [alert runModal];
    100             [alert release];
    101            
    102             [self release];
     98           
    10399            return nil;
    104100        }
     
    171167                                                            fInfo->pieceCount, [NSString stringForFileSize: fInfo->pieceSize]]];
    172168   
    173     fLocation = [[[[fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent:
    174                     [name stringByAppendingPathExtension: @"torrent"]] retain];
     169    fLocation = [[[fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent:
     170                    [name stringByAppendingPathExtension: @"torrent"]];
    175171    [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
    176172    [fLocationField setToolTip: fLocation];
     
    185181- (void) dealloc
    186182{
    187     [fPath release];
    188     [fLocation release];
    189    
    190     [fTrackers release];
     183   
    191184   
    192185    if (fInfo)
     
    195188    [fTimer invalidate];
    196189   
    197     [super dealloc];
    198190}
    199191
     
    215207        if (result == NSFileHandlingPanelOKButton)
    216208        {
    217             [fLocation release];
    218             fLocation = [[[panel URL] path] retain];
     209            fLocation = [[panel URL] path];
    219210           
    220211            [fLocationField setStringValue: [fLocation stringByAbbreviatingWithTildeInPath]];
     
    262253}
    263254
    264 - (void) windowWillClose: (NSNotification *) notification
    265 {
    266     [self autorelease];
    267 }
    268 
    269255- (void) cancelCreateProgress: (id) sender
    270256{
     
    373359    BOOL added = NO;
    374360   
    375     for (NSString * tracker in tempTrackers)
     361    for (__strong NSString * tracker in tempTrackers)
    376362    {
    377363        tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
     
    426412    }
    427413   
    428     [alert release];
    429414   
    430415    if (returnCode == NSAlertFirstButtonReturn)
     
    437422    if (![[NSFileManager defaultManager] fileExistsAtPath: [fLocation stringByDeletingLastPathComponent]])
    438423    {
    439         NSAlert * alert = [[[NSAlert alloc] init] autorelease];
     424        NSAlert * alert = [[NSAlert alloc] init];
    440425        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> directory doesn't exist warning -> button")];
    441426        [alert setMessageText: NSLocalizedString(@"The chosen torrent file location does not exist.",
     
    458443        NSInteger count = [pathComponents count];
    459444       
    460         NSAlert * alert = [[[NSAlert alloc] init] autorelease];
     445        NSAlert * alert = [[NSAlert alloc] init];
    461446        [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> file already exists warning -> button")];
    462447        [alert setMessageText: NSLocalizedString(@"A torrent file with this name and directory cannot be created.",
     
    523508           
    524509            default:
    525                 alert = [[[NSAlert alloc] init] autorelease];
     510                alert = [[NSAlert alloc] init];
    526511                [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> failed -> button")];
    527512                [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Creation of \"%@\" failed.",
  • trunk/macosx/DragOverlayView.m

    r13162 r13248  
    5555                                paragraphStyle, NSParagraphStyleAttributeName, nil];
    5656       
    57         [stringShadow release];
    58         [paragraphStyle release];
    5957    }
    6058    return self;
    6159}
    6260
    63 - (void) dealloc
    64 {
    65     [fBadge release];
    66    
    67     [fMainLineAttributes release];
    68     [fSubLineAttributes release];
    69    
    70     [super dealloc];
    71 }
    7261
    7362- (void) setOverlay: (NSImage *) icon mainLine: (NSString *) mainLine subLine: (NSString *) subLine
    7463{
    75     [fBadge release];
    7664   
    7765    //create badge
  • trunk/macosx/DragOverlayWindow.m

    r13162 r13248  
    4949        DragOverlayView * view = [[DragOverlayView alloc] initWithFrame: [self frame]];
    5050        [self setContentView: view];
    51         [view release];
    5251       
    5352        [self setReleasedWhenClosed: NO];
     
    7877    [[NSNotificationCenter defaultCenter] removeObserver: self];
    7978   
    80     [fFadeInAnimation release];
    81     [fFadeOutAnimation release];
    8279   
    83     [super dealloc];
    8480}
    8581
  • trunk/macosx/ExpandedPathToIconTransformer.h

    r13162 r13248  
    2626
    2727@interface ExpandedPathToIconTransformer : NSValueTransformer
    28 {
    29 }
    3028
    3129@end
  • trunk/macosx/ExpandedPathToPathTransformer.h

    r13162 r13248  
    2626
    2727@interface ExpandedPathToPathTransformer : NSValueTransformer
    28 {
    29 }
    3028
    3129@end
  • trunk/macosx/FileListNode.h

    r13175 r13248  
    3535    NSString * fName;
    3636    NSString * fPath;
    37     Torrent * fTorrent;
     37    Torrent * __unsafe_unretained fTorrent;
    3838    uint64_t fSize;
    3939    NSImage * fIcon;
     
    4444@property (nonatomic, readonly) NSString * path;
    4545
    46 @property (nonatomic, readonly) Torrent * torrent;
     46@property (nonatomic, readonly, unsafe_unretained) Torrent * torrent;
    4747
    4848@property (nonatomic, readonly) uint64_t size;
  • trunk/macosx/FileListNode.m

    r13175 r13248  
    8181{
    8282    //this object is essentially immutable after initial setup
    83     return [self retain];
     83    return self;
    8484}
    8585
    86 - (void) dealloc
    87 {
    88     [fName release];
    89     [fPath release];
    90     [fIndexes release];
    91    
    92     [fIcon release];
    93    
    94     [fChildren release];
    95    
    96     [super dealloc];
    97 }
    9886
    9987- (NSString *) description
     
    113101{
    114102    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]];
    117105    return fIcon;
    118106}
     
    134122    {
    135123        fIsFolder = isFolder;
    136         fName = [name retain];
    137         fPath = [path retain];
     124        fName = name;
     125        fPath = path;
    138126       
    139127        fIndexes = [[NSMutableIndexSet alloc] init];
  • trunk/macosx/FileNameCell.m

    r13162 r13248  
    7070                                statusParagraphStyle, NSParagraphStyleAttributeName,  nil];
    7171       
    72         [paragraphStyle release];
    73         [statusParagraphStyle release];
    7472    }
    7573    return self;
    76 }
    77 
    78 - (void) dealloc
    79 {
    80     [fTitleAttributes release];
    81     [fStatusAttributes release];
    82    
    83     [super dealloc];
    84 }
    85 
    86 - (id) copyWithZone: (NSZone *) zone
    87 {
    88     FileNameCell * copy = [super copyWithZone: zone];
    89    
    90     copy->fTitleAttributes = [fTitleAttributes retain];
    91     copy->fStatusAttributes = [fStatusAttributes retain];
    92    
    93     return copy;
    9474}
    9575
     
    194174{
    195175    NSString * title = [(FileListNode *)[self objectValue] name];
    196     return [[[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease];
     176    return [[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes];
    197177}
    198178
     
    208188                            "Inspector -> Files tab -> file status string"), percentString, [NSString stringForFileSize: [node size]]];
    209189   
    210     return [[[NSAttributedString alloc] initWithString: status attributes: fStatusAttributes] autorelease];
     190    return [[NSAttributedString alloc] initWithString: status attributes: fStatusAttributes];
    211191}
    212192
  • trunk/macosx/FileOutlineController.h

    r13162 r13248  
    3030@interface FileOutlineController : NSObject
    3131{
    32     Torrent * fTorrent;
     32    __unsafe_unretained Torrent * fTorrent;
    3333    NSMutableArray * fFileList;
    3434   
  • trunk/macosx/FileOutlineController.m

    r13169 r13248  
    7474}
    7575
    76 - (void) dealloc
    77 {
    78     [fFileList release];
    79     [fFilterText release];
    80    
    81     [super dealloc];
    82 }
    83 
    8476- (FileOutlineView *) outlineView
    8577{
     
    9385    [fFileList setArray: [fTorrent fileList]];
    9486   
    95     [fFilterText release];
    9687    fFilterText = nil;
    9788   
     
    208199        [fOutline reloadData];
    209200   
    210     [fFilterText release];
    211     fFilterText = [text retain];
     201    fFilterText = text;
    212202}
    213203
     
    522512    [item setTag: FILE_CHECK_TAG];
    523513    [menu addItem: item];
    524     [item release];
    525514   
    526515    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Uncheck Selected", "File Outline -> Menu")
     
    529518    [item setTag: FILE_UNCHECK_TAG];
    530519    [menu addItem: item];
    531     [item release];
    532520   
    533521    //only check selected
     
    536524    [item setTarget: self];
    537525    [menu addItem: item];
    538     [item release];
    539526   
    540527    [menu addItem: [NSMenuItem separatorItem]];
     
    545532    [item setSubmenu: priorityMenu];
    546533    [menu addItem: item];
    547     [item release];
    548534   
    549535    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"High", "File Outline -> Priority Menu")
     
    553539    [item setImage: [NSImage imageNamed: @"PriorityHighTemplate.png"]];
    554540    [priorityMenu addItem: item];
    555     [item release];
    556541   
    557542    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Normal", "File Outline -> Priority Menu")
     
    561546    [item setImage: [NSImage imageNamed: @"PriorityNormalTemplate.png"]];
    562547    [priorityMenu addItem: item];
    563     [item release];
    564548   
    565549    item = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Low", "File Outline -> Priority Menu")
     
    569553    [item setImage: [NSImage imageNamed: @"PriorityLowTemplate.png"]];
    570554    [priorityMenu addItem: item];
    571     [item release];
    572    
    573     [priorityMenu release];
     555   
    574556   
    575557    [menu addItem: [NSMenuItem separatorItem]];
     
    580562    [item setTarget: self];
    581563    [menu addItem: item];
    582     [item release];
    583    
    584     return [menu autorelease];
     564   
     565    return menu;
    585566}
    586567
  • trunk/macosx/FileOutlineView.m

    r13162 r13248  
    3636    FileNameCell * nameCell = [[FileNameCell alloc] init];
    3737    [[self tableColumnWithIdentifier: @"Name"] setDataCell: nameCell];
    38     [nameCell release];
    3938   
    4039    FilePriorityCell * priorityCell = [[FilePriorityCell alloc] init];
    4140    [[self tableColumnWithIdentifier: @"Priority"] setDataCell: priorityCell];
    42     [priorityCell release];
    4341   
    4442    [self setAutoresizesOutlineColumn: NO];
     
    4846}
    4947
    50 - (void) dealloc
    51 {
    52     [super dealloc];
    53 }
    5448
    5549- (void) mouseDown: (NSEvent *) event
  • trunk/macosx/FilePriorityCell.m

    r13162 r13248  
    102102    NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: options owner: controlView userInfo: userInfo];
    103103    [controlView addTrackingArea: area];
    104     [area release];
    105104}
    106105
  • trunk/macosx/FilterBarController.m

    r13162 r13248  
    129129    [[NSNotificationCenter defaultCenter] removeObserver: self];
    130130   
    131     [super dealloc];
    132131}
    133132
     
    266265        for (NSInteger i = 0; i < groupMenuCount; i++)
    267266        {
    268             NSMenuItem * item = [[groupMenu itemAtIndex: 0] retain];
     267            NSMenuItem * item = [groupMenu itemAtIndex: 0];
    269268            [groupMenu removeItemAtIndex: 0];
    270269            [menu addItem: item];
    271             [item release];
    272270        }
    273271    }
  • trunk/macosx/FilterBarView.m

    r13162 r13248  
    3838}
    3939
    40 - (void) dealloc
    41 {
    42     [fGradient release];
    43     [super dealloc];
    44 }
    4540
    4641- (BOOL) mouseDownCanMoveWindow
  • trunk/macosx/GlobalOptionsPopoverViewController.m

    r13170 r13248  
    141141- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    142142{
    143     [fInitialString release];
    144     fInitialString = [[control stringValue] retain];
     143    fInitialString = [control stringValue];
    145144   
    146145    return YES;
     
    153152    {
    154153        [control setStringValue: fInitialString];
    155         [fInitialString release];
    156154        fInitialString = nil;
    157155    }
  • trunk/macosx/GroupToolbarItem.m

    r13162 r13248  
    2727@implementation GroupToolbarItem
    2828
    29 - (void) dealloc
    30 {
    31     [fIdentifiers release];
    32     [super dealloc];
    33 }
    3429
    3530- (void) setIdentifiers: (NSArray *) identifiers
    3631{
    37     [fIdentifiers release];
    38     fIdentifiers = [identifiers retain];
     32    fIdentifiers = identifiers;
    3933}
    4034
     
    4539    for (NSInteger i = 0; i < [control segmentCount]; i++)
    4640        [control setEnabled: [[self target] validateToolbarItem:
    47             [[[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]] autorelease]] forSegment: i];
     41            [[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]]] forSegment: i];
    4842}
    4943
     
    6458       
    6559        [menu addItem: addItem];
    66         [addItem release];
    6760    }
    6861   
    69     [menu release];
    7062    [self setMenuFormRepresentation: menuItem];
    71     [menuItem release];
    7263}
    7364
     
    7970    for (NSInteger i = 0; i < count; i++)
    8071        [[[menuItem submenu] itemAtIndex: i] setEnabled: [[self target] validateToolbarItem:
    81             [[[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]] autorelease]]];
     72            [[NSToolbarItem alloc] initWithItemIdentifier: [fIdentifiers objectAtIndex: i]]]];
    8273   
    8374    return menuItem;
  • trunk/macosx/GroupsController.m

    r13162 r13248  
    5555        NSData * data;
    5656        if ((data = [[NSUserDefaults standardUserDefaults] dataForKey: @"GroupDicts"]))
    57             fGroups = [[NSKeyedUnarchiver unarchiveObjectWithData: data] retain];
     57            fGroups = [NSKeyedUnarchiver unarchiveObjectWithData: data];
    5858        else if ((data = [[NSUserDefaults standardUserDefaults] dataForKey: @"Groups"])) //handle old groups
    5959        {
    60             fGroups = [[NSUnarchiver unarchiveObjectWithData: data] retain];
     60            fGroups = [NSUnarchiver unarchiveObjectWithData: data];
    6161            [[NSUserDefaults standardUserDefaults] removeObjectForKey: @"Groups"];
    6262            [self saveGroups];
     
    108108}
    109109
    110 - (void) dealloc
    111 {
    112     [fGroups release];
    113     [super dealloc];
    114 }
    115110
    116111- (NSInteger) numberOfGroups
     
    305300       
    306301        [item setImage: icon];
    307         [icon release];
    308302    }
    309303    else
     
    311305   
    312306    [menu addItem: item];
    313     [item release];
    314307   
    315308    for (NSMutableDictionary * dict in fGroups)
     
    327320           
    328321            [item setImage: icon];
    329             [icon release];
    330322        }
    331323        else
     
    333325       
    334326        [menu addItem: item];
    335         [item release];
    336     }
    337    
    338     return [menu autorelease];
     327    }
     328   
     329    return menu;
    339330}
    340331
     
    363354        [tempDict removeObjectForKey: @"Icon"];
    364355        [groups addObject: tempDict];
    365         [tempDict release];
    366356    }
    367357   
     
    388378                                [NSColor whiteColor]] endingColor: color];
    389379    [gradient drawInBezierPath: bp angle: 270.0];
    390     [gradient release];
    391380   
    392381    //inside
     
    395384                endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
    396385    [gradient drawInBezierPath: bp angle: 270.0];
    397     [gradient release];
    398386   
    399387    [icon unlockFocus];
    400388   
    401389    [dict setObject: icon forKey: @"Icon"];
    402     [icon release];
    403390   
    404391    return icon;
  • trunk/macosx/GroupsPrefsController.m

    r13162 r13248  
    383383    if (location)
    384384    {
    385         ExpandedPathToPathTransformer * pathTransformer = [[[ExpandedPathToPathTransformer alloc] init] autorelease];
     385        ExpandedPathToPathTransformer * pathTransformer = [[ExpandedPathToPathTransformer alloc] init];
    386386        [[fCustomLocationPopUp itemAtIndex: 0] setTitle: [pathTransformer transformedValue: location]];
    387         ExpandedPathToIconTransformer * iconTransformer = [[[ExpandedPathToIconTransformer alloc] init] autorelease];
     387        ExpandedPathToIconTransformer * iconTransformer = [[ExpandedPathToIconTransformer alloc] init];
    388388        [[fCustomLocationPopUp itemAtIndex: 0] setImage: [iconTransformer transformedValue: location]];
    389389    }
  • trunk/macosx/InfoActivityViewController.m

    r13162 r13248  
    6363    [[NSNotificationCenter defaultCenter] removeObserver: self];
    6464   
    65     [fTorrents release];
    66    
    67     [super dealloc];
     65   
    6866}
    6967
     
    7169{
    7270    //don't check if it's the same in case the metadata changed
    73     [fTorrents release];
    74     fTorrents = [torrents retain];
     71    fTorrents = torrents;
    7572   
    7673    fSet = NO;
  • trunk/macosx/InfoFileViewController.m

    r13162 r13248  
    6262}
    6363
    64 - (void) dealloc
    65 {
    66     [fTorrents release];
    67    
    68     [super dealloc];
    69 }
    7064
    7165- (void) setInfoForTorrents: (NSArray *) torrents
    7266{
    7367    //don't check if it's the same in case the metadata changed
    74     [fTorrents release];
    75     fTorrents = [torrents retain];
     68    fTorrents = torrents;
    7669   
    7770    fSet = NO;
  • trunk/macosx/InfoGeneralViewController.m

    r13162 r13248  
    4545}
    4646
    47 - (void) dealloc
    48 {
    49     [fTorrents release];
    50    
    51     [super dealloc];
    52 }
    5347
    5448- (void) setInfoForTorrents: (NSArray *) torrents
    5549{
    5650    //don't check if it's the same in case the metadata changed
    57     [fTorrents release];
    58     fTorrents = [torrents retain];
     51    fTorrents = torrents;
    5952   
    6053    fSet = NO;
  • trunk/macosx/InfoOptionsViewController.m

    r13162 r13248  
    6969    [[NSNotificationCenter defaultCenter] removeObserver: self];
    7070   
    71     [fTorrents release];
    72    
    73     [super dealloc];
     71   
    7472}
    7573
     
    7775{
    7876    //don't check if it's the same in case the metadata changed
    79     [fTorrents release];
    80     fTorrents = [torrents retain];
     77    fTorrents = torrents;
    8178   
    8279    fSet = NO;
     
    447444- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    448445{
    449     [fInitialString release];
    450     fInitialString = [[control stringValue] retain];
     446    fInitialString = [control stringValue];
    451447   
    452448    return YES;
     
    459455    {
    460456        [control setStringValue: fInitialString];
    461         [fInitialString release];
    462457        fInitialString = nil;
    463458    }
  • trunk/macosx/InfoPeersViewController.m

    r13162 r13248  
    9999}
    100100
    101 - (void) dealloc
    102 {
    103     [fTorrents release];
    104    
    105     [fPeers release];
    106     [fWebSeeds release];
    107    
    108     [fWebSeedTableAnimation release];
    109    
    110     [super dealloc];
    111 }
    112101
    113102#warning subclass?
     
    115104{
    116105    //don't check if it's the same in case the metadata changed
    117     [fTorrents release];
    118     fTorrents = [torrents retain];
     106    fTorrents = torrents;
    119107   
    120108    fSet = NO;
     
    244232        [self setWebSeedTableHidden: !fWebSeeds animate: NO];
    245233   
    246     [fPeers release];
    247234    fPeers = nil;
    248     [fWebSeeds release];
    249235    fWebSeeds = nil;
    250236}
     
    451437    if (animation == fWebSeedTableAnimation)
    452438    {
    453         [fWebSeedTableAnimation release];
    454439        fWebSeedTableAnimation = nil;
    455440    }
     
    461446    {
    462447        [fWebSeedTableAnimation stopAnimation]; // jumps to end frame
    463         [fWebSeedTableAnimation release];
    464448        fWebSeedTableAnimation = nil;
    465449    }
     
    476460    if ([fTorrents count] == 0)
    477461    {
    478         [fPeers release];
    479462        fPeers = nil;
    480463        [fPeerTable reloadData];
     
    494477    if (!hasWebSeeds)
    495478    {
    496         [fWebSeeds release];
    497479        fWebSeeds = nil;
    498480        [fWebSeedTable reloadData];
     
    511493    {
    512494        [fWebSeedTableAnimation stopAnimation];
    513         [fWebSeedTableAnimation release];
    514495        fWebSeedTableAnimation = nil;
    515496    }
  • trunk/macosx/InfoTabButtonBack.m

    r13162 r13248  
    3838}
    3939
    40 - (void) dealloc
    41 {
    42     [fGradient release];
    43     [super dealloc];
    44 }
    4540
    4641- (void) drawRect: (NSRect) rect
  • trunk/macosx/InfoTabButtonCell.m

    r13162 r13248  
    3838   
    3939    //expects the icon to currently be set as the image
    40     fIcon = [[self image] retain];
     40    fIcon = [self image];
    4141    [self setSelectedTab: fSelected];
    4242}
     
    4646    [[NSNotificationCenter defaultCenter] removeObserver: self];
    4747   
    48     [fIcon release];
    49     [super dealloc];
    5048}
    5149
     
    8684   
    8785    [gradient drawInRect: tabRect angle: 270.0];
    88     [gradient release];
    8986   
    9087    if (fIcon)
     
    10299   
    103100    [self setImage: tabImage];
    104     [tabImage release];
    105101}
    106102
  • trunk/macosx/InfoTrackersViewController.m

    r13162 r13248  
    7575}
    7676
    77 - (void) dealloc
    78 {
    79     [fTorrents release];
    80     [fTrackers release];
    81     [fTrackerCell release];
    82    
    83     [super dealloc];
    84 }
    8577
    8678- (void) setInfoForTorrents: (NSArray *) torrents
    8779{
    8880    //don't check if it's the same in case the metadata changed
    89     [fTorrents release];
    90     fTorrents = [torrents retain];
     81    fTorrents = torrents;
    9182   
    9283    fSet = NO;
     
    10798       
    10899        if ([fTorrents count] == 1)
    109             fTrackers = [[[fTorrents objectAtIndex: 0] allTrackerStats] retain];
     100            fTrackers = [[fTorrents objectAtIndex: 0] allTrackerStats];
    110101        else
    111102        {
     
    122113            [fTrackerTable reloadData];
    123114       
    124         [oldTrackers release];
    125115    }
    126116    else
     
    131121        NSArray * tierAndTrackerBeingAdded = [fTrackers objectsAtIndexes: addedIndexes];
    132122       
    133         [fTrackers release];
    134         fTrackers = [[[fTorrents objectAtIndex: 0] allTrackerStats] retain];
     123        fTrackers = [[fTorrents objectAtIndex: 0] allTrackerStats];
    135124        [fTrackers addObjectsFromArray: tierAndTrackerBeingAdded];
    136125       
     
    150139- (void) clearView
    151140{
    152     [fTrackers release];
    153141    fTrackers = nil;
    154142}
     
    232220   
    233221    //reset table with either new or old value
    234     [fTrackers release];
    235     fTrackers = [[torrent allTrackerStats] retain];
     222    fTrackers = [torrent allTrackerStats];
    236223   
    237224    [fTrackerTable setTrackers: fTrackers];
     
    267254        if (numberSelected == 0)
    268255        {
    269             [fTrackers release];
    270256            fTrackers = nil;
    271257           
     
    394380        if ([[alert suppressionButton] state] == NSOnState)
    395381            [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningRemoveTrackers"];
    396         [alert release];
    397382       
    398383        if (result != NSAlertFirstButtonReturn)
     
    408393   
    409394    //reset table with either new or old value
    410     [fTrackers release];
    411395    fTrackers = [[NSMutableArray alloc] init];
    412396    for (Torrent * torrent in fTorrents)
  • trunk/macosx/InfoWindowController.m

    r13162 r13248  
    141141        [fViewController saveViewSize];
    142142   
    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   
    153145}
    154146
     
    158150        return;
    159151   
    160     [fTorrents release];
    161     fTorrents = [torrents retain];
     152    fTorrents = torrents;
    162153   
    163154    [self resetInfo];
  • trunk/macosx/MessageWindowController.m

    r13162 r13248  
    105105    [fFilterField setFrame: filterButtonFrame];
    106106   
    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];
    109109   
    110110    //select proper level in popup button
     
    136136   
    137137    [fTimer invalidate];
    138     [fLock release];
    139    
    140     [fMessages release];
    141     [fDisplayedMessages release];
    142    
    143     [fAttributes release];
    144    
    145     [super dealloc];
     138   
     139   
     140   
    146141}
    147142
     
    392387            NSArray * descriptors = [[NSArray alloc] initWithObjects: descriptor, nil];
    393388            NSArray * sortedMessages = [fDisplayedMessages sortedArrayUsingDescriptors: descriptors];
    394             [descriptors release];
    395389           
    396390            //create the text to output
     
    412406               
    413407                [alert runModal];
    414                 [alert release];
    415408            }
    416409        }
  • trunk/macosx/NSImageAdditions.m

    r13162 r13248  
    4040    [coloredImage unlockFocus];
    4141   
    42     return [coloredImage autorelease];
     42    return coloredImage;
    4343}
    4444
  • trunk/macosx/NSMutableArrayAdditions.m

    r13162 r13248  
    3232        return;
    3333   
    34     id object = [[self objectAtIndex: fromIndex] retain];
     34    id object = [self objectAtIndex: fromIndex];
    3535   
    3636    //shift objects - more efficient than simply removing the object and re-inserting the object
     
    4747    [self replaceObjectAtIndex: toIndex withObject: object];
    4848   
    49     [object release];
    5049}
    5150
  • trunk/macosx/NSStringAdditions.m

    r13162 r13248  
    5151+ (NSString *) formattedUInteger: (NSUInteger) value
    5252{
    53     NSNumberFormatter * numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
     53    NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init];
    5454    [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
    5555    [numberFormatter setMaximumFractionDigits: 0];
     
    239239   
    240240    NSString * fileSizeString = [numberFormatter stringFromNumber: [NSNumber numberWithFloat: convertedSize]];
    241     [numberFormatter release];
    242241   
    243242    if (!notAllowedUnit || ![unit isEqualToString: notAllowedUnit])
  • trunk/macosx/PeerProgressIndicatorCell.m

    r13162 r13248  
    3131@implementation PeerProgressIndicatorCell
    3232
    33 - (id) copyWithZone: (NSZone *) zone
    34 {
    35     PeerProgressIndicatorCell * copy = [super copyWithZone: zone];
    36     copy->fAttributes = [fAttributes retain];
    37    
    38     return copy;
    39 }
    40 
    41 - (void) dealloc
    42 {
    43     [fAttributes release];
    44     [super dealloc];
    45 }
    46 
    4733- (void) setSeed: (BOOL) seed
    4834{
     
    6147            fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont systemFontOfSize: 11.0], NSFontAttributeName,
    6248                                                                            paragraphStyle, NSParagraphStyleAttributeName, nil];
    63             [paragraphStyle release];
    6449        }
    6550       
     
    7156        if (fAttributes)
    7257        {
    73             [fAttributes release];
    7458            fAttributes = nil;
    7559        }
  • trunk/macosx/PiecesView.h

    r13162 r13248  
    3333    NSColor * fGreenAvailabilityColor, * fBluePieceColor;
    3434   
    35     Torrent * fTorrent;
     35    __unsafe_unretained Torrent * fTorrent;
    3636    NSInteger fNumPieces, fAcross, fWidth, fExtraBorder;
    3737}
  • trunk/macosx/PiecesView.m

    r13162 r13248  
    4949{
    5050    //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];
    5353   
    5454    //actually draw the box
     
    6060    tr_free(fPieces);
    6161   
    62     [fGreenAvailabilityColor release];
    63     [fBluePieceColor release];
    64    
    65     [super dealloc];
     62   
    6663}
    6764
     
    8885                                endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]];
    8986    [gradient drawInRect: [self bounds] angle: 90.0];
    90     [gradient release];
    9187    [back unlockFocus];
    9288   
    9389    [self setImage: back];
    94     [back release];
    9590   
    9691    [self setNeedsDisplay];
  • trunk/macosx/PortChecker.h

    r13162 r13248  
    3535@interface PortChecker : NSObject
    3636{   
    37     id fDelegate;
     37    __unsafe_unretained id fDelegate;
    3838    port_status_t fStatus;
    3939   
  • trunk/macosx/PortChecker.m

    r13162 r13248  
    5959    [fTimer invalidate];
    6060   
    61     [fConnection release];
    62     [fPortProbeData release];
    63     [super dealloc];
    6461}
    6562
     
    9693{
    9794    NSString * probeString = [[NSString alloc] initWithData: fPortProbeData encoding: NSUTF8StringEncoding];
    98     [fPortProbeData release];
    9995    fPortProbeData = nil;
    10096   
     
    110106            [self callBackWithStatus: PORT_STATUS_ERROR];
    111107        }
    112         [probeString release];
    113108    }
    114109    else
  • trunk/macosx/PredicateEditorRowTemplateAny.h

    r13162 r13248  
    2626
    2727@interface PredicateEditorRowTemplateAny : NSPredicateEditorRowTemplate
    28 {
    29 }
    3028
    3129@end
  • trunk/macosx/PrefsController.m

    r13225 r13248  
    128128        fRPCWhitelistArray = [[fDefaults arrayForKey: @"RPCWhitelist"] mutableCopy];
    129129        if (!fRPCWhitelistArray)
    130             fRPCWhitelistArray = [[NSMutableArray arrayWithObject: @"127.0.0.1"] retain];
     130            fRPCWhitelistArray = [NSMutableArray arrayWithObject: @"127.0.0.1"];
    131131        [self updateRPCWhitelist];
    132132       
     
    156156    {
    157157        [fPortChecker cancelProbe];
    158         [fPortChecker release];
    159     }
    160    
    161     [fRPCWhitelistArray release];
    162    
    163     [fRPCPassword release];
    164    
    165     [super dealloc];
     158    }
     159   
     160   
     161   
    166162}
    167163
     
    177173    [toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
    178174    [[self window] setToolbar: toolbar];
    179     [toolbar release];
    180175   
    181176    [self setPrefView: nil];
     
    312307    else
    313308    {
    314         [item release];
    315309        return nil;
    316310    }
    317311
    318     return [item autorelease];
     312    return item;
    319313}
    320314
     
    398392        {
    399393            [fPortChecker cancelProbe];
    400             [fPortChecker release];
    401394        }
    402395        BOOL delay = natStatusChanged || tr_sessionIsPortForwardingEnabled(fHandle);
     
    426419            break;
    427420    }
    428     [fPortChecker release];
    429421    fPortChecker = nil;
    430422}
     
    437429                                NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
    438430   
    439     for (NSString * directory in directories)
     431    for (__strong NSString * directory in directories)
    440432    {
    441433        directory = [directory stringByAppendingPathComponent: @"Sounds"];
     
    445437        {
    446438            NSArray * directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: directory error: NULL];
    447             for (NSString * sound in directoryContents)
     439            for (__strong NSString * sound in directoryContents)
    448440            {
    449441                sound = [sound stringByDeletingPathExtension];
     
    702694+ (NSDate *) timeSumToDate: (NSInteger) sum
    703695{
    704     NSDateComponents * comps = [[[NSDateComponents alloc] init] autorelease];
     696    NSDateComponents * comps = [[NSDateComponents alloc] init];
    705697    [comps setHour: sum / 60];
    706698    [comps setMinute: sum % 60];
     
    711703- (BOOL) control: (NSControl *) control textShouldBeginEditing: (NSText *) fieldEditor
    712704{
    713     [fInitialString release];
    714     fInitialString = [[control stringValue] retain];
     705    fInitialString = [control stringValue];
    715706   
    716707    return YES;
     
    723714    {
    724715        [control setStringValue: fInitialString];
    725         [fInitialString release];
    726716        fInitialString = nil;
    727717    }
     
    759749{
    760750    NSString * bundleID = [[NSBundle mainBundle] bundleIdentifier];
    761     const OSStatus result = LSSetDefaultHandlerForURLScheme((CFStringRef)@"magnet", (CFStringRef)bundleID);
     751    const OSStatus result = LSSetDefaultHandlerForURLScheme((CFStringRef)@"magnet", (__bridge CFStringRef)bundleID);
    762752    if (result != noErr)
    763753        NSLog(@"Failed setting default magnet link handler");
     
    983973- (void) setRPCPassword: (id) sender
    984974{
    985     [fRPCPassword release];
    986975    fRPCPassword = [[sender stringValue] copy];
    987976   
     
    999988        strlen(RPC_KEYCHAIN_NAME), RPC_KEYCHAIN_NAME, &passwordLength, (void **)&password, NULL);
    1000989   
    1001     [fRPCPassword release];
    1002990    if (password != NULL)
    1003991    {
  • trunk/macosx/PrefsWindow.h

    r13162 r13248  
    2626
    2727@interface PrefsWindow : NSWindow
    28 {
    29 }
    3028
    3129@end
  • trunk/macosx/ProgressGradients.m

    r13162 r13248  
    4141    NSGradient * progressGradient = [[NSGradient alloc] initWithColorsAndLocations: baseColor, 0.0, color2, 0.5, color3, 0.5,
    4242                                        baseColor, 1.0, nil];
    43     return [progressGradient autorelease];
     43    return progressGradient;
    4444}
    4545
  • trunk/macosx/StatsWindowController.m

    r13162 r13248  
    127127    [fTimer invalidate];
    128128   
    129     [fStatsWindowInstance autorelease];
    130129    fStatsWindowInstance = nil;
    131130}
  • trunk/macosx/StatusBarController.m

    r13162 r13248  
    9191    [[NSNotificationCenter defaultCenter] removeObserver: self];
    9292   
    93     [super dealloc];
    9493}
    9594
  • trunk/macosx/StatusBarView.m

    r13162 r13248  
    5353    [[NSNotificationCenter defaultCenter] removeObserver: self];
    5454   
    55     [fGradient release];
    56     [super dealloc];
    5755}
    5856
  • trunk/macosx/Torrent.m

    r13219 r13248  
    6363void startQueueCallback(tr_torrent * torrent, void * torrentData)
    6464{
    65     [(Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO];
     65    [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(startQueue) withObject: nil waitUntilDone: NO];
    6666}
    6767
     
    7272        NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status",
    7373                               [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];
    7575    }
    7676}
     
    7878void ratioLimitHitCallback(tr_torrent * torrent, void * torrentData)
    7979{
    80     [(Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO];
     80    [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO];
    8181}
    8282
    8383void idleLimitHitCallback(tr_torrent * torrent, void * torrentData)
    8484{
    85     [(Torrent *)torrentData performSelectorOnMainThread: @selector(idleLimitHit) withObject: nil waitUntilDone: NO];
     85    [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(idleLimitHit) withObject: nil waitUntilDone: NO];
    8686}
    8787
    8888void metadataCallback(tr_torrent * torrent, void * torrentData)
    8989{
    90     [(Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO];
     90    [(__bridge Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO];
    9191}
    9292
     
    212212    if (fFileStat)
    213213        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];
    228214}
    229215
     
    235221- (id) copyWithZone: (NSZone *) zone
    236222{
    237     return [self retain];
     223    return self;
    238224}
    239225
     
    244230    {
    245231        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
    246         [fTimeMachineExclude release];
    247232        fTimeMachineExclude = nil;
    248233    }
     
    283268- (void) setPreviousFinishedPieces: (NSIndexSet *) indexes
    284269{
    285     [fPreviousFinishedIndexes release];
    286     fPreviousFinishedIndexes = [indexes retain];
    287    
    288     [fPreviousFinishedIndexesDate release];
     270    fPreviousFinishedIndexes = indexes;
     271   
    289272    fPreviousFinishedIndexesDate = indexes != nil ? [[NSDate alloc] init] : nil;
    290273}
     
    531514       
    532515        [alert runModal];
    533         [alert release];
    534516       
    535517        return;
     
    553535       
    554536        [alert runModal];
    555         [alert release];
    556537    }
    557538   
     
    597578            if ([[alert suppressionButton] state] == NSOnState)
    598579                [fDefaults setBool: NO forKey: @"WarningRemainingSpace"];
    599             [alert release];
    600580           
    601581            return result != NSAlertFirstButtonReturn;
     
    612592    #warning replace kGenericFolderIcon stuff with NSImageNameFolder on 10.6
    613593    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]];
    616596    return fIcon;
    617597}
     
    656636        TrackerNode * tracker = [[TrackerNode alloc] initWithTrackerStat: &stats[i] torrent: self];
    657637        [trackers addObject: tracker];
    658         [tracker release];
    659638    }
    660639   
     
    15491528    {
    15501529        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
    1551         [fTimeMachineExclude release];
    15521530        fTimeMachineExclude = nil;
    15531531    }
     
    15571535    {
    15581536        [self setTimeMachineExclude: YES forPath: currentLocation];
    1559         fTimeMachineExclude = [currentLocation retain];
     1537        fTimeMachineExclude = currentLocation;
    15601538    }
    15611539}
     
    16521630        if (!fHandle)
    16531631        {
    1654             [self release];
    16551632            return nil;
    16561633        }
     
    16591636    fInfo = tr_torrentInfo(fHandle);
    16601637   
    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));
    16661643   
    16671644    fHashString = [[NSString alloc] initWithUTF8String: fInfo->hashString];
     
    16781655        name: @"GroupValueRemoved" object: nil];
    16791656   
    1680     fTimeMachineExclude = [timeMachineExclude retain];
     1657    fTimeMachineExclude = timeMachineExclude;
    16811658    [self update];
    16821659   
     
    17211698                    node = [[FileListNode alloc] initWithFolderName: name path: path torrent: self];
    17221699                    [fileList addObject: node];
    1723                     [node release];
    17241700                }
    17251701               
     
    17341710                [fileList addObject: node];
    17351711                [flatFileList addObject: node];
    1736                 [node release];
    17371712            }
    17381713        }
     
    17471722    {
    17481723        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;
    17521726    }
    17531727}
     
    17851759       
    17861760        [parent insertChild: node];
    1787         [node release];
    17881761    }
    17891762   
     
    18221795        case TR_SEED:
    18231796        case TR_PARTIAL_SEED:
     1797        {
    18241798            //simpler to create a new dictionary than to use statusInfo - avoids retention chicanery
    18251799            [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self
     
    18321806            {
    18331807                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)
    18351809                    NSLog(@"Failed to quarantine: %@", dataLocation);
    18361810            }
     
    18391813           
    18401814            break;
     1815        }
    18411816       
    18421817        case TR_LEECH:
     
    18441819            break;
    18451820    }
    1846     [statusInfo release];
    18471821   
    18481822    [self update];
     
    19191893- (void) setTimeMachineExclude: (BOOL) exclude forPath: (NSString *) path
    19201894{
    1921     CSBackupSetItemExcluded((CFURLRef)[NSURL fileURLWithPath: path], exclude, true);
     1895    CSBackupSetItemExcluded((__bridge CFURLRef)[NSURL fileURLWithPath: path], exclude, true);
    19221896}
    19231897
  • trunk/macosx/TorrentCell.m

    r13162 r13248  
    110110        [fStatusAttributes setObject: paragraphStyle forKey: NSParagraphStyleAttributeName];
    111111       
    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];
    117116    }
    118117        return self;
     
    243242        NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: rowOptions owner: controlView userInfo: rowInfo];
    244243        [controlView addTrackingArea: area];
    245         [rowInfo release];
    246         [area release];
    247244    }
    248245   
     
    261258                                userInfo: controlInfo];
    262259    [controlView addTrackingArea: area];
    263     [controlInfo release];
    264     [area release];
    265260   
    266261    //reveal button
     
    278273                                userInfo: revealInfo];
    279274    [controlView addTrackingArea: area];
    280     [revealInfo release];
    281     [area release];
    282275   
    283276    //action button
     
    294287    area = [[NSTrackingArea alloc] initWithRect: actionButtonRect options: actionOptions owner: controlView userInfo: actionInfo];
    295288    [controlView addTrackingArea: area];
    296     [actionInfo release];
    297     [area release];
    298289}
    299290
     
    361352                                    ofColor: [NSColor whiteColor]] endingColor: darkGroupColor];
    362353        [gradient drawInBezierPath: bp angle: 90.0];
    363         [gradient release];
    364354    }
    365355   
     
    694684        fraction: ([fDefaults boolForKey: @"SmallView"] ? 0.25 : 1.0) respectFlipped: YES hints: nil];
    695685
    696     [bitmap release];
    697686}
    698687
     
    829818{
    830819    NSString * title = [(Torrent *)[self representedObject] name];
    831     return [[[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease];
     820    return [[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes];
    832821}
    833822
    834823- (NSAttributedString *) attributedStatusString: (NSString *) string
    835824{
    836     return [[[NSAttributedString alloc] initWithString: string attributes: fStatusAttributes] autorelease];
     825    return [[NSAttributedString alloc] initWithString: string attributes: fStatusAttributes];
    837826}
    838827
  • trunk/macosx/TorrentGroup.m

    r13162 r13248  
    4242}
    4343
    44 - (void) dealloc
    45 {
    46     [fTorrents release];
    47     [super dealloc];
    48 }
    4944
    5045- (NSString *) description
  • trunk/macosx/TorrentTableView.m

    r13171 r13248  
    9191    [[NSNotificationCenter defaultCenter] removeObserver: self];
    9292   
    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   
    10397}
    10498
     
    392386    //if pushing a button, don't change the selected rows
    393387    if (pushed)
    394         fSelectedValues = [[self selectedValues] retain];
     388        fSelectedValues = [self selectedValues];
    395389   
    396390    [super mouseDown: event];
    397391   
    398     [fSelectedValues release];
    399392    fSelectedValues = nil;
    400393   
     
    638631        [infoViewController updateInfo];
    639632       
    640         [infoViewController release];
    641         [popover release];
    642633    }
    643634    else
    644635    {
    645636        //update file action menu
    646         fMenuTorrent = [[self itemAtRow: row] retain];
     637        fMenuTorrent = [self itemAtRow: row];
    647638       
    648639        //update global limit check
     
    656647        [fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: self];
    657648       
    658         [fMenuTorrent release];
    659649        fMenuTorrent = nil;
    660650    }
     
    695685                [item setRepresentedObject: [NSNumber numberWithInt: speedLimitActionValue[i]]];
    696686                [menu addItem: item];
    697                 [item release];
    698687            }
    699688        }
     
    724713                [item setRepresentedObject: [NSNumber numberWithFloat: ratioLimitActionValue[i]]];
    725714                [menu addItem: item];
    726                 [item release];
    727715            }
    728716        }
     
    837825- (void) togglePiecesBar
    838826{
    839     //stop previous animation
    840     if (fPiecesBarAnimation)
    841         [fPiecesBarAnimation release];
    842    
    843827    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)
    845829        [progressMarks addObject: [NSNumber numberWithFloat: i]];
    846830   
     
    857841    if (animation == fPiecesBarAnimation)
    858842    {
    859         [fPiecesBarAnimation release];
    860843        fPiecesBarAnimation = nil;
    861844    }
  • trunk/macosx/TrackerCell.m

    r13219 r13248  
    8484                                paragraphStyle, NSParagraphStyleAttributeName, nil];
    8585       
    86         [paragraphStyle release];
    8786    }
    8887    return self;
    89 }
    90 
    91 - (void) dealloc
    92 {
    93     [fNameAttributes release];
    94     [fStatusAttributes release];
    95    
    96     [super dealloc];
    97 }
    98 
    99 - (id) copyWithZone: (NSZone *) zone
    100 {
    101     TrackerCell * copy = [super copyWithZone: zone];
    102    
    103     copy->fNameAttributes = [fNameAttributes retain];
    104     copy->fStatusAttributes = [fStatusAttributes retain];
    105    
    106     return copy;
    10788}
    10889
     
    243224        {
    244225            [fTrackerIconCache setObject: icon forKey: baseAddress];
    245             [icon release];
    246226           
    247227            [[self controlView] setNeedsDisplay: YES];
     
    303283{
    304284    NSString * name = [(TrackerNode *)[self objectValue] host];
    305     return [[[NSAttributedString alloc] initWithString: name attributes: fNameAttributes] autorelease];
     285    return [[NSAttributedString alloc] initWithString: name attributes: fNameAttributes];
    306286}
    307287
    308288- (NSAttributedString *) attributedStatusWithString: (NSString *) statusString
    309289{
    310     return [[[NSAttributedString alloc] initWithString: statusString attributes: fStatusAttributes] autorelease];
     290    return [[NSAttributedString alloc] initWithString: statusString attributes: fStatusAttributes];
    311291}
    312292
     
    314294{
    315295    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];
    317297}
    318298
  • trunk/macosx/TrackerNode.h

    r13175 r13248  
    3232    tr_tracker_stat fStat;
    3333   
    34     Torrent * fTorrent;
     34    __unsafe_unretained Torrent * fTorrent;
    3535}
    3636
    37 @property (nonatomic, readonly) Torrent * torrent;
     37@property (nonatomic, readonly, assign) Torrent * torrent;
    3838
    3939- (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent;
  • trunk/macosx/TrackerNode.m

    r13175 r13248  
    2929
    3030#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)
    3132@synthesize torrent = fTorrent;
    3233
     
    3637    {
    3738        fStat = *stat;
    38         fTorrent = torrent; //weak reference
     39        #warning make __weak when 10.7-only
     40        fTorrent = torrent;
    3941    }
    4042   
     
    5052{
    5153    //this object is essentially immutable after initial setup
    52     return [self retain];
     54    return self;
    5355}
    5456
     
    113115       
    114116        dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastAnnounceTime]];
    115         [dateFormatter release];
    116117    }
    117118    else
     
    184185       
    185186        dateString = [dateFormatter stringFromDate: [NSDate dateWithTimeIntervalSince1970: fStat.lastScrapeTime]];
    186         [dateFormatter release];
    187187    }
    188188    else
  • trunk/macosx/TrackerTableView.h

    r13162 r13248  
    2929@interface TrackerTableView : NSTableView
    3030{
    31     //weak references
    32     Torrent * fTorrent;
    33     NSArray * fTrackers;
     31    __unsafe_unretained Torrent * fTorrent;
     32    __unsafe_unretained NSArray * fTrackers;
    3433}
    3534
  • trunk/macosx/URLSheetWindow.xib

    r12940 r13248  
    33        <data>
    44                <int key="IBDocument.SystemTarget">1060</int>
    5                 <string key="IBDocument.SystemVersion">11B26</string>
    6                 <string key="IBDocument.InterfaceBuilderVersion">1617</string>
    7                 <string key="IBDocument.AppKitVersion">1138</string>
    8                 <string key="IBDocument.HIToolboxVersion">566.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>
    99                <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
    1010                        <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>
    1212                </object>
    1313                <array key="IBDocument.IntegratedClassDependencies">
     
    2323                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
    2424                </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>
    2629                <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
    2730                        <object class="NSCustomObject" id="1001">
     
    4750                                <string key="NSWindowContentMinSize">{400, 177}</string>
    4851                                <object class="NSView" key="NSWindowView" id="892541411">
    49                                         <nil key="NSNextResponder"/>
     52                                        <reference key="NSNextResponder"/>
    5053                                        <int key="NSvFlags">256</int>
    5154                                        <array class="NSMutableArray" key="NSSubviews">
     
    5558                                                        <string key="NSFrame">{{20, 50}, {360, 80}}</string>
    5659                                                        <reference key="NSSuperview" ref="892541411"/>
     60                                                        <reference key="NSWindow"/>
     61                                                        <reference key="NSNextKeyView" ref="9691643"/>
    5762                                                        <bool key="NSEnabled">YES</bool>
    5863                                                        <object class="NSTextFieldCell" key="NSCell" id="139057847">
     
    9297                                                        <string key="NSFrame">{{304, 12}, {82, 32}}</string>
    9398                                                        <reference key="NSSuperview" ref="892541411"/>
     99                                                        <reference key="NSWindow"/>
     100                                                        <reference key="NSNextKeyView"/>
    94101                                                        <bool key="NSEnabled">YES</bool>
    95102                                                        <object class="NSButtonCell" key="NSCell" id="62424678">
     
    113120                                                        <string key="NSFrame">{{222, 12}, {82, 32}}</string>
    114121                                                        <reference key="NSSuperview" ref="892541411"/>
     122                                                        <reference key="NSWindow"/>
     123                                                        <reference key="NSNextKeyView" ref="794131740"/>
    115124                                                        <bool key="NSEnabled">YES</bool>
    116125                                                        <object class="NSButtonCell" key="NSCell" id="341887532">
     
    134143                                                        <string key="NSFrame">{{17, 140}, {366, 17}}</string>
    135144                                                        <reference key="NSSuperview" ref="892541411"/>
     145                                                        <reference key="NSWindow"/>
     146                                                        <reference key="NSNextKeyView" ref="1066788818"/>
    136147                                                        <bool key="NSEnabled">YES</bool>
    137148                                                        <object class="NSTextFieldCell" key="NSCell" id="830118733">
     
    160171                                        </array>
    161172                                        <string key="NSFrameSize">{400, 177}</string>
     173                                        <reference key="NSSuperview"/>
     174                                        <reference key="NSWindow"/>
     175                                        <reference key="NSNextKeyView" ref="459786882"/>
    162176                                </object>
    163177                                <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
     
    203217                                </object>
    204218                                <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">
    205227                                        <object class="IBActionConnection" key="connection">
    206228                                                <string key="label">openURLEndSheet:</string>
     
    208230                                                <reference key="destination" ref="794131740"/>
    209231                                        </object>
    210                                         <int key="connectionID">18</int>
     232                                        <int key="connectionID">23</int>
    211233                                </object>
    212234                                <object class="IBConnectionRecord">
     
    216238                                                <reference key="destination" ref="9691643"/>
    217239                                        </object>
    218                                         <int key="connectionID">19</int>
     240                                        <int key="connectionID">24</int>
    219241                                </object>
    220242                                <object class="IBConnectionRecord">
     
    225247                                        </object>
    226248                                        <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>
    235249                                </object>
    236250                        </array>
     
    355369                        <dictionary class="NSMutableDictionary" key="localizations"/>
    356370                        <nil key="sourceID"/>
    357                         <int key="maxID">22</int>
     371                        <int key="maxID">24</int>
    358372                </object>
    359373                <object class="IBClassDescriber" key="IBDocument.Classes">
     
    362376                                        <string key="className">URLSheetWindowController</string>
    363377                                        <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>
    364392                                        <dictionary class="NSMutableDictionary" key="outlets">
    365393                                                <string key="fCancelButton">NSButton</string>
     
    401429                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
    402430                        <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"/>
    404432                </object>
    405433                <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
  • trunk/macosx/URLSheetWindowController.h

    r13162 r13248  
    3333    IBOutlet NSButton * fOpenButton, * fCancelButton;
    3434   
    35     Controller * fController;
     35    __unsafe_unretained Controller * fController;
    3636}
    3737
    3838- (id) initWithController: (Controller *) controller;
    39 - (void) beginSheetForWindow: (NSWindow *) window;
    4039
    41 - (void) openURLEndSheet: (id) sender;
    42 - (void) openURLCancelEndSheet: (id) sender;
     40- (IBAction) openURLEndSheet: (id) sender;
     41- (IBAction) openURLCancelEndSheet: (id) sender;
     42
     43- (NSString *) urlString;
    4344
    4445@end
  • trunk/macosx/URLSheetWindowController.m

    r13162 r13248  
    8181}
    8282
    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
    9084{
    9185    [[self window] orderOut: sender];
     
    9387}
    9488
    95 - (void) openURLCancelEndSheet: (id) sender
     89- (IBAction) openURLCancelEndSheet: (id) sender
    9690{
    9791    [[self window] orderOut: sender];
     
    9993}
    10094
    101 - (void) sheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
     95- (NSString *) urlString
    10296{
    103     [urlString release];
    104     urlString = [[fTextField stringValue] retain];
    105     [fController urlSheetDidEnd: self url: urlString returnCode: returnCode];
     97    return [fTextField stringValue];
    10698}
    10799
Note: See TracChangeset for help on using the changeset viewer.