1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-24 08:38:51 -05:00

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.
This commit is contained in:
Jesse Vincent 2010-12-01 06:04:28 +00:00
parent 35f19abc9f
commit e44a74c652
2 changed files with 11 additions and 20 deletions

View File

@ -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<Part> viewables = new ArrayList<Part>();
ArrayList<Part> attachments = new ArrayList<Part>();
MimeUtility.collectParts(message, viewables, attachments);

View File

@ -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<Void>()
{