1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-03 18:25:35 +00:00

get the mac version building...still buggy

This commit is contained in:
Mitchell Livingston 2007-06-27 23:57:02 +00:00
parent 63fce9cf06
commit 6d7f628bf2
3 changed files with 17 additions and 35 deletions

View file

@ -773,6 +773,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
//determine the next file that can be opened
NSString * torrentPath;
int canAdd;
tr_info_t info;
do
{
if ([files count] == 0) //no files left to open
@ -785,7 +786,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
torrentPath = [[files objectAtIndex: 0] retain];
[files removeObjectAtIndex: 0];
} while (tr_torrentCouldBeAdded(fLib, [torrentPath UTF8String]) != TR_OK);
} while (tr_torrentParse(fLib, [torrentPath UTF8String], NULL, &info) != TR_OK);
NSOpenPanel * panel = [NSOpenPanel openPanel];
@ -794,11 +795,9 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[panel setCanChooseFiles: NO];
[panel setCanChooseDirectories: YES];
[panel setCanCreateDirectories: YES];
#warning fix!!!
/*[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
"Open torrent -> select destination folder"),
[NSString stringWithUTF8String: tr_torrentInfo(tempTor)->name]]];*/
[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
"Open torrent -> select destination folder"), [NSString stringWithUTF8String: info.name]]];
[panel setMessage: @"Select the download folder "];
NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: torrentPath, @"Path",
@ -2019,13 +2018,9 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
//check if an import fails because of an error so it can be tried again
enumerator = [newNames objectEnumerator];
int canAdd;
while ((file = [enumerator nextObject]))
{
canAdd = tr_torrentCouldBeAdded(fLib, [file UTF8String]);
if (canAdd == TR_EINVALID || canAdd == TR_EOTHER)
if (tr_torrentParse(fLib, [file UTF8String], NULL, NULL) == TR_EINVALID)
[fAutoImportedNames removeObject: [file lastPathComponent]];
}
[newNames release];
}
@ -2149,7 +2144,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
int canAdd;
while ((file = [enumerator nextObject]))
{
canAdd = tr_torrentCouldBeAdded(fLib, [file UTF8String]);
canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
if (canAdd == TR_OK)
{
if (!fOverlayWindow)
@ -2158,7 +2153,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
return NSDragOperationCopy;
}
else if (canAdd == TR_EUNSUPPORTED || canAdd == TR_EDUPLICATE)
else if (canAdd == TR_EDUPLICATE)
torrent = YES;
else;
}
@ -2211,7 +2206,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
int canAdd;
while ((file = [enumerator nextObject]))
{
canAdd = tr_torrentCouldBeAdded(fLib, [file UTF8String]);
canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
if (canAdd == TR_OK)
{
tr_torrentClose(tempTor);
@ -2219,7 +2214,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
torrent = YES;
}
else if (canAdd == TR_EUNSUPPORTED || canAdd == TR_EDUPLICATE)
else if (canAdd == TR_EDUPLICATE)
torrent = YES;
else;
}

View file

@ -82,29 +82,21 @@
NSString * file;
NSEnumerator * enumerator = [files objectEnumerator];
tr_torrent_t * tempTor;
tr_info_t * info;
tr_info_t info;
while ((file = [enumerator nextObject]))
{
int error;
if ((tempTor = tr_torrentInit(fLib, [file UTF8String], NULL, 0, &error)))
if (tr_torrentParse(fLib, [file UTF8String], NULL, &info) == TR_OK)
{
info = tr_torrentInfo(tempTor);
count++;
size += info->totalSize;
fileCount += info->fileCount;
size += info.totalSize;
fileCount += info.fileCount;
//only useful when one torrent
if (count == 1)
{
name = [NSString stringWithUTF8String: info->name];
folder = info->multifile;
name = [NSString stringWithUTF8String: info.name];
folder = info.multifile;
}
tr_torrentClose(tempTor);
}
}
if (count <= 0)
return;

View file

@ -611,13 +611,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (void) resetCache
{
#warning look over
BOOL paused = [self isPaused];
if (!paused)
tr_torrentStop(fHandle);
tr_torrentRecheck(fHandle);
if (!paused)
tr_torrentStart(fHandle);
}
- (float) ratio
@ -1512,6 +1506,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
}
NSString * currentDownloadFolder = [self shouldUseIncompleteFolder] ? fIncompleteFolder : fDownloadFolder;
#warning give error for duplicate?
int error;
if (hashString)
fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], [currentDownloadFolder UTF8String], TR_FLAG_SAVE, & error);