Changeset 1048 for trunk/macosx/Controller.m
- Timestamp:
- Oct 31, 2006, 9:21:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r1047 r1048 510 510 NSString * torrentPath; 511 511 Torrent * torrent; 512 513 //determine next file that can be opened 512 514 do 513 515 { … … 1570 1572 if ([[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame) 1571 1573 { 1572 int error; 1573 tr_torrent_t * tempTor = tr_torrentInit(fLib, [[path stringByAppendingPathComponent: file] UTF8String], 1574 0, & error); 1574 int count = [fTorrents count]; 1575 [self openFiles: [NSArray arrayWithObject: [path stringByAppendingPathComponent: file]]]; 1575 1576 1576 if (tempTor) 1577 //check if torrent was opened 1578 if ([fTorrents count] > count) 1577 1579 { 1578 tr_torrentClose(fLib, tempTor); 1580 [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Torrent File Auto Added", 1581 "Growl notification title") description: file 1582 notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil]; 1583 } 1584 else 1585 { 1586 //create a temporary torrent to check if it didn't import because of error 1587 int error; 1588 tr_torrent_t * tempTor = tr_torrentInit(fLib, [[path stringByAppendingPathComponent: file] UTF8String], 1589 0, & error); 1579 1590 1580 int count = [fTorrents count]; 1581 [self openFiles: [NSArray arrayWithObject: [path stringByAppendingPathComponent: file]]]; 1582 1583 //check if torrent was opened 1584 if ([fTorrents count] > count) 1585 { 1586 [GrowlApplicationBridge notifyWithTitle: NSLocalizedString(@"Torrent File Auto Added", 1587 "Growl notification title") description: file 1588 notificationName: GROWL_AUTO_ADD iconData: nil priority: 0 isSticky: NO clickContext: nil]; 1589 } 1591 if (tempTor) 1592 tr_torrentClose(fLib, tempTor); 1593 else if (error != TR_EUNSUPPORTED && error != TR_EDUPLICATE) 1594 [fAutoImportedNames removeObjectIdenticalTo: file]; //can try to import later 1595 else; 1590 1596 } 1591 else if (error != TR_EUNSUPPORTED && error != TR_EDUPLICATE)1592 [fAutoImportedNames removeObjectIdenticalTo: file]; //failed to import for unknown reason, so try again later1593 else;1594 1597 } 1595 1598 }
Note: See TracChangeset
for help on using the changeset viewer.