Changeset 13326


Ignore:
Timestamp:
May 29, 2012, 1:03:21 AM (9 years ago)
Author:
livings124
Message:

session_handle does not need to be a global variable in the prefs controller

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BlocklistDownloader.m

    r13253 r13326  
    2626#import "BlocklistDownloaderViewController.h"
    2727#import "BlocklistScheduler.h"
    28 #import "PrefsController.h"
     28#import "Controller.h"
    2929
    3030@interface BlocklistDownloader (Private)
     
    144144       
    145145        dispatch_async(dispatch_get_main_queue(), ^{
    146             const int count = tr_blocklistSetContent([PrefsController handle], [fDestination UTF8String]);
     146            const int count = tr_blocklistSetContent([(Controller *)[NSApp delegate] sessionHandle], [fDestination UTF8String]);
    147147           
    148148            //delete downloaded file
  • trunk/macosx/Controller.m

    r13321 r13326  
    342342        fInfoController = [[InfoWindowController alloc] init];
    343343       
    344         [PrefsController setHandle: fLib];
    345         fPrefsController = [[PrefsController alloc] init];
     344        fPrefsController = [[PrefsController alloc] initWithHandle: fLib];
    346345       
    347346        fQuitting = NO;
  • trunk/macosx/PrefsController.h

    r13162 r13326  
    3030@interface PrefsController : NSWindowController <NSToolbarDelegate>
    3131{
     32    tr_session * fHandle;
    3233    NSUserDefaults * fDefaults;
    3334    BOOL fHasLoaded;
     
    6869}
    6970
    70 + (void) setHandle: (tr_session *) handle;
    71 + (tr_session *) handle;
     71- (id) initWithHandle: (tr_session *) handle;
    7272
    7373- (void) setAutoUpdateToBeta: (id) sender;
  • trunk/macosx/PrefsController.m

    r13325 r13326  
    6767@implementation PrefsController
    6868
    69 #warning just call method in Controller?
    70 tr_session * fHandle;
    71 + (void) setHandle: (tr_session *) handle
    72 {
    73     fHandle = handle;
    74 }
    75 
    76 #warning elliminate?
    77 + (tr_session *) handle
    78 {
    79     return fHandle;
    80 }
    81 
    82 - (id) init
     69- (id) initWithHandle: (tr_session *) handle
    8370{
    8471    if ((self = [super initWithWindowNibName: @"PrefsWindow"]))
    8572    {
     73        fHandle = handle;
     74       
    8675        fDefaults = [NSUserDefaults standardUserDefaults];
    8776       
Note: See TracChangeset for help on using the changeset viewer.