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:
parent
63fce9cf06
commit
6d7f628bf2
3 changed files with 17 additions and 35 deletions
|
@ -773,6 +773,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
//determine the next file that can be opened
|
//determine the next file that can be opened
|
||||||
NSString * torrentPath;
|
NSString * torrentPath;
|
||||||
int canAdd;
|
int canAdd;
|
||||||
|
tr_info_t info;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ([files count] == 0) //no files left to open
|
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];
|
torrentPath = [[files objectAtIndex: 0] retain];
|
||||||
[files removeObjectAtIndex: 0];
|
[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];
|
NSOpenPanel * panel = [NSOpenPanel openPanel];
|
||||||
|
|
||||||
|
@ -794,11 +795,9 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
[panel setCanChooseFiles: NO];
|
[panel setCanChooseFiles: NO];
|
||||||
[panel setCanChooseDirectories: YES];
|
[panel setCanChooseDirectories: YES];
|
||||||
[panel setCanCreateDirectories: YES];
|
[panel setCanCreateDirectories: YES];
|
||||||
|
|
||||||
#warning fix!!!
|
[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
|
||||||
/*[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the download folder for \"%@\"",
|
"Open torrent -> select destination folder"), [NSString stringWithUTF8String: info.name]]];
|
||||||
"Open torrent -> select destination folder"),
|
|
||||||
[NSString stringWithUTF8String: tr_torrentInfo(tempTor)->name]]];*/
|
|
||||||
[panel setMessage: @"Select the download folder "];
|
[panel setMessage: @"Select the download folder "];
|
||||||
|
|
||||||
NSDictionary * dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: torrentPath, @"Path",
|
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
|
//check if an import fails because of an error so it can be tried again
|
||||||
enumerator = [newNames objectEnumerator];
|
enumerator = [newNames objectEnumerator];
|
||||||
int canAdd;
|
|
||||||
while ((file = [enumerator nextObject]))
|
while ((file = [enumerator nextObject]))
|
||||||
{
|
if (tr_torrentParse(fLib, [file UTF8String], NULL, NULL) == TR_EINVALID)
|
||||||
canAdd = tr_torrentCouldBeAdded(fLib, [file UTF8String]);
|
|
||||||
if (canAdd == TR_EINVALID || canAdd == TR_EOTHER)
|
|
||||||
[fAutoImportedNames removeObject: [file lastPathComponent]];
|
[fAutoImportedNames removeObject: [file lastPathComponent]];
|
||||||
}
|
|
||||||
|
|
||||||
[newNames release];
|
[newNames release];
|
||||||
}
|
}
|
||||||
|
@ -2149,7 +2144,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
int canAdd;
|
int canAdd;
|
||||||
while ((file = [enumerator nextObject]))
|
while ((file = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
canAdd = tr_torrentCouldBeAdded(fLib, [file UTF8String]);
|
canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
|
||||||
if (canAdd == TR_OK)
|
if (canAdd == TR_OK)
|
||||||
{
|
{
|
||||||
if (!fOverlayWindow)
|
if (!fOverlayWindow)
|
||||||
|
@ -2158,7 +2153,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
|
|
||||||
return NSDragOperationCopy;
|
return NSDragOperationCopy;
|
||||||
}
|
}
|
||||||
else if (canAdd == TR_EUNSUPPORTED || canAdd == TR_EDUPLICATE)
|
else if (canAdd == TR_EDUPLICATE)
|
||||||
torrent = YES;
|
torrent = YES;
|
||||||
else;
|
else;
|
||||||
}
|
}
|
||||||
|
@ -2211,7 +2206,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
int canAdd;
|
int canAdd;
|
||||||
while ((file = [enumerator nextObject]))
|
while ((file = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
canAdd = tr_torrentCouldBeAdded(fLib, [file UTF8String]);
|
canAdd = tr_torrentParse(fLib, [file UTF8String], NULL, NULL);
|
||||||
if (canAdd == TR_OK)
|
if (canAdd == TR_OK)
|
||||||
{
|
{
|
||||||
tr_torrentClose(tempTor);
|
tr_torrentClose(tempTor);
|
||||||
|
@ -2219,7 +2214,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
|
|
||||||
torrent = YES;
|
torrent = YES;
|
||||||
}
|
}
|
||||||
else if (canAdd == TR_EUNSUPPORTED || canAdd == TR_EDUPLICATE)
|
else if (canAdd == TR_EDUPLICATE)
|
||||||
torrent = YES;
|
torrent = YES;
|
||||||
else;
|
else;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,29 +82,21 @@
|
||||||
|
|
||||||
NSString * file;
|
NSString * file;
|
||||||
NSEnumerator * enumerator = [files objectEnumerator];
|
NSEnumerator * enumerator = [files objectEnumerator];
|
||||||
tr_torrent_t * tempTor;
|
tr_info_t info;
|
||||||
tr_info_t * info;
|
|
||||||
while ((file = [enumerator nextObject]))
|
while ((file = [enumerator nextObject]))
|
||||||
{
|
if (tr_torrentParse(fLib, [file UTF8String], NULL, &info) == TR_OK)
|
||||||
int error;
|
|
||||||
if ((tempTor = tr_torrentInit(fLib, [file UTF8String], NULL, 0, &error)))
|
|
||||||
{
|
{
|
||||||
info = tr_torrentInfo(tempTor);
|
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
size += info->totalSize;
|
size += info.totalSize;
|
||||||
fileCount += info->fileCount;
|
fileCount += info.fileCount;
|
||||||
|
|
||||||
//only useful when one torrent
|
//only useful when one torrent
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
name = [NSString stringWithUTF8String: info->name];
|
name = [NSString stringWithUTF8String: info.name];
|
||||||
folder = info->multifile;
|
folder = info.multifile;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr_torrentClose(tempTor);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -611,13 +611,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
- (void) resetCache
|
- (void) resetCache
|
||||||
{
|
{
|
||||||
#warning look over
|
#warning look over
|
||||||
BOOL paused = [self isPaused];
|
|
||||||
|
|
||||||
if (!paused)
|
|
||||||
tr_torrentStop(fHandle);
|
|
||||||
tr_torrentRecheck(fHandle);
|
tr_torrentRecheck(fHandle);
|
||||||
if (!paused)
|
|
||||||
tr_torrentStart(fHandle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (float) ratio
|
- (float) ratio
|
||||||
|
@ -1512,6 +1506,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
}
|
}
|
||||||
NSString * currentDownloadFolder = [self shouldUseIncompleteFolder] ? fIncompleteFolder : fDownloadFolder;
|
NSString * currentDownloadFolder = [self shouldUseIncompleteFolder] ? fIncompleteFolder : fDownloadFolder;
|
||||||
|
|
||||||
|
#warning give error for duplicate?
|
||||||
int error;
|
int error;
|
||||||
if (hashString)
|
if (hashString)
|
||||||
fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], [currentDownloadFolder UTF8String], TR_FLAG_SAVE, & error);
|
fHandle = tr_torrentInitSaved(fLib, [hashString UTF8String], [currentDownloadFolder UTF8String], TR_FLAG_SAVE, & error);
|
||||||
|
|
Loading…
Reference in a new issue