Changeset 544


Ignore:
Timestamp:
Jul 7, 2006, 9:58:17 PM (16 years ago)
Author:
livings124
Message:

If there was no change in the directory don't even attempt to check files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r542 r544  
    11491149    NSString * path = [[fDefaults stringForKey: @"AutoImportDirectory"] stringByExpandingTildeInPath];
    11501150   
    1151     //if folder cannot be found simply give up
    1152     NSArray * allFileNames;
    1153     if (!(allFileNames = [[NSFileManager defaultManager] directoryContentsAtPath: path]))
     1151    //if folder cannot be found or the contents hasn't changed simply give up
     1152    NSArray * allFileNames;NSLog(@"first");
     1153    if (!(allFileNames = [[NSFileManager defaultManager] directoryContentsAtPath: path])
     1154            || [allFileNames isEqualToArray: fAutoImportedNames])
    11541155        return;
    1155 
     1156NSLog(@"here!");
    11561157    //try to add files that haven't already been added
    11571158    NSMutableArray * newFileNames = [NSMutableArray arrayWithArray: allFileNames];
     
    13651366    NSToolbarItem * item = [[NSToolbarItem alloc] initWithItemIdentifier: ident];
    13661367
    1367     if( [ident isEqualToString: TOOLBAR_OPEN] )
     1368    if ([ident isEqualToString: TOOLBAR_OPEN])
    13681369    {
    13691370        [item setLabel: @"Open"];
     
    13721373        [item setImage: [NSImage imageNamed: @"Open.png"]];
    13731374        [item setTarget: self];
    1374         [item setAction: @selector( openShowSheet: )];
    1375     }
    1376     else if( [ident isEqualToString: TOOLBAR_REMOVE] )
     1375        [item setAction: @selector(openShowSheet:)];
     1376    }
     1377    else if ([ident isEqualToString: TOOLBAR_REMOVE])
    13771378    {
    13781379        [item setLabel: @"Remove"];
     
    13811382        [item setImage: [NSImage imageNamed: @"Remove.png"]];
    13821383        [item setTarget: self];
    1383         [item setAction: @selector( removeNoDelete: )];
    1384     }
    1385     else if( [ident isEqualToString: TOOLBAR_INFO] )
     1384        [item setAction: @selector(removeNoDelete:)];
     1385    }
     1386    else if ([ident isEqualToString: TOOLBAR_INFO])
    13861387    {
    13871388        [item setLabel: @"Inspector"];
     
    13901391        [item setImage: [NSImage imageNamed: @"Info.png"]];
    13911392        [item setTarget: self];
    1392         [item setAction: @selector( showInfo: )];
    1393     }
    1394     else if( [ident isEqualToString: TOOLBAR_PAUSE_ALL] )
     1393        [item setAction: @selector(showInfo:)];
     1394    }
     1395    else if ([ident isEqualToString: TOOLBAR_PAUSE_ALL])
    13951396    {
    13961397        [item setLabel: @"Pause All"];
     
    13991400        [item setImage: [NSImage imageNamed: @"PauseAll.png"]];
    14001401        [item setTarget: self];
    1401         [item setAction: @selector( stopAllTorrents: )];
    1402     }
    1403     else if( [ident isEqualToString: TOOLBAR_RESUME_ALL] )
     1402        [item setAction: @selector(stopAllTorrents:)];
     1403    }
     1404    else if ([ident isEqualToString: TOOLBAR_RESUME_ALL])
    14041405    {
    14051406        [item setLabel: @"Resume All"];
     
    14081409        [item setImage: [NSImage imageNamed: @"ResumeAll.png"]];
    14091410        [item setTarget: self];
    1410         [item setAction: @selector( resumeAllTorrents: )];
    1411     }
    1412     else if( [ident isEqualToString: TOOLBAR_PAUSE_SELECTED] )
     1411        [item setAction: @selector(resumeAllTorrents:)];
     1412    }
     1413    else if ([ident isEqualToString: TOOLBAR_PAUSE_SELECTED])
    14131414    {
    14141415        [item setLabel: @"Pause"];
     
    14171418        [item setImage: [NSImage imageNamed: @"PauseSelected.png"]];
    14181419        [item setTarget: self];
    1419         [item setAction: @selector( stopTorrent: )];
    1420     }
    1421     else if( [ident isEqualToString: TOOLBAR_RESUME_SELECTED] )
     1420        [item setAction: @selector(stopTorrent:)];
     1421    }
     1422    else if ([ident isEqualToString: TOOLBAR_RESUME_SELECTED])
    14221423    {
    14231424        [item setLabel: @"Resume"];
     
    14261427        [item setImage: [NSImage imageNamed: @"ResumeSelected.png"]];
    14271428        [item setTarget: self];
    1428         [item setAction: @selector( resumeTorrent: )];
     1429        [item setAction: @selector(resumeTorrent:)];
    14291430    }
    14301431    else
     
    17221723}
    17231724
    1724 - (NSRect) windowWillUseStandardFrame: (NSWindow *) w defaultFrame: (NSRect) defaultFrame
     1725- (NSRect) windowWillUseStandardFrame: (NSWindow *) window defaultFrame: (NSRect) defaultFrame
    17251726{
    17261727    NSRect windowRect = [fWindow frame];
Note: See TracChangeset for help on using the changeset viewer.