1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-12 06:08:25 -05:00

Naive, untested, bulk operations for the new multi-select

user-interface work.

Performance optimizations to be done later.
This commit is contained in:
Daniel Applebaum 2009-11-26 05:30:13 +00:00
parent fc91603429
commit 69e7243480

View File

@ -2229,6 +2229,14 @@ public class MessagingController implements Runnable
setMessageFlag(account, folder, message, Flag.SEEN, seen);
}
public void setFlag(final Account account, final String folder, final Message[] messages, final Flag flag, final boolean newState)
{
for (Message message : messages)
{
setMessageFlag(account, folder, message.getUid(), flag, newState);
}
}
public void setMessageFlag(
final Account account,
final String folder,
@ -3062,6 +3070,20 @@ public class MessagingController implements Runnable
putBackground("getAccountUnread:" + account.getDescription(), l, unreadRunnable);
}
public int moveMessages(final Account account, final String srcFolder, final Message[] messages, final String destFolder,
final MessagingListener listener)
{
int messagesMoved = 0;
for (Message message : messages)
{
if (moveMessage(account, srcFolder, message, destFolder, listener))
{
messagesMoved++;
}
}
return messagesMoved;
}
public boolean moveMessage(final Account account, final String srcFolder, final Message message, final String destFolder,
final MessagingListener listener)
{
@ -3129,6 +3151,19 @@ public class MessagingController implements Runnable
}
}
public int copyMessages(final Account account, final String srcFolder, final Message[] messages, final String destFolder,
final MessagingListener listener)
{
int messagesCopied = 0;
for (Message message : messages)
{
if (copyMessage(account, srcFolder, message, destFolder, listener))
{
messagesCopied++;
}
}
return messagesCopied;
}
public boolean copyMessage(final Account account, final String srcFolder, final Message message, final String destFolder,
final MessagingListener listener)
{
@ -3206,6 +3241,15 @@ public class MessagingController implements Runnable
}
}
public void deleteMessages(final Account account, final String folder, final Message[] messages,
final MessagingListener listener)
{
for (Message message : messages)
{
deleteMessage(account, folder, message, listener);
}
}
public void deleteMessage(final Account account, final String folder, final Message message,
final MessagingListener listener)
{