Use a mutable array for autoimport.

This commit is contained in:
Mitchell Livingston
2006-07-13 11:30:38 +00:00
parent 056b9c43c2
commit 3357a5bac6
2 changed files with 7 additions and 10 deletions

View File

@@ -282,7 +282,7 @@ static void sleepCallBack(void * controller, io_service_t y,
[[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
//timer for auto import, will check every 15 seconds
fAutoImportedNames = [[NSArray alloc] init];
fAutoImportedNames = [[NSMutableArray alloc] init];
[self checkAutoImportDirectory: nil];
fAutoImportTimer = [NSTimer scheduledTimerWithTimeInterval: 15.0 target: self
@@ -858,11 +858,11 @@ static void sleepCallBack(void * controller, io_service_t y,
[self sortTorrentsRememberSelected: YES];
}
- (void) sortTorrentsRememberSelected: (BOOL) changeSelected
- (void) sortTorrentsRememberSelected: (BOOL) rememberSelected
{
//remember selected rows if needed
NSArray * selectedTorrents = nil;
if (changeSelected)
if (rememberSelected)
{
int numSelected = [fTableView numberOfSelectedRows];
if (numSelected > 0 && numSelected < [fFilteredTorrents count])
@@ -1295,8 +1295,7 @@ static void sleepCallBack(void * controller, io_service_t y,
[newFileNames removeObjectsInArray: fAutoImportedNames];
//save the current list of files
[fAutoImportedNames release];
fAutoImportedNames = [allFileNames retain];
[fAutoImportedNames setArray: allFileNames];
NSEnumerator * enumerator = [newFileNames objectEnumerator];
NSString * file;
@@ -1316,9 +1315,7 @@ static void sleepCallBack(void * controller, io_service_t y,
- (void) autoImportChange: (NSNotification *) notification
{
[fAutoImportedNames release];
fAutoImportedNames = [[NSArray alloc] init];
[fAutoImportedNames removeAllObjects];
[self checkAutoImportDirectory: nil];
}