From c8bd377e765f9dabde0e408bbac6fe31eab97198 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 17 Dec 2009 05:24:48 +0000 Subject: [PATCH] minor refactoring to cut down on repeated method calls --- src/com/fsck/k9/activity/MessageList.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 247ccf54b..417d72429 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -439,14 +439,16 @@ public class MessageList { super.onResume(); - sortType = MessagingController.getInstance(getApplication()).getSortType(); - sortAscending = MessagingController.getInstance(getApplication()).isSortAscending(sortType); - sortDateAscending = MessagingController.getInstance(getApplication()).isSortAscending(SORT_TYPE.SORT_DATE); + MessagingController controller = MessagingController.getInstance(getApplication()); - MessagingController.getInstance(getApplication()).addListener(mAdapter.mListener); + sortType = controller.getSortType(); + sortAscending = controller.isSortAscending(sortType); + sortDateAscending = controller.isSortAscending(SORT_TYPE.SORT_DATE); + + controller.addListener(mAdapter.mListener); mAdapter.messages.clear(); mAdapter.notifyDataSetChanged(); - MessagingController.getInstance(getApplication()).listLocalMessages(mAccount, mFolderName, mAdapter.mListener); + controller.listLocalMessages(mAccount, mFolderName, mAdapter.mListener); NotificationManager notifMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); notifMgr.cancel(mAccount.getAccountNumber());