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:
parent
6c383256a2
commit
a53e9d1b89
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user