diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 2e74a157d..377a4b8a9 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -54,6 +54,7 @@
- @string/account_setup_options_mail_display_count_250
- @string/account_setup_options_mail_display_count_500
- @string/account_setup_options_mail_display_count_1000
+ - @string/account_setup_options_mail_display_count_all
@@ -64,6 +65,7 @@
- 250
- 500
- 1000
+ - 0
diff --git a/res/values/strings.xml b/res/values/strings.xml
index dab98dcb3..3d5008741 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -493,6 +493,7 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
250 messages
500 messages
1000 messages
+ all messages
Cannot copy or move a message that is not synchronized with the server
diff --git a/src/com/fsck/k9/Account.java b/src/com/fsck/k9/Account.java
index 5fc37743a..a11579a47 100644
--- a/src/com/fsck/k9/Account.java
+++ b/src/com/fsck/k9/Account.java
@@ -576,7 +576,7 @@ public class Account implements BaseAccount
}
- public void resetVisibleLimits()
+ public void resetVisibleLimits()
{
try
{
diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java
index 51e97df7b..78070d435 100644
--- a/src/com/fsck/k9/activity/MessageList.java
+++ b/src/com/fsck/k9/activity/MessageList.java
@@ -2799,7 +2799,14 @@ public class MessageList
{
if (!mCurrentFolder.lastCheckFailed)
{
- holder.main.setText(String.format(getString(R.string.load_more_messages_fmt), mAccount.getDisplayCount()));
+ if (mAccount.getDisplayCount() == 0 )
+ {
+ holder.main.setText(getString(R.string.message_list_load_more_messages_action));
+ }
+ else
+ {
+ holder.main.setText(String.format(getString(R.string.load_more_messages_fmt), mAccount.getDisplayCount()));
+ }
}
else
{
diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java
index 82e90760c..75bd8a123 100644
--- a/src/com/fsck/k9/controller/MessagingController.java
+++ b/src/com/fsck/k9/controller/MessagingController.java
@@ -925,7 +925,9 @@ public class MessagingController implements Runnable
{
LocalStore localStore = account.getLocalStore();
LocalFolder localFolder = localStore.getFolder(folder);
- localFolder.setVisibleLimit(localFolder.getVisibleLimit() + account.getDisplayCount());
+ if (localFolder.getVisibleLimit() > 0 ) {
+ localFolder.setVisibleLimit(localFolder.getVisibleLimit() + account.getDisplayCount());
+ }
synchronizeMailbox(account, folder, listener, null);
}
catch (MessagingException me)
@@ -1100,7 +1102,7 @@ public class MessagingController implements Runnable
int visibleLimit = localFolder.getVisibleLimit();
- if (visibleLimit < 1)
+ if (visibleLimit < 0)
{
visibleLimit = K9.DEFAULT_VISIBLE_LIMIT;
}
@@ -1118,7 +1120,14 @@ public class MessagingController implements Runnable
/*
* Message numbers start at 1.
*/
- int remoteStart = Math.max(0, remoteMessageCount - visibleLimit) + 1;
+ int remoteStart;
+ if (visibleLimit > 0 )
+ {
+ remoteStart = Math.max(0, remoteMessageCount - visibleLimit) + 1;
+ }
+ else {
+ remoteStart = 1;
+ }
int remoteEnd = remoteMessageCount;
if (K9.DEBUG)
@@ -1479,7 +1488,7 @@ public class MessagingController implements Runnable
int visibleLimit = localFolder.getVisibleLimit();
int listSize = unsyncedMessages.size();
- if (listSize > visibleLimit)
+ if ((visibleLimit > 0) && (listSize > visibleLimit))
{
unsyncedMessages = unsyncedMessages.subList(listSize - visibleLimit, listSize);
}
diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java
index 552b2d668..fceeb0bdb 100644
--- a/src/com/fsck/k9/mail/store/LocalStore.java
+++ b/src/com/fsck/k9/mail/store/LocalStore.java
@@ -1150,6 +1150,10 @@ public class LocalStore extends Store implements Serializable
public void purgeToVisibleLimit(MessageRemovalListener listener) throws MessagingException
{
+ if ( mVisibleLimit == 0)
+ {
+ return ;
+ }
open(OpenMode.READ_WRITE);
Message[] messages = getMessages(null, false);
for (int i = mVisibleLimit; i < messages.length; i++)