Changeset 5633


Ignore:
Timestamp:
Apr 17, 2008, 4:25:49 AM (14 years ago)
Author:
livings124
Message:

the blocklist downloader should get the tr_handle from the prefs controller instead of needing it passed separately

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BlocklistDownloader.h

    r5589 r5633  
    3131{   
    3232    PrefsController * fPrefsController;
    33     tr_handle * fHandle;
    3433   
    3534    IBOutlet NSWindow * fStatusWindow;
     
    4443}
    4544
    46 + (id) downloadWithPrefsController: (PrefsController *) prefsController withHandle: (tr_handle *) handle;
     45+ (id) downloadWithPrefsController: (PrefsController *) prefsController;
    4746
    4847- (void) cancelDownload: (id) sender;
  • trunk/macosx/BlocklistDownloader.m

    r5589 r5633  
    3333@interface BlocklistDownloader (Private)
    3434
    35 - (id) initWithPrefsController: (PrefsController *) prefsController withHandle: (tr_handle *) handle;
     35- (id) initWithPrefsController: (PrefsController *) prefsController;
    3636- (void) startDownload;
    3737- (void) updateProcessString;
     
    4242@implementation BlocklistDownloader
    4343
    44 + (id) downloadWithPrefsController: (PrefsController *) prefsController withHandle: (tr_handle *) handle
     44+ (id) downloadWithPrefsController: (PrefsController *) prefsController
    4545{
    46     BlocklistDownloader * downloader = [[BlocklistDownloader alloc] initWithPrefsController: prefsController withHandle: handle];
     46    BlocklistDownloader * downloader = [[BlocklistDownloader alloc] initWithPrefsController: prefsController];
    4747    [downloader startDownload];
    4848}
     
    118118   
    119119    //process data
    120     tr_blocklistSetContent(fHandle, [DESTINATION UTF8String]);
     120    tr_blocklistSetContent([fPrefsController handle], [DESTINATION UTF8String]);
    121121   
    122122    //delete downloaded file
     
    137137@implementation BlocklistDownloader (Private)
    138138
    139 - (id) initWithPrefsController: (PrefsController *) prefsController withHandle: (tr_handle *) handle
     139- (id) initWithPrefsController: (PrefsController *) prefsController
    140140{
    141141    if ((self = [super init]))
    142142    {
    143143        fPrefsController = prefsController;
    144         fHandle = handle;
    145144    }
    146145   
  • trunk/macosx/PrefsController.h

    r5529 r5633  
    6060
    6161- (id) initWithHandle: (tr_handle *) handle;
     62- (tr_handle *) handle;
    6263- (void) setUpdater: (SUUpdater *) updater;
    6364
  • trunk/macosx/PrefsController.m

    r5630 r5633  
    9999}
    100100
     101- (tr_handle *) handle
     102{
     103    return fHandle;
     104}
     105
    101106- (void) dealloc
    102107{
     
    375380- (void) updateBlocklist: (id) sender
    376381{
    377     [BlocklistDownloader downloadWithPrefsController: self withHandle: fHandle];
     382    [BlocklistDownloader downloadWithPrefsController: self];
    378383}
    379384
  • trunk/macosx/Torrent.m

    r5630 r5633  
    387387    if ((stopRatio = [self actualStopRatio]) == INVALID || (ratio = [self ratio]) >= stopRatio)
    388388        return 1.0;
    389     else if (ratio > 0 && stopRatio > 0)
     389    else if (stopRatio > 0)
    390390        return ratio / stopRatio;
    391391    else
Note: See TracChangeset for help on using the changeset viewer.