From 8a876d755acad08e2601e98c3457fde332bd445d Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 29 May 2008 22:16:03 +0000 Subject: [PATCH] "isFolder" is a better method name than "folder" --- macosx/AddWindowController.m | 2 +- macosx/Controller.m | 4 ++-- macosx/InfoWindowController.m | 4 ++-- macosx/Torrent.h | 2 +- macosx/Torrent.m | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/macosx/AddWindowController.m b/macosx/AddWindowController.m index 27c25febf..dd94ef8e9 100644 --- a/macosx/AddWindowController.m +++ b/macosx/AddWindowController.m @@ -207,7 +207,7 @@ - (void) updateStatusField: (NSNotification *) notification { NSString * statusString = [NSString stringForFileSize: [fTorrent size]]; - if ([fTorrent folder]) + if ([fTorrent isFolder]) { NSString * fileString; int count = [fTorrent fileCount]; diff --git a/macosx/Controller.m b/macosx/Controller.m index 23b5be38e..3eca2a6e1 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -4060,7 +4060,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy while ((torrent = [enumerator nextObject])) { - if ([torrent folder] || [torrent isComplete]) + if ([torrent isFolder] || [torrent isComplete]) [urlArray addObject: [NSURL fileURLWithPath: [torrent dataLocation]]]; } @@ -4075,7 +4075,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy while ((torrent = [enumerator nextObject])) { - if ([torrent folder] || [torrent isComplete]) + if ([torrent isFolder] || [torrent isComplete]) return YES; } diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 0cc6ff533..1a348fc7c 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -363,7 +363,7 @@ typedef enum [fNameField setToolTip: name]; NSString * basicString = [NSString stringForFileSize: [torrent size]]; - if ([torrent folder]) + if ([torrent isFolder]) { NSString * fileString; int fileCount = [torrent fileCount]; @@ -1176,7 +1176,7 @@ typedef enum [fStateField setStringValue: [torrent stateString]]; - if ([torrent folder]) + if ([torrent isFolder]) [fProgressField setStringValue: [NSString localizedStringWithFormat: NSLocalizedString(@"%.2f%% (%.2f%% selected)", "Inspector -> Activity tab -> progress"), 100.0 * [torrent progress], 100.0 * [torrent progressDone]]]; else diff --git a/macosx/Torrent.h b/macosx/Torrent.h index b5847686d..b13a1b550 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -134,7 +134,7 @@ typedef enum - (NSImage *) icon; - (NSString *) name; -- (BOOL) folder; +- (BOOL) isFolder; - (uint64_t) size; - (uint64_t) sizeLeft; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 5c1e890a9..50ed2f83d 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -699,7 +699,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * { if (!fIcon) { - fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: [self folder] ? NSFileTypeForHFSTypeCode('fldr') + fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: [self isFolder] ? NSFileTypeForHFSTypeCode('fldr') : [[self name] pathExtension]] retain]; [fIcon setFlipped: YES]; } @@ -711,7 +711,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * return fNameString; } -- (BOOL) folder +- (BOOL) isFolder { return fInfo->isMultifile; } @@ -990,7 +990,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * if (![self allDownloaded]) { float progress; - if ([self folder] && [fDefaults boolForKey: @"DisplayStatusProgressSelected"]) + if ([self isFolder] && [fDefaults boolForKey: @"DisplayStatusProgressSelected"]) { string = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@ selected", "Torrent -> progress string"), [NSString stringForFileSize: [self haveTotal]], [NSString stringForFileSize: [self totalSizeSelected]]]; @@ -1651,7 +1651,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * - (void) createFileList { - if ([self folder]) + if ([self isFolder]) { int count = [self fileCount], i; NSMutableArray * fileList = [[NSMutableArray alloc] initWithCapacity: count]; -- 2.40.0