From f884e967c9e0deef9a4da3e05ee1230872a27048 Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Wed, 2 Nov 2011 08:34:06 -0700 Subject: [PATCH] Use MimeHeader.* constants when referring to content headers. Minor whitespace changes. --- src/com/fsck/k9/mail/internet/MimeUtility.java | 2 +- src/com/fsck/k9/mail/store/LocalStore.java | 4 ++-- src/com/fsck/k9/view/SingleMessageView.java | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 472ac3331..2922a8bd7 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -981,7 +981,7 @@ public class MimeUtility { } } } - String[] header = part.getHeader("Content-ID"); + String[] header = part.getHeader(MimeHeader.HEADER_CONTENT_ID); if (header != null) { for (String s : header) { if (s.equals(contentId)) { diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 99aa4251d..6131f74c5 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -88,8 +88,8 @@ public class LocalStore extends Store implements Serializable { set.add("From"); set.add("In-Reply-To"); set.add("References"); - set.add("Content-ID"); - set.add("Content-Disposition"); + set.add(MimeHeader.HEADER_CONTENT_ID); + set.add(MimeHeader.HEADER_CONTENT_DISPOSITION); set.add("User-Agent"); HEADERS_TO_SAVE = Collections.unmodifiableSet(set); } diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index 29e0d9127..85afd51f3 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -24,6 +24,7 @@ import com.fsck.k9.crypto.PgpData; import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.*; +import com.fsck.k9.mail.internet.MimeHeader; import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.store.LocalStore; @@ -38,7 +39,7 @@ public class SingleMessageView extends LinearLayout { private MessageWebView mMessageContentView; private AccessibleWebView mAccessibleMessageContentView; private MessageHeader mHeaderContainer; - private LinearLayout mAttachments; + private LinearLayout mAttachments; private View mShowPicturesSection; private boolean mShowPictures; private Button mDownloadRemainder; @@ -249,9 +250,8 @@ public class SingleMessageView extends LinearLayout { } } - public void renderAttachments(Part part, int depth, - - Message message, Account account, MessagingController controller, MessagingListener listener) throws MessagingException { + public void renderAttachments(Part part, int depth, Message message, Account account, + MessagingController controller, MessagingListener listener) throws MessagingException { if (part.getBody() instanceof Multipart) { Multipart mp = (Multipart) part.getBody(); @@ -264,7 +264,7 @@ public class SingleMessageView extends LinearLayout { // not attachments. Don't show attachment download buttons for them. if (contentDisposition != null && MimeUtility.getHeaderParameter(contentDisposition, null).matches("^(?i:inline)") - && part.getHeader("Content-ID") != null) { + && part.getHeader(MimeHeader.HEADER_CONTENT_ID) != null) { return; } AttachmentView view = (AttachmentView)mInflater.inflate(R.layout.message_view_attachment, null); @@ -275,11 +275,11 @@ public class SingleMessageView extends LinearLayout { } } - public void addAttachment(View attachmentView) { mAttachments.addView(attachmentView); mAttachments.setVisibility(View.VISIBLE); } + public void zoom(KeyEvent event) { if (mScreenReaderEnabled) { mAccessibleMessageContentView.zoomIn(); @@ -291,11 +291,11 @@ public class SingleMessageView extends LinearLayout { } } } + public void beginSelectingText() { mMessageContentView.emulateShiftHeld(); } - public void resetView() { setLoadPictures(false); mMessageContentView.scrollTo(0, 0); @@ -312,5 +312,4 @@ public class SingleMessageView extends LinearLayout { AttachmentView.AttachmentFileDownloadCallback attachmentCallback) { this.attachmentCallback = attachmentCallback; } - }