diff --git a/src/com/fsck/k9/Account.java b/src/com/fsck/k9/Account.java index 181dfa438..ed8db8ed4 100644 --- a/src/com/fsck/k9/Account.java +++ b/src/com/fsck/k9/Account.java @@ -193,7 +193,7 @@ public class Account implements BaseAccount mMaxPushFolders = preferences.getPreferences().getInt(mUuid + ".maxPushFolders", 10); goToUnreadMessageSearch = preferences.getPreferences().getBoolean(mUuid + ".goToUnreadMessageSearch", - true); + true); for (String type : networkTypes) { Boolean useCompression = preferences.getPreferences().getBoolean(mUuid + ".useCompression." + type, diff --git a/src/com/fsck/k9/MessagingController.java b/src/com/fsck/k9/MessagingController.java index b2fe4a873..b8c925b75 100644 --- a/src/com/fsck/k9/MessagingController.java +++ b/src/com/fsck/k9/MessagingController.java @@ -1063,7 +1063,7 @@ public class MessagingController implements Runnable } else { - + if (K9.DEBUG) Log.v(K9.LOG_TAG, "SYNC: About to get remote store for " + folder); @@ -1097,36 +1097,36 @@ public class MessagingController implements Runnable } if (K9.DEBUG) Log.i(K9.LOG_TAG, "Done synchronizing folder " + folder); - + return; } } } - /* - * Synchronization process: - Open the folder - Upload any local messages that are marked as PENDING_UPLOAD (Drafts, Sent, Trash) - Get the message count - Get the list of the newest K9.DEFAULT_VISIBLE_LIMIT messages - getMessages(messageCount - K9.DEFAULT_VISIBLE_LIMIT, messageCount) - See if we have each message locally, if not fetch it's flags and envelope - Get and update the unread count for the folder - Update the remote flags of any messages we have locally with an internal date - newer than the remote message. - Get the current flags for any messages we have locally but did not just download - Update local flags - For any message we have locally but not remotely, delete the local message to keep - cache clean. - Download larger parts of any new messages. - (Optional) Download small attachments in the background. - */ + /* + * Synchronization process: + Open the folder + Upload any local messages that are marked as PENDING_UPLOAD (Drafts, Sent, Trash) + Get the message count + Get the list of the newest K9.DEFAULT_VISIBLE_LIMIT messages + getMessages(messageCount - K9.DEFAULT_VISIBLE_LIMIT, messageCount) + See if we have each message locally, if not fetch it's flags and envelope + Get and update the unread count for the folder + Update the remote flags of any messages we have locally with an internal date + newer than the remote message. + Get the current flags for any messages we have locally but did not just download + Update local flags + For any message we have locally but not remotely, delete the local message to keep + cache clean. + Download larger parts of any new messages. + (Optional) Download small attachments in the background. + */ - /* - * Open the remote folder. This pre-loads certain metadata like message count. - */ + /* + * Open the remote folder. This pre-loads certain metadata like message count. + */ if (K9.DEBUG) Log.v(K9.LOG_TAG, "SYNC: About to open remote folder " + folder); - + remoteFolder.open(OpenMode.READ_WRITE); } if (Account.EXPUNGE_ON_POLL.equals(account.getExpungePolicy())) @@ -1775,7 +1775,7 @@ public class MessagingController implements Runnable fp.clear(); fp.add(FetchProfile.Item.FLAGS); - + List undeletedMessages = new LinkedList(); for (Message message : syncFlagMessages) { @@ -1784,7 +1784,7 @@ public class MessagingController implements Runnable undeletedMessages.add(message); } } - + remoteFolder.fetch(undeletedMessages.toArray(new Message[0]), fp, null); for (Message remoteMessage : syncFlagMessages) { @@ -4420,7 +4420,7 @@ public class MessagingController implements Runnable } }); } - + public void recreate(final Account account, final MessagingListener ml) { putBackground("recreate:" + account.getDescription(), ml, new Runnable() @@ -4479,7 +4479,7 @@ public class MessagingController implements Runnable { return false; } - + Folder folder = message.getFolder(); if (folder != null) { @@ -4548,7 +4548,7 @@ public class MessagingController implements Runnable messageNotice.append(context.getString(R.string.notification_new_title)); } - + NotificationManager notifMgr = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); Notification notif = new Notification(R.drawable.stat_notify_email_generic, messageNotice, System.currentTimeMillis()); diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 567127235..979322be5 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -590,7 +590,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC }) .create(); } - + private Dialog createClearAccountDialog() { return new AlertDialog.Builder(this) @@ -619,7 +619,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC }) .create(); } - + private Dialog createRecreateAccountDialog() { return new AlertDialog.Builder(this) @@ -708,7 +708,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC private void onClear(Account account) { showDialog(DIALOG_CLEAR_ACCOUNT); - + } private void onRecreate(Account account) { diff --git a/src/com/fsck/k9/activity/FolderList.java b/src/com/fsck/k9/activity/FolderList.java index 547f223f9..e6a485b64 100644 --- a/src/com/fsck/k9/activity/FolderList.java +++ b/src/com/fsck/k9/activity/FolderList.java @@ -1493,11 +1493,11 @@ public class FolderList extends K9ListActivity } private static Flag[] UNREAD_FLAG_ARRAY = { Flag.SEEN }; - + private void openUnreadSearch(Context context, final Account account) { String description = getString(R.string.search_title, mAccount.getDescription(), getString(R.string.unread_modifier)); - + SearchSpecification searchSpec = new SearchSpecification() { @Override @@ -1505,37 +1505,37 @@ public class FolderList extends K9ListActivity { return new String[] { account.getUuid() }; } - + @Override public Flag[] getForbiddenFlags() { return UNREAD_FLAG_ARRAY; } - + @Override public String getQuery() { return ""; } - + @Override public Flag[] getRequiredFlags() { return null; } - + @Override public boolean isIntegrate() { return false; } - + @Override public String[] getFolderNames() { return null; } - + }; MessageList.actionHandle(context, description, searchSpec); } diff --git a/src/com/fsck/k9/activity/setup/AccountSettings.java b/src/com/fsck/k9/activity/setup/AccountSettings.java index 22e0f7740..320a9b91d 100644 --- a/src/com/fsck/k9/activity/setup/AccountSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSettings.java @@ -304,10 +304,10 @@ public class AccountSettings extends K9PreferenceActivity mAccountVibrate = (CheckBoxPreference) findPreference(PREFERENCE_VIBRATE); mAccountVibrate.setChecked(mAccount.isVibrate()); - + mNotificationOpensUnread = (CheckBoxPreference)findPreference(PREFERENCE_NOTIFICATION_OPENS_UNREAD); mNotificationOpensUnread.setChecked(mAccount.goToUnreadMessageSearch()); - + mAutoExpandFolder = (Preference)findPreference(PREFERENCE_AUTO_EXPAND_FOLDER); diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index a810f7739..444e6ada8 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -970,7 +970,7 @@ public class ImapStore extends Store }; return search(searcher, listener); } - + protected Message[] getMessagesFromUids(final List mesgUids, final boolean includeDeleted, final MessageRetrievalListener listener) throws MessagingException { @@ -2623,7 +2623,7 @@ public class ImapStore extends Store final AtomicInteger idleFailureCount = new AtomicInteger(0); final AtomicBoolean needsPoll = new AtomicBoolean(false); List storedUntaggedResponses = new ArrayList(); - + public ImapFolderPusher(ImapStore store, String name, PushReceiver nReceiver) { super(store, name); @@ -2976,11 +2976,11 @@ public class ImapStore extends Store receiver.pushError("Exception while processing Push untagged responses", e); } } - + private void removeMessages(List removeUids) { List messages = new ArrayList(removeUids.size()); - + try { Message[] existingMessages = getMessagesFromUids(removeUids, true, null); @@ -3012,7 +3012,7 @@ public class ImapStore extends Store Log.e(K9.LOG_TAG, "Cannot remove EXPUNGEd messages", e); return; } - + } protected int processUntaggedResponse(int oldMessageCount, ImapResponse response, List flagSyncMsgSeqs, List removeMsgUids) @@ -3028,7 +3028,7 @@ public class ImapStore extends Store { Log.i(K9.LOG_TAG, "Got FETCH " + response); int msgSeq = response.getNumber(0); - + if (K9.DEBUG) Log.d(K9.LOG_TAG, "Got untagged FETCH for msgseq " + msgSeq + " for " + getLogId()); @@ -3062,8 +3062,8 @@ public class ImapStore extends Store } } flagSyncMsgSeqs.addAll(newSeqs); - - + + List msgSeqs = new ArrayList(msgSeqUidMap.keySet()); Collections.sort(msgSeqs); // Have to do comparisons in order because of msgSeq reductions diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index d5a52f32d..58f95043a 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -93,7 +93,7 @@ public class LocalStore extends Store implements Serializable openOrCreateDataspace(application); } - + private void openOrCreateDataspace(Application application) { File parentDir = new File(mPath).getParentFile(); @@ -112,7 +112,7 @@ public class LocalStore extends Store implements Serializable if (mDb.getVersion() != DB_VERSION) { doDbUpgrade(mDb, application); - } + } } private void doDbUpgrade(SQLiteDatabase mDb, Application application) @@ -442,7 +442,7 @@ public class LocalStore extends Store implements Serializable } } - + public void recreate() { delete();