Changeset 13256


Ignore:
Timestamp:
Mar 18, 2012, 2:33:50 PM (9 years ago)
Author:
livings124
Message:

#4839 Use configuration directory retrieved from libtransmission

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r13254 r13256  
    6262    NSUserDefaults                  * fDefaults;
    6363   
     64    NSString                        * fConfigDirectory;
     65   
    6466    IBOutlet NSWindow               * fWindow;
    6567    DragOverlayWindow               * fOverlayWindow;
  • trunk/macosx/Controller.m

    r13255 r13256  
    325325        tr_bencFree(&settings);
    326326       
     327        fConfigDirectory = [[NSString alloc] initWithUTF8String: configDir];
     328       
    327329        [NSApp setDelegate: self];
    328330       
     
    445447   
    446448    //load previous transfers
    447     NSURL * historyURL = [[[[[NSFileManager defaultManager] URLsForDirectory: NSApplicationSupportDirectory inDomains: NSUserDomainMask] objectAtIndex: 0] URLByAppendingPathComponent: @"Transmission"] URLByAppendingPathComponent: TRANSFER_PLIST];
    448     NSArray * history = [NSArray arrayWithContentsOfURL: historyURL];
     449    NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST];
     450    NSArray * history = [NSArray arrayWithContentsOfFile: historyFile];
    449451    if (!history)
    450452    {
     
    724726   
    725727    [fPreviewPanel release];
     728   
     729    [fConfigDirectory release];
    726730   
    727731    //complete cleanup
     
    19041908        [history addObject: [torrent history]];
    19051909   
    1906     NSURL * historyURL = [[[[[NSFileManager defaultManager] URLsForDirectory: NSApplicationSupportDirectory inDomains: NSUserDomainMask] objectAtIndex: 0] URLByAppendingPathComponent: @"Transmission"] URLByAppendingPathComponent: TRANSFER_PLIST];
    1907     [history writeToURL: historyURL atomically: YES];
     1910    NSString * historyFile = [fConfigDirectory stringByAppendingPathComponent: TRANSFER_PLIST];
     1911    [history writeToFile: historyFile atomically: YES];
    19081912}
    19091913
Note: See TracChangeset for help on using the changeset viewer.