1
0
Fork 0
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:
Mitchell Livingston 2007-09-10 21:57:12 +00:00
parent 13e09a0185
commit a9c20a36ca

View file

@ -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]];