See ChangeLog

Monotone-Parent: 42caf855ed6371b609cb372b49a7c45444fc18e6
Monotone-Revision: d4aaec9a2984bf8eb954d457c1dde92899b63a7a

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-03-22T00:30:26
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2011-03-22 00:30:26 +00:00
parent 112072d3f4
commit 4c107904de
3 changed files with 40 additions and 26 deletions
+32 -24
View File
@@ -335,9 +335,6 @@
sort = [[context request] formValueForKey: @"sort"];
if (![sort length])
sort = [self defaultSortKey];
return [sort uppercaseString];
}
@@ -357,31 +354,42 @@
activeUser = [context activeUser];
clientObject = [self clientObject];
module = [[[clientObject container] container] nameInContainer];
module = @"Mail";
us = [activeUser userSettings];
moduleSettings = [us objectForKey: module];
if ([sort isEqualToString: [self defaultSortKey]] && !asc)
{
if (moduleSettings)
{
[moduleSettings removeObjectForKey: @"SortingState"];
[us synchronize];
}
}
else
if ([sort length])
{
// Save the sorting state in the user settings
if (!moduleSettings)
{
moduleSettings = [NSMutableDictionary dictionary];
[us setObject: moduleSettings forKey: module];
}
[moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil]
forKey: @"SortingState"];
[us synchronize];
}
if ([sort isEqualToString: [self defaultSortKey]] && !asc)
{
if (moduleSettings)
{
[moduleSettings removeObjectForKey: @"SortingState"];
[us synchronize];
}
}
else
{
// Save the sorting state in the user settings
if (!moduleSettings)
{
moduleSettings = [NSMutableDictionary dictionary];
[us setObject: moduleSettings forKey: module];
}
[moduleSettings setObject: [NSArray arrayWithObjects: [sort lowercaseString], [NSString stringWithFormat: @"%d", (asc?1:0)], nil]
forKey: @"SortingState"];
[us synchronize];
}
}
else if (moduleSettings)
{
NSArray *sortState = [moduleSettings objectForKey: @"SortingState"];
sort = [[sortState objectAtIndex: 0] uppercaseString];
asc = [[sortState objectAtIndex: 1] boolValue];
}
else
sort = [self defaultSortKey];
// Construct and return the final IMAP ordering constraint
if (!asc)
sort = [@"REVERSE " stringByAppendingString: sort];
+2 -2
View File
@@ -735,9 +735,9 @@ function openMailbox(mailbox, reload) {
var sortImage = createElement("img", "messageSortImage", "sortImage");
sortHeader.insertBefore(sortImage, sortHeader.firstChild);
if (sorting["ascending"])
sortImage.src = ResourcesURL + "/arrow-down.png";
else
sortImage.src = ResourcesURL + "/arrow-up.png";
else
sortImage.src = ResourcesURL + "/arrow-down.png";
}
}