Changeset 4274
- Timestamp:
- Dec 22, 2007, 3:13:54 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.m
r4229 r4274 1467 1467 } 1468 1468 1469 NSString * currentDownloadFolder; 1469 //set libT settings 1470 tr_ctor * ctor = tr_ctorNew(fLib); 1471 tr_ctorSetPaused(ctor, TR_FORCE, YES); 1472 1470 1473 tr_info info; 1471 1474 int error; 1472 1475 if (hashString) 1473 1476 { 1474 if (tr_torrentParseHash(fLib, [hashString UTF8String], NULL, &info) == TR_OK) 1477 tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]); 1478 if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_OK) 1475 1479 { 1476 currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]1480 NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] 1477 1481 ? fIncompleteFolder : fDownloadFolder; 1478 fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], [currentDownloadFolder UTF8String], YES, &error); 1482 tr_ctorSetDestination(ctor, TR_FORCE, [currentDownloadFolder UTF8String]); 1483 1484 fHandle = tr_torrentNew(fLib, ctor, &error); 1479 1485 } 1480 1486 tr_metainfoFree(&info); … … 1482 1488 if (!fHandle && path) 1483 1489 { 1484 if (tr_torrentParse(fLib, [path UTF8String], NULL, &info) == TR_OK) 1490 tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]); 1491 if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_OK) 1485 1492 { 1486 currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]]1493 NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] 1487 1494 ? fIncompleteFolder : fDownloadFolder; 1488 fHandle = tr_torrentInit(fLib, [path UTF8String], [currentDownloadFolder UTF8String], YES, &error); 1495 tr_ctorSetDestination(ctor, TR_FORCE, [currentDownloadFolder UTF8String]); 1496 1497 fHandle = tr_torrentNew(fLib, ctor, &error); 1489 1498 } 1490 1499 tr_metainfoFree(&info); 1491 1500 } 1501 tr_ctorFree(ctor); 1502 1492 1503 if (!fHandle) 1493 1504 {
Note: See TracChangeset
for help on using the changeset viewer.