Changeset 1012 for trunk/macosx/Controller.m
- Timestamp:
- Oct 16, 2006, 2:35:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r1009 r1012 114 114 [fFilterType release]; 115 115 116 if (fAutoImportedNames) 117 [fAutoImportedNames release]; 118 116 119 tr_close(fLib); 117 120 [super dealloc]; … … 321 324 name: @"AutoSpeedLimitChange" object: nil]; 322 325 323 [nc addObserver: self selector: @selector(ch eckAutoImportDirectory)326 [nc addObserver: self selector: @selector(changeAutoImport) 324 327 name: @"AutoImportSettingChange" object: nil]; 325 328 … … 1559 1562 } 1560 1563 1564 - (void) changeAutoImport 1565 { 1566 if (fAutoImportedNames) 1567 { 1568 [fAutoImportedNames release]; 1569 fAutoImportedNames = nil; 1570 } 1571 1572 if ([fDefaults boolForKey: @"AutoImport"]) 1573 [self checkAutoImportDirectory]; 1574 } 1575 1561 1576 - (void) checkAutoImportDirectory 1562 1577 { … … 1570 1585 return; 1571 1586 1572 NSEnumerator * enumerator = [importedNames objectEnumerator]; 1587 //only import those that have not been imported yet 1588 NSMutableArray * newNames = [importedNames mutableCopy]; 1589 [newNames removeObjectsInArray: fAutoImportedNames]; 1590 if (fAutoImportedNames) 1591 [fAutoImportedNames release]; 1592 fAutoImportedNames = [importedNames retain]; 1593 1594 NSEnumerator * enumerator = [newNames objectEnumerator]; 1573 1595 NSString * file; 1574 1596 unsigned oldCount; 1575 1597 while ((file = [enumerator nextObject])) 1598 { 1576 1599 if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame) 1577 1600 { … … 1584 1607 notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil]; 1585 1608 } 1609 } 1610 1611 [newNames release]; 1586 1612 } 1587 1613
Note: See TracChangeset
for help on using the changeset viewer.