mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
use a mutable array
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
BOOL fUpdateInProgress;
|
||||
Badger * fBadger;
|
||||
|
||||
NSArray * fAutoImportedNames;
|
||||
NSMutableArray * fAutoImportedNames;
|
||||
}
|
||||
|
||||
- (void) openFiles: (NSArray *) filenames;
|
||||
|
||||
@@ -113,8 +113,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||
[fSortType release];
|
||||
[fFilterType release];
|
||||
|
||||
if (fAutoImportedNames)
|
||||
[fAutoImportedNames release];
|
||||
[fAutoImportedNames release];
|
||||
|
||||
tr_close(fLib);
|
||||
[super dealloc];
|
||||
@@ -1563,11 +1562,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||
|
||||
- (void) changeAutoImport
|
||||
{
|
||||
if (fAutoImportedNames)
|
||||
{
|
||||
[fAutoImportedNames release];
|
||||
fAutoImportedNames = nil;
|
||||
}
|
||||
[fAutoImportedNames removeAllObjects];
|
||||
|
||||
if ([fDefaults boolForKey: @"AutoImport"])
|
||||
[self checkAutoImportDirectory];
|
||||
@@ -1587,9 +1582,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||
//only import those that have not been imported yet
|
||||
NSMutableArray * newNames = [importedNames mutableCopy];
|
||||
[newNames removeObjectsInArray: fAutoImportedNames];
|
||||
if (fAutoImportedNames)
|
||||
[fAutoImportedNames release];
|
||||
fAutoImportedNames = [importedNames retain];
|
||||
[fAutoImportedNames addObjectsFromArray: newNames];
|
||||
|
||||
NSEnumerator * enumerator = [newNames objectEnumerator];
|
||||
NSString * file;
|
||||
|
||||
Reference in New Issue
Block a user