mirror of
https://github.com/transmission/transmission
synced 2025-02-12 09:25:03 +00:00
potential fix for users that have "0 times" opened in stats window
This commit is contained in:
parent
e03444fe86
commit
913b88c8b6
2 changed files with 7 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue