diff --git a/res/layout/account_setup_incoming.xml b/res/layout/account_setup_incoming.xml index 5a313f490..db816eb16 100644 --- a/res/layout/account_setup_incoming.xml +++ b/res/layout/account_setup_incoming.xml @@ -245,17 +245,6 @@ android:contentDescription="@string/account_setup_incoming_compression_label" /> - - Wi-Fi Other - Downloading of mail headers - Save all headers locally + Download headers + Save all message headers locally Expunge deleted messages Immediately diff --git a/res/xml/account_settings_preferences.xml b/res/xml/account_settings_preferences.xml index 5c3db53e0..3a2dcbd1e 100644 --- a/res/xml/account_settings_preferences.xml +++ b/res/xml/account_settings_preferences.xml @@ -83,10 +83,6 @@ - - + + - + diff --git a/src/com/fsck/k9/Account.java b/src/com/fsck/k9/Account.java index deeb4e186..0f4199a14 100644 --- a/src/com/fsck/k9/Account.java +++ b/src/com/fsck/k9/Account.java @@ -151,7 +151,7 @@ public class Account implements BaseAccount mLocalStoreUri = "local://localhost/" + context.getDatabasePath(mUuid + ".db"); mAutomaticCheckIntervalMinutes = -1; mIdleRefreshMinutes = 24; - mSaveAllHeaders = false; + mSaveAllHeaders = true; mPushPollOnConnect = true; mDisplayCount = K9.DEFAULT_VISIBLE_LIMIT; mAccountNumber = -1; @@ -226,7 +226,7 @@ public class Account implements BaseAccount mIdleRefreshMinutes = prefs.getInt(mUuid + ".idleRefreshMinutes", 24); mSaveAllHeaders = prefs.getBoolean(mUuid - + ".saveAllHeaders", false); + + ".saveAllHeaders", true); mPushPollOnConnect = prefs.getBoolean(mUuid + ".pushPollOnConnect", true); mDisplayCount = prefs.getInt(mUuid + ".displayCount", K9.DEFAULT_VISIBLE_LIMIT); @@ -1290,7 +1290,7 @@ public class Account implements BaseAccount mPushPollOnConnect = pushPollOnConnect; } - public synchronized boolean isSaveAllHeaders() + public synchronized boolean saveAllHeaders() { return mSaveAllHeaders; } diff --git a/src/com/fsck/k9/activity/setup/AccountSettings.java b/src/com/fsck/k9/activity/setup/AccountSettings.java index ff8f3c200..6d2712823 100644 --- a/src/com/fsck/k9/activity/setup/AccountSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSettings.java @@ -71,6 +71,7 @@ public class AccountSettings extends K9PreferenceActivity private static final String PREFERENCE_NOTIFICATION_OPENS_UNREAD = "notification_opens_unread"; private static final String PREFERENCE_MESSAGE_AGE = "account_message_age"; private static final String PREFERENCE_MESSAGE_SIZE = "account_autodownload_size"; + private static final String PREFERENCE_SAVE_ALL_HEADERS = "account_save_all_headers"; private static final String PREFERENCE_QUOTE_PREFIX = "account_quote_prefix"; private static final String PREFERENCE_REPLY_AFTER_QUOTE = "reply_after_quote"; private static final String PREFERENCE_SYNC_REMOTE_DELETIONS = "account_sync_remote_deletetions"; @@ -112,6 +113,7 @@ public class AccountSettings extends K9PreferenceActivity private EditTextPreference mAccountQuotePrefix; private CheckBoxPreference mReplyAfterQuote; private CheckBoxPreference mSyncRemoteDeletions; + private CheckBoxPreference mSaveAllHeaders; private ListPreference mCryptoApp; private CheckBoxPreference mCryptoAutoSignature; @@ -291,6 +293,12 @@ public class AccountSettings extends K9PreferenceActivity mSyncRemoteDeletions = (CheckBoxPreference) findPreference(PREFERENCE_SYNC_REMOTE_DELETIONS); mSyncRemoteDeletions.setChecked(mAccount.syncRemoteDeletions()); + + mSaveAllHeaders = (CheckBoxPreference) findPreference(PREFERENCE_SAVE_ALL_HEADERS); + mSaveAllHeaders.setChecked(mAccount.saveAllHeaders()); + + + mSearchableFolders = (ListPreference) findPreference(PREFERENCE_SEARCHABLE_FOLDERS); mSearchableFolders.setValue(mAccount.getSearchableFolders().name()); mSearchableFolders.setSummary(mSearchableFolders.getEntry()); @@ -630,6 +638,7 @@ public class AccountSettings extends K9PreferenceActivity mAccount.setDeletePolicy(Integer.parseInt(mDeletePolicy.getValue())); mAccount.setExpungePolicy(mExpungePolicy.getValue()); mAccount.setSyncRemoteDeletions(mSyncRemoteDeletions.isChecked()); + mAccount.setSaveAllHeaders(mSaveAllHeaders.isChecked()); mAccount.setSearchableFolders(Account.Searchable.valueOf(mSearchableFolders.getValue())); mAccount.setQuotePrefix(mAccountQuotePrefix.getText()); mAccount.setReplyAfterQuote(mReplyAfterQuote.isChecked()); diff --git a/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java index 035153b8c..961151366 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -88,7 +88,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener private CheckBox compressionMobile; private CheckBox compressionWifi; private CheckBox compressionOther; - private CheckBox saveAllHeaders; private CheckBox pushPollOnConnect; private Spinner idleRefreshPeriod; private Spinner folderPushLimit; @@ -137,7 +136,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener compressionMobile = (CheckBox)findViewById(R.id.compression_mobile); compressionWifi = (CheckBox)findViewById(R.id.compression_wifi); compressionOther = (CheckBox)findViewById(R.id.compression_other); - saveAllHeaders = (CheckBox)findViewById(R.id.save_all_headers); pushPollOnConnect = (CheckBox)findViewById(R.id.push_poll_on_connect); subscribedFoldersOnly = (CheckBox)findViewById(R.id.subscribed_folders_only); @@ -423,7 +421,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener updatePortFromSecurityType(); } - saveAllHeaders.setChecked(mAccount.isSaveAllHeaders()); pushPollOnConnect.setChecked(mAccount.isPushPollOnConnect()); subscribedFoldersOnly.setChecked(mAccount.subscribedFoldersOnly()); SpinnerHelper.initSpinner(this, idleRefreshPeriod, R.array.idle_refresh_period_entries, @@ -588,7 +585,6 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener mAccount.setCompression(Account.TYPE_MOBILE, compressionMobile.isChecked()); mAccount.setCompression(Account.TYPE_WIFI, compressionWifi.isChecked()); mAccount.setCompression(Account.TYPE_OTHER, compressionOther.isChecked()); - mAccount.setSaveAllHeaders(saveAllHeaders.isChecked()); mAccount.setPushPollOnConnect(pushPollOnConnect.isChecked()); mAccount.setSubscribedFoldersOnly(subscribedFoldersOnly.isChecked()); String idleRefreshPeriodValue = SpinnerHelper.getSpinnerValue(idleRefreshPeriod); diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index db78bc883..a980fa297 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -1962,7 +1962,7 @@ public class LocalStore extends Store implements Serializable */ private void saveHeaders(long id, MimeMessage message) throws MessagingException { - boolean saveAllHeaders = mAccount.isSaveAllHeaders(); + boolean saveAllHeaders = mAccount.saveAllHeaders(); boolean gotAdditionalHeaders = false; deleteHeaders(id);