From 7fc921c0b7209d1ed05ee6aafd80b5e518868d72 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 2 Aug 2010 01:27:40 +0000 Subject: [PATCH] astyle --- src/com/fsck/k9/Account.java | 14 ++--- src/com/fsck/k9/activity/MessageView.java | 4 +- .../k9/controller/MessagingController.java | 2 +- src/com/fsck/k9/crypto/Apg.java | 53 ++++++++++--------- .../fsck/k9/mail/internet/MimeUtility.java | 9 ++-- 5 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/com/fsck/k9/Account.java b/src/com/fsck/k9/Account.java index 40c89cb2e..32ed90cd8 100644 --- a/src/com/fsck/k9/Account.java +++ b/src/com/fsck/k9/Account.java @@ -566,13 +566,13 @@ public class Account implements BaseAccount // Always get stats about the INBOX (see issue 1817) if (folder.getName().equals(K9.INBOX) || ( - !folder.getName().equals(getTrashFolderName()) && - !folder.getName().equals(getDraftsFolderName()) && - !folder.getName().equals(getArchiveFolderName()) && - !folder.getName().equals(getSpamFolderName()) && - !folder.getName().equals(getOutboxFolderName()) && - !folder.getName().equals(getSentFolderName()) && - !folder.getName().equals(getErrorFolderName()))) + !folder.getName().equals(getTrashFolderName()) && + !folder.getName().equals(getDraftsFolderName()) && + !folder.getName().equals(getArchiveFolderName()) && + !folder.getName().equals(getSpamFolderName()) && + !folder.getName().equals(getOutboxFolderName()) && + !folder.getName().equals(getSentFolderName()) && + !folder.getName().equals(getErrorFolderName()))) { if (aMode == Account.FolderMode.NONE) { diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index bfee03569..da83dce60 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1080,7 +1080,7 @@ public class MessageView extends K9Activity implements OnClickListener mSpamScrolling.setEnabled(enableSpam); } else - { + { disableMoveButtons(); } @@ -2398,7 +2398,7 @@ public class MessageView extends K9Activity implements OnClickListener if (mCrypto.getSignatureKeyId() != 0) { mCryptoSignatureUserIdRest.setText( - getString(R.string.key_id, Long.toHexString(mCrypto.getSignatureKeyId() & 0xffffffffL))); + getString(R.string.key_id, Long.toHexString(mCrypto.getSignatureKeyId() & 0xffffffffL))); String userId = mCrypto.getSignatureUserId(); if (userId == null) { diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index a12cc7431..6cfd66514 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -4541,7 +4541,7 @@ public class MessagingController implements Runnable { // Do not notify if the user does not have notifications // enabled or if the message has been read - if (!account.isNotifyNewMail() || message.isSet(Flag.SEEN) || ( account.getName() == null) ) + if (!account.isNotifyNewMail() || message.isSet(Flag.SEEN) || (account.getName() == null)) { return false; } diff --git a/src/com/fsck/k9/crypto/Apg.java b/src/com/fsck/k9/crypto/Apg.java index c1e4df804..d87f3551a 100644 --- a/src/com/fsck/k9/crypto/Apg.java +++ b/src/com/fsck/k9/crypto/Apg.java @@ -33,14 +33,14 @@ public class Apg extends CryptoProvider public static final String AUTHORITY = "org.thialfihar.android.apg.provider"; public static final Uri CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID = - Uri.parse("content://" + AUTHORITY + "/key_rings/secret/key_id/"); + Uri.parse("content://" + AUTHORITY + "/key_rings/secret/key_id/"); public static final Uri CONTENT_URI_SECRET_KEY_RING_BY_EMAILS = - Uri.parse("content://" + AUTHORITY + "/key_rings/secret/emails/"); + Uri.parse("content://" + AUTHORITY + "/key_rings/secret/emails/"); public static final Uri CONTENT_URI_PUBLIC_KEY_RING_BY_KEY_ID = - Uri.parse("content://" + AUTHORITY + "/key_rings/public/key_id/"); + Uri.parse("content://" + AUTHORITY + "/key_rings/public/key_id/"); public static final Uri CONTENT_URI_PUBLIC_KEY_RING_BY_EMAILS = - Uri.parse("content://" + AUTHORITY + "/key_rings/public/emails/"); + Uri.parse("content://" + AUTHORITY + "/key_rings/public/emails/"); public static class Intent { @@ -83,12 +83,12 @@ public class Apg extends CryptoProvider public static final int SELECT_SECRET_KEY = 0x21070004; public static Pattern PGP_MESSAGE = - Pattern.compile(".*?(-----BEGIN PGP MESSAGE-----.*?-----END PGP MESSAGE-----).*", - Pattern.DOTALL); + Pattern.compile(".*?(-----BEGIN PGP MESSAGE-----.*?-----END PGP MESSAGE-----).*", + Pattern.DOTALL); public static Pattern PGP_SIGNED_MESSAGE = - Pattern.compile(".*?(-----BEGIN PGP SIGNED MESSAGE-----.*?-----BEGIN PGP SIGNATURE-----.*?-----END PGP SIGNATURE-----).*", - Pattern.DOTALL); + Pattern.compile(".*?(-----BEGIN PGP SIGNED MESSAGE-----.*?-----BEGIN PGP SIGNATURE-----.*?-----END PGP SIGNATURE-----).*", + Pattern.DOTALL); public static Apg createInstance(Account account) { @@ -172,11 +172,11 @@ public class Apg extends CryptoProvider try { Uri contentUri = Uri.withAppendedPath( - Apg.CONTENT_URI_PUBLIC_KEY_RING_BY_EMAILS, - emails); + Apg.CONTENT_URI_PUBLIC_KEY_RING_BY_EMAILS, + emails); Cursor c = activity.getContentResolver().query(contentUri, - new String[] { "master_key_id" }, - null, null, null); + new String[] { "master_key_id" }, + null, null, null); if (c != null) { while (c.moveToNext()) @@ -240,8 +240,8 @@ public class Apg extends CryptoProvider Uri contentUri = Uri.withAppendedPath(Apg.CONTENT_URI_SECRET_KEY_RING_BY_EMAILS, email); Cursor c = context.getContentResolver().query(contentUri, - new String[] { "master_key_id" }, - null, null, null); + new String[] { "master_key_id" }, + null, null, null); if (c != null && c.getCount() > 0) { ids = new long[c.getCount()]; @@ -280,11 +280,11 @@ public class Apg extends CryptoProvider try { Uri contentUri = ContentUris.withAppendedId( - Apg.CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID, - keyId); + Apg.CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID, + keyId); Cursor c = context.getContentResolver().query(contentUri, - new String[] { "user_id" }, - null, null, null); + new String[] { "user_id" }, + null, null, null); if (c != null && c.moveToFirst()) { userId = c.getString(0); @@ -355,7 +355,8 @@ public class Apg extends CryptoProvider mEncryptedData = data.getStringExtra(Apg.EXTRA_ENCRYPTED_MESSAGE); // this was a stupid bug in an earlier version, just gonna leave this in for an APG // version or two - if (mEncryptedData == null) { + if (mEncryptedData == null) + { mEncryptedData = data.getStringExtra(Apg.EXTRA_DECRYPTED_MESSAGE); } if (mEncryptedData != null) @@ -450,7 +451,8 @@ public class Apg extends CryptoProvider public boolean isEncrypted(Message message) { String data = null; - try { + try + { Part part = MimeUtility.findFirstPartByMimeType(message, "text/plain"); if (part == null) { @@ -479,7 +481,8 @@ public class Apg extends CryptoProvider public boolean isSigned(Message message) { String data = null; - try { + try + { Part part = MimeUtility.findFirstPartByMimeType(message, "text/plain"); if (part == null) { @@ -532,11 +535,11 @@ public class Apg extends CryptoProvider { // try out one content provider to check permissions Uri contentUri = ContentUris.withAppendedId( - Apg.CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID, - 12345); + Apg.CONTENT_URI_SECRET_KEY_RING_BY_KEY_ID, + 12345); Cursor c = context.getContentResolver().query(contentUri, - new String[] { "user_id" }, - null, null, null); + new String[] { "user_id" }, + null, null, null); if (c != null) { c.close(); diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 29e543275..f8472d544 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -390,7 +390,7 @@ public class MimeUtility IOUtils.copy(in, out); in.close(); in = null; // we want all of our memory back, and close might not release - // Cargo culted from AOSP - This disagrees with the platform docs + // Cargo culted from AOSP - This disagrees with the platform docs /* * Convert and return as new String @@ -523,7 +523,8 @@ public class MimeUtility * If the part is HTML and it got this far it's part of a mixed (et * al) and should be rendered inline. */ - else if (isPartTextualBody(part)) { + else if (isPartTextualBody(part)) + { viewables.add(part); } else @@ -534,7 +535,7 @@ public class MimeUtility } - public static Boolean isPartTextualBody (Part part) throws MessagingException + public static Boolean isPartTextualBody(Part part) throws MessagingException { String disposition = part.getDisposition(); String dispositionType = null; @@ -549,7 +550,7 @@ public class MimeUtility * A best guess that this part is intended to be an attachment and not inline. */ boolean attachment = ("attachment".equalsIgnoreCase(dispositionType) - || (dispositionFilename != null)); + || (dispositionFilename != null)); if ((!attachment) && (part.getMimeType().equalsIgnoreCase("text/html"))) {