From 6c7a16397ebc85a8f28091c12fa4c5d9ed0b6876 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 29 Jun 2007 04:38:33 +0000 Subject: [PATCH] make sure all history items are actually saved, and don't start all transfers at app launch --- macosx/Torrent.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index deaf2a637..a395cd896 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -138,12 +138,12 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 - (NSDictionary *) history { + #warning not all being stored NSMutableDictionary * history = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool: fPublicTorrent], @"PublicCopy", [self hashString], @"TorrentHash", fDownloadFolder, @"DownloadFolder", [NSNumber numberWithBool: fUseIncompleteFolder], @"UseIncompleteFolder", - fIncompleteFolder, @"IncompleteFolder", [NSNumber numberWithBool: [self isActive]], @"Active", fDateAdded, @"Date", [NSNumber numberWithInt: fRatioSetting], @"RatioSetting", @@ -156,6 +156,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 [self orderValue], @"OrderValue", nil]; + if (fIncompleteFolder) + [history setObject: fIncompleteFolder forKey: @"IncompleteFolder"]; + //set file should download int fileCount = [self fileCount]; NSMutableArray * filesShouldDownload = [NSMutableArray arrayWithCapacity: fileCount]; @@ -1506,7 +1509,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 { currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] ? fIncompleteFolder : fDownloadFolder; - fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], [currentDownloadFolder UTF8String], TR_FLAG_SAVE, &error); + fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], [currentDownloadFolder UTF8String], + TR_FLAG_SAVE | TR_FLAG_PAUSED, &error); } tr_metainfoFree(&info); } @@ -1516,7 +1520,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 { currentDownloadFolder = [self shouldUseIncompleteFolderForName: [NSString stringWithUTF8String: info.name]] ? fIncompleteFolder : fDownloadFolder; - fHandle = tr_torrentInit(fLib, [path UTF8String], [currentDownloadFolder UTF8String], TR_FLAG_SAVE, &error); + fHandle = tr_torrentInit(fLib, [path UTF8String], [currentDownloadFolder UTF8String], + TR_FLAG_SAVE | TR_FLAG_PAUSED, &error); } tr_metainfoFree(&info); }