From f0c22510e2b2c45b2a9f104ea2144a1997ef2a8a Mon Sep 17 00:00:00 2001 From: ashley willis Date: Wed, 11 Apr 2012 00:08:49 -0500 Subject: [PATCH] fixed FC when changing sort from unified inbox and all messages. the new sort saves per account, and there is no active account for these folders. so also, there is no saving of the sort for the unified inbox nor all messages. --- src/com/fsck/k9/activity/MessageList.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 48c810915..f88960196 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -1210,11 +1210,12 @@ public class MessageList onToggleSortAscending(); } else { mSortType = sortType; - mAccount.setSortType(mSortType); - mSortAscending = mAccount.isSortAscending(mSortType); - mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE); - - mAccount.save(Preferences.getPreferences(this)); + if (mAccount != null) { + mAccount.setSortType(mSortType); + mSortAscending = mAccount.isSortAscending(mSortType); + mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE); + mAccount.save(Preferences.getPreferences(this)); + } reSort(); } } @@ -1250,9 +1251,11 @@ public class MessageList private void onToggleSortAscending() { mSortAscending = !mSortAscending; - mAccount.setSortAscending(mSortType, mSortAscending); - mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE); - mAccount.save(Preferences.getPreferences(this)); + if (mAccount != null) { + mAccount.setSortAscending(mSortType, mSortAscending); + mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE); + mAccount.save(Preferences.getPreferences(this)); + } reSort(); }