same as last commit, with different objects

This commit is contained in:
Mitchell Livingston 2007-07-01 18:02:10 +00:00
parent 0f4aa186d5
commit 0fd3c80c7f
3 changed files with 20 additions and 14 deletions

View File

@ -198,6 +198,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[fOverlayWindow release];
[fIPCController release];
if (fAutoImportedNames)
[fAutoImportedNames release];
if (fPendingTorrentDownloads)
[fPendingTorrentDownloads release];
@ -442,7 +443,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
selector: @selector(autoSpeedLimit) userInfo: nil repeats: YES];
//auto importing
fAutoImportedNames = [[NSMutableArray alloc] init];
[self checkAutoImportDirectory];
}
@ -2022,6 +2022,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
fAutoImportTimer = nil;
}
if (fAutoImportedNames)
[fAutoImportedNames removeAllObjects];
[self checkAutoImportDirectory];
}
@ -2040,7 +2041,11 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
//only check files that have not been checked yet
NSMutableArray * newNames = [importedNames mutableCopy];
if (fAutoImportedNames)
[newNames removeObjectsInArray: fAutoImportedNames];
else
fAutoImportedNames = [[NSMutableArray alloc] init];
[fAutoImportedNames setArray: importedNames];
NSString * file;

View File

@ -34,7 +34,6 @@
NSUserDefaults * fDefaults;
BOOL fHasLoaded;
NSToolbar * fToolbar;
IBOutlet NSView * fGeneralView, * fTransfersView, * fBandwidthView, * fNetworkView;
IBOutlet NSPopUpButton * fFolderPopUp, * fIncompleteFolderPopUp, * fImportFolderPopUp,

View File

@ -114,14 +114,14 @@
{
fHasLoaded = YES;
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
[fToolbar setDelegate: self];
[fToolbar setAllowsUserCustomization: NO];
[[self window] setToolbar: fToolbar];
[fToolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
[fToolbar setSizeMode: NSToolbarSizeModeRegular];
NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
[toolbar setDelegate: self];
[toolbar setAllowsUserCustomization: NO];
[toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
[toolbar setSizeMode: NSToolbarSizeModeRegular];
[[self window] setToolbar: toolbar];
[fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
[toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
[self setPrefView: nil];
//set download folder
@ -637,10 +637,12 @@
[window setTitle: [sender label]];
else
{
NSToolbar * toolbar = [window toolbar];
NSString * itemIdentifier = [toolbar selectedItemIdentifier];
NSEnumerator * enumerator = [[toolbar items] objectEnumerator];
NSToolbarItem * item;
NSEnumerator * enumerator = [[fToolbar items] objectEnumerator];
while ((item = [enumerator nextObject]))
if ([[item itemIdentifier] isEqualToString: [fToolbar selectedItemIdentifier]])
if ([[item itemIdentifier] isEqualToString: itemIdentifier])
{
[window setTitle: [item label]];
break;