1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

potentially (hopefully) fix bug where some users couldn't add torrents

This commit is contained in:
Mitchell Livingston 2009-06-10 22:56:24 +00:00
parent 11f8f93cfa
commit 6fd6b4b5b0
3 changed files with 9 additions and 5 deletions

View file

@ -2456,7 +2456,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
NSString * fullFile = [path stringByAppendingPathComponent: file];
if (![[[NSWorkspace sharedWorkspace] typeOfFile: fullFile error: NULL] isEqualToString: @"org.bittorrent.torrent"])
if (![[[NSWorkspace sharedWorkspace] typeOfFile: fullFile error: NULL] isEqualToString: @"org.bittorrent.torrent"]
|| [[fullFile pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
continue;
tr_ctor * ctor = tr_ctorNew(fLib);
@ -2698,7 +2699,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
NSArray * files = [pasteboard propertyListForType: NSFilenamesPboardType];
for (NSString * file in files)
{
if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"])
if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"]
|| [[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
{
torrent = YES;
tr_ctor * ctor = tr_ctorNew(fLib);
@ -2759,7 +2761,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
NSMutableArray * filesToOpen = [NSMutableArray arrayWithCapacity: [files count]];
for (NSString * file in files)
{
if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"])
if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"]
|| [[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
{
torrent = YES;
tr_ctor * ctor = tr_ctorNew(fLib);

View file

@ -83,7 +83,8 @@
for (NSString * file in files)
{
if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"])
if ([[[NSWorkspace sharedWorkspace] typeOfFile: file error: NULL] isEqualToString: @"org.bittorrent.torrent"]
|| [[file pathExtension] caseInsensitiveCompare: @"torrent"] == NSOrderedSame)
{
tr_ctor * ctor = tr_ctorNew(fLib);
tr_ctorSetMetainfoFromFile(ctor, [file UTF8String]);

View file

@ -1641,7 +1641,7 @@ int trashDataFile(const char * filename)
if (path)
result = tr_ctorSetMetainfoFromFile(ctor, [path UTF8String]);
//backup - shouldn't be needed after upgrade to 1.62
//backup - shouldn't be needed after upgrade to 1.70
if (result != TR_OK && hashString)
result = tr_ctorSetMetainfoFromHash(ctor, [hashString UTF8String]);