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);