1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Tidy responsibilities

This commit is contained in:
Jan Berkel 2014-12-14 15:58:08 +00:00
parent 238c1650c5
commit 476cb1d4ce
3 changed files with 6 additions and 9 deletions

View File

@ -13,6 +13,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.fsck.k9.mail.store.RemoteStore;
import com.fsck.k9.mailstore.LocalStore;
import com.fsck.k9.preferences.Editor;
import com.fsck.k9.preferences.Storage;
@ -121,6 +122,11 @@ public class Preferences {
accountsInOrder.remove(account);
}
try {
RemoteStore.removeInstance(account);
} catch (Exception e) {
Log.e(K9.LOG_TAG, "Failed to reset remote store for account " + account.getUuid(), e);
}
LocalStore.removeAccount(account);
account.deleteCertificates();

View File

@ -62,12 +62,10 @@ public abstract class RemoteStore extends Store {
*/
public static void removeInstance(StoreConfig storeConfig) {
String uri = storeConfig.getStoreUri();
if (uri.startsWith("local")) {
throw new RuntimeException("Asked to get non-local Store object but given " +
"LocalStore URI");
}
sStores.remove(uri);
}

View File

@ -21,7 +21,6 @@ import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.MessageRetrievalListener;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Store;
import com.fsck.k9.mail.store.RemoteStore;
import com.fsck.k9.mailstore.StorageManager.StorageProvider;
import com.fsck.k9.mail.store.StoreConfig;
import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
@ -207,12 +206,6 @@ public class LocalStore extends Store implements Serializable {
}
public static void removeAccount(Account account) {
try {
RemoteStore.removeInstance(account);
} catch (Exception e) {
Log.e(K9.LOG_TAG, "Failed to reset remote store for account " + account.getUuid(), e);
}
try {
removeInstance(account);
} catch (Exception e) {