mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Bug #349763 --> add a pref (defaulted to off) that makes delete move in the direction of the sort for folks who like the delete direction to work like mail.app and outlook. sr=bienvenu
This commit is contained in:
parent
b4b452e4f6
commit
871991f5d3
@ -5676,10 +5676,27 @@ nsMsgDBView::GetMsgToSelectAfterDelete(nsMsgViewIndex *msgToSelectAfterDelete)
|
||||
if (thisIsImapFolder) //need to update the imap-delete model, can change more than once in a session.
|
||||
GetImapDeleteModel(nsnull);
|
||||
if (mDeleteModel == nsMsgImapDeleteModels::IMAPDelete)
|
||||
{
|
||||
if (selectionCount > 1 || (endRange-startRange) > 0) //multiple selection either using Ctrl or Shift keys
|
||||
*msgToSelectAfterDelete = nsMsgViewIndex_None;
|
||||
else
|
||||
*msgToSelectAfterDelete += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If mail.delete_matches_sort_order is true,
|
||||
// for views sorted in descending order (newest at the top), make msgToSelectAfterDelete
|
||||
// advance in the same direction as the sort order.
|
||||
if (m_sortOrder == nsMsgViewSortOrder::descending && *msgToSelectAfterDelete)
|
||||
{
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch (do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
PRBool deleteMatchesSort = PR_FALSE;
|
||||
prefBranch->GetBoolPref("mail.delete_matches_sort_order", &deleteMatchesSort);
|
||||
if (deleteMatchesSort)
|
||||
*msgToSelectAfterDelete -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -82,6 +82,10 @@ pref("mailnews.default_sort_type", 18); //
|
||||
pref("mailnews.default_news_sort_order", 1); // for News (nsNewsDatabase)
|
||||
pref("mailnews.default_news_sort_type", 22); //
|
||||
|
||||
// If true, delete will use the direction of the sort order
|
||||
// in determining the next message to select.
|
||||
pref("mail.delete_matches_sort_order", false);
|
||||
|
||||
// mailnews tcp read+write timeout in seconds.
|
||||
pref("mailnews.tcptimeout", 60);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user