1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 05:02:26 -05:00

Use MimeHeader.* constants when referring to content headers. Minor whitespace changes.

This commit is contained in:
Andrew Chen 2011-11-02 08:34:06 -07:00
parent ea05f3b5d0
commit f884e967c9
3 changed files with 10 additions and 11 deletions

View File

@ -981,7 +981,7 @@ public class MimeUtility {
} }
} }
} }
String[] header = part.getHeader("Content-ID"); String[] header = part.getHeader(MimeHeader.HEADER_CONTENT_ID);
if (header != null) { if (header != null) {
for (String s : header) { for (String s : header) {
if (s.equals(contentId)) { if (s.equals(contentId)) {

View File

@ -88,8 +88,8 @@ public class LocalStore extends Store implements Serializable {
set.add("From"); set.add("From");
set.add("In-Reply-To"); set.add("In-Reply-To");
set.add("References"); set.add("References");
set.add("Content-ID"); set.add(MimeHeader.HEADER_CONTENT_ID);
set.add("Content-Disposition"); set.add(MimeHeader.HEADER_CONTENT_DISPOSITION);
set.add("User-Agent"); set.add("User-Agent");
HEADERS_TO_SAVE = Collections.unmodifiableSet(set); HEADERS_TO_SAVE = Collections.unmodifiableSet(set);
} }

View File

@ -24,6 +24,7 @@ import com.fsck.k9.crypto.PgpData;
import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.Contacts;
import com.fsck.k9.helper.Utility; import com.fsck.k9.helper.Utility;
import com.fsck.k9.mail.*; import com.fsck.k9.mail.*;
import com.fsck.k9.mail.internet.MimeHeader;
import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mail.store.LocalStore; import com.fsck.k9.mail.store.LocalStore;
@ -38,7 +39,7 @@ public class SingleMessageView extends LinearLayout {
private MessageWebView mMessageContentView; private MessageWebView mMessageContentView;
private AccessibleWebView mAccessibleMessageContentView; private AccessibleWebView mAccessibleMessageContentView;
private MessageHeader mHeaderContainer; private MessageHeader mHeaderContainer;
private LinearLayout mAttachments; private LinearLayout mAttachments;
private View mShowPicturesSection; private View mShowPicturesSection;
private boolean mShowPictures; private boolean mShowPictures;
private Button mDownloadRemainder; private Button mDownloadRemainder;
@ -249,9 +250,8 @@ public class SingleMessageView extends LinearLayout {
} }
} }
public void renderAttachments(Part part, int depth, public void renderAttachments(Part part, int depth, Message message, Account account,
MessagingController controller, MessagingListener listener) throws MessagingException {
Message message, Account account, MessagingController controller, MessagingListener listener) throws MessagingException {
if (part.getBody() instanceof Multipart) { if (part.getBody() instanceof Multipart) {
Multipart mp = (Multipart) part.getBody(); Multipart mp = (Multipart) part.getBody();
@ -264,7 +264,7 @@ public class SingleMessageView extends LinearLayout {
// not attachments. Don't show attachment download buttons for them. // not attachments. Don't show attachment download buttons for them.
if (contentDisposition != null && if (contentDisposition != null &&
MimeUtility.getHeaderParameter(contentDisposition, null).matches("^(?i:inline)") MimeUtility.getHeaderParameter(contentDisposition, null).matches("^(?i:inline)")
&& part.getHeader("Content-ID") != null) { && part.getHeader(MimeHeader.HEADER_CONTENT_ID) != null) {
return; return;
} }
AttachmentView view = (AttachmentView)mInflater.inflate(R.layout.message_view_attachment, null); 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) { public void addAttachment(View attachmentView) {
mAttachments.addView(attachmentView); mAttachments.addView(attachmentView);
mAttachments.setVisibility(View.VISIBLE); mAttachments.setVisibility(View.VISIBLE);
} }
public void zoom(KeyEvent event) { public void zoom(KeyEvent event) {
if (mScreenReaderEnabled) { if (mScreenReaderEnabled) {
mAccessibleMessageContentView.zoomIn(); mAccessibleMessageContentView.zoomIn();
@ -291,11 +291,11 @@ public class SingleMessageView extends LinearLayout {
} }
} }
} }
public void beginSelectingText() { public void beginSelectingText() {
mMessageContentView.emulateShiftHeld(); mMessageContentView.emulateShiftHeld();
} }
public void resetView() { public void resetView() {
setLoadPictures(false); setLoadPictures(false);
mMessageContentView.scrollTo(0, 0); mMessageContentView.scrollTo(0, 0);
@ -312,5 +312,4 @@ public class SingleMessageView extends LinearLayout {
AttachmentView.AttachmentFileDownloadCallback attachmentCallback) { AttachmentView.AttachmentFileDownloadCallback attachmentCallback) {
this.attachmentCallback = attachmentCallback; this.attachmentCallback = attachmentCallback;
} }
} }