potential fix for users that have "0 times" opened in stats window

This commit is contained in:
Mitchell Livingston 2008-05-23 22:58:17 +00:00
parent e03444fe86
commit 913b88c8b6
2 changed files with 7 additions and 14 deletions

View File

@ -56,14 +56,14 @@
- (void) insertChild: (FileListNode *) child
{
NSAssert(fIsFolder, @"method can only be invoked on files");
NSAssert(fIsFolder, @"method can only be invoked on folders");
[fChildren addObject: child];
}
- (void) insertIndex: (NSUInteger) index withSize: (uint64_t) size
{
NSAssert(fIsFolder, @"method can only be invoked on files");
NSAssert(fIsFolder, @"method can only be invoked on folders");
[fIndexes addIndex: index];
fSize += size;

View File

@ -193,18 +193,11 @@ tr_handle * fLib;
[fTimeAllField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%@ total", "stats total"),
[NSString timeString: statsAll.secondsActive showSeconds: NO]]];
switch (statsAll.sessionCount)
{
case 1:
[fNumOpenedField setStringValue: NSLocalizedString(@"1 time", "stats window -> times opened")];
break;
case 0: //for users that have this problem
[fNumOpenedField setStringValue: NSLocalizedString(@"N/A", "stats window -> times opened")];
break;
default:
[fNumOpenedField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d times", "stats window -> times opened"),
statsAll.sessionCount]];
}
if (statsAll.sessionCount == 1)
[fNumOpenedField setStringValue: NSLocalizedString(@"1 time", "stats window -> times opened")];
else
[fNumOpenedField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%u times", "stats window -> times opened"),
statsAll.sessionCount]];
}
- (void) performResetStats