mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
119350 r=nhotta sr=sspizter. make cross-folder msgNavigation follow the folder-pane sort order.
This commit is contained in:
parent
0ee20025a9
commit
c59f91b929
@ -389,6 +389,7 @@ const nsMsgBiffState nsMsgBiffState_Unknown = 2; // We dunno whether there is ne
|
||||
void throwAlertMsg(in string msgName, in nsIMsgWindow msgWindow);
|
||||
wstring getStringWithFolderNameFromBundle(in string msgName);
|
||||
void notifyCompactCompleted();
|
||||
long compareSortKeys(in nsIMsgFolder msgFolder);
|
||||
|
||||
attribute nsIMsgRetentionSettings retentionSettings;
|
||||
attribute nsIMsgDownloadSettings downloadSettings;
|
||||
@ -398,7 +399,7 @@ const nsMsgBiffState nsMsgBiffState_Unknown = 2; // We dunno whether there is ne
|
||||
*/
|
||||
attribute long sortOrder;
|
||||
|
||||
readonly attribute wstring sortKey;
|
||||
[noscript]readonly attribute wstring sortKey;
|
||||
|
||||
/**
|
||||
* used to determine if we persist the close / open state of this folder or not
|
||||
|
@ -65,13 +65,9 @@ function compareServerSortOrder(server1, server2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
function compareFolderSortKey(folder1, folder2) {
|
||||
|
||||
if (folder1.sortKey < folder2.sortKey)
|
||||
return -1;
|
||||
if (folder1.sortKey > folder2.sortKey)
|
||||
return 1;
|
||||
return 0;
|
||||
function compareFolderSortKey(folder1, folder2)
|
||||
{
|
||||
return folder1.compareSortKeys(folder2);
|
||||
}
|
||||
|
||||
function GetSubFoldersInFolderPaneOrder(folder)
|
||||
|
@ -2833,12 +2833,12 @@ NS_IMETHODIMP nsMsgFolder::GetSortKey(PRUnichar **aSortKey)
|
||||
{
|
||||
nsresult rv=NS_OK;
|
||||
NS_ENSURE_ARG(aSortKey);
|
||||
nsAutoString orderString;
|
||||
PRInt32 order;
|
||||
rv = GetSortOrder(&order);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
orderString.AppendInt(order);
|
||||
|
||||
nsAutoString orderString;
|
||||
orderString.AppendInt(order);
|
||||
|
||||
nsXPIDLString folderName;
|
||||
rv = GetName(getter_Copies(folderName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
@ -2885,5 +2885,22 @@ nsMsgFolder::CreateCollationKey(const PRUnichar *aSource, PRUnichar **aSortKey)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgFolder::CompareSortKeys(nsIMsgFolder *aFolder, PRInt32 *sortOrder)
|
||||
{
|
||||
nsresult rv;
|
||||
nsXPIDLString sortKey1;
|
||||
nsXPIDLString sortKey2;
|
||||
rv = GetSortKey(getter_Copies(sortKey1));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
aFolder->GetSortKey(getter_Copies(sortKey2));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
rv = kCollationKeyGenerator->CompareRawSortKey((const PRUint8 *) sortKey1.get(),
|
||||
sortKey1.Length() * sizeof(PRUnichar),
|
||||
(const PRUint8 *) sortKey2.get(),
|
||||
sortKey2.Length() * sizeof(PRUnichar),
|
||||
sortOrder);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
@ -204,6 +204,7 @@ public:
|
||||
|
||||
// nsRDFResource overrides
|
||||
NS_IMETHOD Init(const char* aURI);
|
||||
NS_IMETHOD CompareSortKeys(nsIMsgFolder *aFolder, PRInt32 *sortOrder);
|
||||
|
||||
// Gets the URL that represents the given message. Returns a newly
|
||||
// created string that must be free'd using XP_FREE().
|
||||
|
Loading…
x
Reference in New Issue
Block a user