From d59600653c6960bb07b278e014d9dad47c734a5f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 18 Jan 2011 00:04:11 +0000 Subject: [PATCH] astyle --- src/com/fsck/k9/activity/MessageView.java | 5 +- src/com/fsck/k9/view/AttachmentView.java | 57 +++++++++++++---------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index c40ffce4f..885921f8b 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -383,8 +383,9 @@ public class MessageView extends K9Activity implements OnClickListener attachment.viewButton.setEnabled(enabled); attachment.downloadButton.setEnabled(enabled); - if (enabled) { - attachment.checkViewable(); + if (enabled) + { + attachment.checkViewable(); } } } diff --git a/src/com/fsck/k9/view/AttachmentView.java b/src/com/fsck/k9/view/AttachmentView.java index 0ebcd3256..1bc2369a3 100644 --- a/src/com/fsck/k9/view/AttachmentView.java +++ b/src/com/fsck/k9/view/AttachmentView.java @@ -101,8 +101,10 @@ public class AttachmentView extends FrameLayout || (MimeUtility.mimeTypeMatches(contentType, K9.UNACCEPTABLE_ATTACHMENT_VIEW_TYPES))) { viewButton.setVisibility(View.GONE); - } else { - checkViewable(); + } + else + { + checkViewable(); } if ((!MimeUtility.mimeTypeMatches(contentType, K9.ACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES)) || (MimeUtility.mimeTypeMatches(contentType, K9.UNACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES))) @@ -258,28 +260,35 @@ public class AttachmentView extends FrameLayout * attachment.viewButton.setEnabled(enabled); is called. * This method is safe to be called from the UI-thread. */ - public void checkViewable() { - if (viewButton.getVisibility() == View.GONE) { - // nothing to do - return; - } - if (!viewButton.isEnabled()) { - // nothing to do - return; - } - try { - Uri uri = AttachmentProvider.getAttachmentUri( mAccount, part.getAttachmentId()); - Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(uri); - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - if (intent.resolveActivity(mContext.getPackageManager()) == null) { - viewButton.setEnabled(false); - } - // currently we do not cache re result. - } catch (Exception e) { - Log.e(K9.LOG_TAG, "Cannot resolve activity to determine if we shall show the 'view'-button for an attachment", e); - } - } + public void checkViewable() + { + if (viewButton.getVisibility() == View.GONE) + { + // nothing to do + return; + } + if (!viewButton.isEnabled()) + { + // nothing to do + return; + } + try + { + Uri uri = AttachmentProvider.getAttachmentUri( mAccount, part.getAttachmentId()); + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(uri); + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + if (intent.resolveActivity(mContext.getPackageManager()) == null) + { + viewButton.setEnabled(false); + } + // currently we do not cache re result. + } + catch (Exception e) + { + Log.e(K9.LOG_TAG, "Cannot resolve activity to determine if we shall show the 'view'-button for an attachment", e); + } + } public void attachmentSaved(final String filename) {