1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

Minor code cleanup

This commit is contained in:
cketti 2011-04-01 03:13:23 +02:00
parent 1f59098232
commit 449d4df2a9

View File

@ -1131,20 +1131,21 @@ public class MessageList
} }
private void onSpam(MessageInfoHolder holder) { private void onSpam(MessageInfoHolder holder) {
if (K9.confirmSpam()) { if (K9.confirmSpam()) {
showDialog(R.id.dialog_confirm_spam); showDialog(R.id.dialog_confirm_spam);
} else } else {
spam(holder); moveToSpamFolder(holder);
}
} }
private void spam(MessageInfoHolder holder){ private void moveToSpamFolder(MessageInfoHolder holder){
if (!mController.isMoveCapable(holder.message)) { if (!mController.isMoveCapable(holder.message)) {
Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG); Toast toast = Toast.makeText(this, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
toast.show(); toast.show();
return; return;
} }
onMoveChosen(holder, holder.message.getFolder().getAccount().getSpamFolderName()); onMoveChosen(holder, holder.message.getFolder().getAccount().getSpamFolderName());
} }
private void onCopy(MessageInfoHolder holder) { private void onCopy(MessageInfoHolder holder) {
if (!mController.isCopyCapable(holder.message.getFolder().getAccount())) { if (!mController.isCopyCapable(holder.message.getFolder().getAccount())) {
@ -1315,7 +1316,7 @@ public class MessageList
}) })
.create(); .create();
} }
private Dialog createConfirmSpamDialog(final int id) { private Dialog createConfirmSpamDialog(final int id) {
final AlertDialog.Builder builder = new AlertDialog.Builder(this); final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.dialog_confirm_spam_title); builder.setTitle(R.string.dialog_confirm_spam_title);
@ -1325,7 +1326,7 @@ public class MessageList
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
dismissDialog(id); dismissDialog(id);
spam(mSelectedMessage); moveToSpamFolder(mSelectedMessage);
} }
}); });
builder.setNegativeButton(R.string.dialog_confirm_spam_cancel_button, builder.setNegativeButton(R.string.dialog_confirm_spam_cancel_button,