From ec00579ea7e06cf4ffdab00a750014f39e6cb89c Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 22 Dec 2007 18:43:40 +0000 Subject: [PATCH] remove ctor from torrent creation and parse functions --- macosx/Controller.m | 10 +++++----- macosx/DragOverlayWindow.m | 2 +- macosx/Torrent.m | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 05a83677f..3a2872143 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -741,7 +741,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi tr_ctor * ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]); - if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_EDUPLICATE) + if (tr_torrentParse(fLib, ctor, &info) == TR_EDUPLICATE) { [self duplicateOpenAlert: [NSString stringWithUTF8String: info.name]]; tr_metainfoFree(&info); @@ -816,7 +816,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [torrentPath UTF8String]); - canAdd = tr_torrentParseFromCtor(fLib, ctor, &info); + canAdd = tr_torrentParse(fLib, ctor, &info); tr_ctorFree(ctor); if (canAdd == TR_OK) @@ -2336,7 +2336,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]); - switch (tr_torrentParseFromCtor(fLib, ctor, NULL)) + switch (tr_torrentParse(fLib, ctor, NULL)) { case TR_OK: if (!ask) @@ -2498,7 +2498,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi { ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]); - switch (tr_torrentParseFromCtor(fLib, ctor, NULL)) + switch (tr_torrentParse(fLib, ctor, NULL)) { case TR_OK: if (!fOverlayWindow) @@ -2565,7 +2565,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi { ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]); - switch (tr_torrentParseFromCtor(fLib, ctor, NULL)) + switch (tr_torrentParse(fLib, ctor, NULL)) { case TR_OK: [filesToOpen addObject: file]; diff --git a/macosx/DragOverlayWindow.m b/macosx/DragOverlayWindow.m index 13e698ece..6f0c520f9 100644 --- a/macosx/DragOverlayWindow.m +++ b/macosx/DragOverlayWindow.m @@ -90,7 +90,7 @@ { ctor = tr_ctorNew(fLib); tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]); - if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_OK) + if (tr_torrentParse(fLib, ctor, &info) == TR_OK) { count++; size += info.totalSize; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 73239503b..def1dc3f9 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1487,10 +1487,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * if (hashString) { tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]); - if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_OK) + if (tr_torrentParse(fLib, ctor, &info) == TR_OK) { NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] - ? fIncompleteFolder : fDownloadFolder; + ? fIncompleteFolder : fDownloadFolder; tr_ctorSetDestination(ctor, TR_FORCE, [currentDownloadFolder UTF8String]); fHandle = tr_torrentNew(fLib, ctor, &error); @@ -1500,10 +1500,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * if (!fHandle && path) { tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]); - if (tr_torrentParseFromCtor(fLib, ctor, &info) == TR_OK) + if (tr_torrentParse(fLib, ctor, &info) == TR_OK) { NSString * currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] - ? fIncompleteFolder : fDownloadFolder; + ? fIncompleteFolder : fDownloadFolder; tr_ctorSetDestination(ctor, TR_FORCE, [currentDownloadFolder UTF8String]); fHandle = tr_torrentNew(fLib, ctor, &error);