mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
Use a mutable array for autoimport.
This commit is contained in:
parent
056b9c43c2
commit
3357a5bac6
2 changed files with 7 additions and 10 deletions
|
@ -75,7 +75,7 @@
|
|||
NSTimer * fTimer;
|
||||
|
||||
NSTimer * fAutoImportTimer;
|
||||
NSArray * fAutoImportedNames;
|
||||
NSMutableArray * fAutoImportedNames;
|
||||
|
||||
BOOL fHasGrowl, fUpdateInProgress;
|
||||
Badger * fBadger;
|
||||
|
@ -125,7 +125,7 @@
|
|||
- (void) updateTorrentHistory;
|
||||
|
||||
- (void) sortTorrents;
|
||||
- (void) sortTorrentsRememberSelected: (BOOL) changeSelected;
|
||||
- (void) sortTorrentsRememberSelected: (BOOL) rememberSelected;
|
||||
- (void) setSort: (id) sender;
|
||||
- (void) applyFilter;
|
||||
- (void) setFilter: (id) sender;
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue