mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
the text-copy of the message log is sorted by date
This commit is contained in:
parent
13e09a0185
commit
a9c20a36ca
1 changed files with 7 additions and 2 deletions
|
@ -194,10 +194,15 @@
|
|||
|
||||
- (void) writeToFile: (id) sender
|
||||
{
|
||||
//make the array sorted by date
|
||||
NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"Date" ascending: YES] autorelease];
|
||||
NSArray * descriptors = [[NSArray alloc] initWithObjects: descriptor, nil];
|
||||
NSArray * sortedMessages = [fMessages sortedArrayUsingDescriptors: descriptors];
|
||||
[descriptors release];
|
||||
|
||||
//create the text to output
|
||||
NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [fMessages count]];
|
||||
|
||||
NSEnumerator * enumerator = [fMessages objectEnumerator];
|
||||
NSEnumerator * enumerator = [sortedMessages objectEnumerator];
|
||||
NSDictionary * message;
|
||||
while ((message = [enumerator nextObject]))
|
||||
[messageStrings addObject: [self stringForMessage: message]];
|
||||
|
|
Loading…
Reference in a new issue