From e44a74c652c7ccb11aaf5af845a071b1d0e1b039 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 1 Dec 2010 06:04:28 +0000 Subject: [PATCH] Get rid of a whole lot of crazy code that forced repeated attachment downloads with the intent of only having one attachment downloaded at a time. --- .../k9/controller/MessagingController.java | 7 ------ src/com/fsck/k9/mail/store/LocalStore.java | 24 +++++++++---------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 0dfef727d..7b6bfd34b 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -3230,13 +3230,6 @@ public class MessagingController implements Runnable { LocalStore localStore = account.getLocalStore(); - /* - * We clear out any attachments already cached in the entire store and then - * we update the passed in message to reflect that there are no cached - * attachments. This is in support of limiting the account to having one - * attachment downloaded at a time. - */ - localStore.pruneCachedAttachments(); ArrayList viewables = new ArrayList(); ArrayList attachments = new ArrayList(); MimeUtility.collectParts(message, viewables, attachments); diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index f8b3a3241..aca0699af 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -793,14 +793,16 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati throw new Error("Database upgrade failed!"); } - try - { - pruneCachedAttachments(true); - } - catch (Exception me) - { - Log.e(K9.LOG_TAG, "Exception while force pruning attachments during DB update", me); - } + // Unless we're blowing away the whole data store, there's no reason to prune attachments + // every time the user upgrades. it'll just cost them money and pain. + // try + //{ + // pruneCachedAttachments(true); + //} + //catch (Exception me) + //{ + // Log.e(K9.LOG_TAG, "Exception while force pruning attachments during DB update", me); + //} } public long getSize() throws UnavailableStorageException @@ -835,11 +837,7 @@ public class LocalStore extends Store implements Serializable, LocalStoreMigrati public void compact() throws MessagingException { if (K9.DEBUG) - Log.i(K9.LOG_TAG, "Before prune size = " + getSize()); - - pruneCachedAttachments(); - if (K9.DEBUG) - Log.i(K9.LOG_TAG, "After prune / before compaction size = " + getSize()); + Log.i(K9.LOG_TAG, "Before compaction size = " + getSize()); execute(false, new DbCallback() {