1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-28 04:02:19 -05:00

on search, only fire one start event and one end event

This commit is contained in:
Jesse Vincent 2009-12-27 17:22:51 +00:00
parent 6c383256a2
commit a53e9d1b89

View File

@ -679,10 +679,10 @@ public class MessagingController implements Runnable
Preferences prefs = Preferences.getPreferences(mApplication.getApplicationContext()); Preferences prefs = Preferences.getPreferences(mApplication.getApplicationContext());
Account[] accounts = prefs.getAccounts(); Account[] accounts = prefs.getAccounts();
listener.listLocalMessagesStarted(account, null);
for (final Account account : accounts) for (final Account account : accounts)
{ {
listener.listLocalMessagesStarted(account, null);
MessageRetrievalListener retrievalListener = new MessageRetrievalListener() MessageRetrievalListener retrievalListener = new MessageRetrievalListener()
{ {
@ -708,13 +708,16 @@ public class MessagingController implements Runnable
LocalStore localStore = (LocalStore)Store.getInstance(account.getLocalStoreUri(), mApplication); LocalStore localStore = (LocalStore)Store.getInstance(account.getLocalStoreUri(), mApplication);
localStore.searchForMessages(retrievalListener, query); localStore.searchForMessages(retrievalListener, query);
listener.listLocalMessagesFinished(account, null);
} }
catch (Exception e) catch (Exception e)
{ {
listener.listLocalMessagesFailed(account, null, e.getMessage()); listener.listLocalMessagesFailed(account, null, e.getMessage());
addErrorMessage(account, e); addErrorMessage(account, e);
} }
finally
{
listener.listLocalMessagesFinished(account, null);
}
} }
} }
}); });
@ -2183,7 +2186,7 @@ public class MessagingController implements Runnable
} }
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.d(K9.LOG_TAG, "processPendingExpunge: folder = " + folder ); Log.d(K9.LOG_TAG, "processPendingExpunge: folder = " + folder);
} }
Store remoteStore = Store.getInstance(account.getStoreUri(), mApplication); Store remoteStore = Store.getInstance(account.getStoreUri(), mApplication);
@ -2202,7 +2205,7 @@ public class MessagingController implements Runnable
remoteFolder.expunge(); remoteFolder.expunge();
if (K9.DEBUG) if (K9.DEBUG)
{ {
Log.d(K9.LOG_TAG, "processPendingExpunge: complete for folder = " + folder ); Log.d(K9.LOG_TAG, "processPendingExpunge: complete for folder = " + folder);
} }
} }
finally finally