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

find src/com/fsck/ -name \*.java|xargs astyle --style=ansi

--mode=java --indent-switches --indent=spaces=4 --convert-tabs
--unpad=paren
This commit is contained in:
Jesse Vincent 2010-07-06 10:29:26 +00:00
parent 96b93f7327
commit a826f33eb3
12 changed files with 153 additions and 141 deletions

View File

@ -111,7 +111,7 @@ public class Account implements BaseAccount
* Name of the folder that was last selected for a copy or move operation.
*
* Note: For now this value isn't persisted. So it will be reset when
* K-9 Mail is restarted.
* K-9 Mail is restarted.
*/
private String lastSelectedFolderName = null;
@ -240,9 +240,9 @@ public class Account implements BaseAccount
goToUnreadMessageSearch = preferences.getPreferences().getBoolean(mUuid + ".goToUnreadMessageSearch",
false);
subscribedFoldersOnly = preferences.getPreferences().getBoolean(mUuid + ".subscribedFoldersOnly",
false);
false);
maximumPolledMessageAge = preferences.getPreferences().getInt(mUuid
+ ".maximumPolledMessageAge", -1);
+ ".maximumPolledMessageAge", -1);
mQuotePrefix = preferences.getPreferences().getString(mUuid + ".quotePrefix", DEFAULT_QUOTE_PREFIX);
for (String type : networkTypes)
{
@ -549,13 +549,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()) == false &&
folder.getName().equals(getDraftsFolderName()) == false &&
folder.getName().equals(getArchiveFolderName()) == false &&
folder.getName().equals(getSpamFolderName()) == false &&
folder.getName().equals(getOutboxFolderName()) == false &&
folder.getName().equals(getSentFolderName()) == false &&
folder.getName().equals(getErrorFolderName()) == false))
folder.getName().equals(getTrashFolderName()) == false &&
folder.getName().equals(getDraftsFolderName()) == false &&
folder.getName().equals(getArchiveFolderName()) == false &&
folder.getName().equals(getSpamFolderName()) == false &&
folder.getName().equals(getOutboxFolderName()) == false &&
folder.getName().equals(getSentFolderName()) == false &&
folder.getName().equals(getErrorFolderName()) == false))
{
if (aMode == Account.FolderMode.NONE)
{
@ -1346,23 +1346,23 @@ public class Account implements BaseAccount
now.add(Calendar.DATE, age * -1);
}
else switch (age)
{
case 28:
now.add(Calendar.MONTH, -1);
break;
case 56:
now.add(Calendar.MONTH, -2);
break;
case 84:
now.add(Calendar.MONTH, -3);
break;
case 168:
now.add(Calendar.MONTH, -6);
break;
case 365:
now.add(Calendar.YEAR, -1);
break;
}
{
case 28:
now.add(Calendar.MONTH, -1);
break;
case 56:
now.add(Calendar.MONTH, -2);
break;
case 84:
now.add(Calendar.MONTH, -3);
break;
case 168:
now.add(Calendar.MONTH, -6);
break;
case 365:
now.add(Calendar.YEAR, -1);
break;
}
return now.getTime();
}

View File

@ -62,12 +62,12 @@ public class Identity implements Serializable
}
public synchronized String getReplyTo()
{
{
return replyTo;
}
public synchronized void setReplyTo(String replyTo)
{
{
this.replyTo = replyTo;
}

View File

@ -290,7 +290,7 @@ public class ChooseFolder extends K9ListActivity
}
}
else if (name.equals(mFolder) ||
(K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name)))
(K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name)))
{
selectedFolder = position;
}

View File

@ -1256,25 +1256,25 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
{
case DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE:
return new AlertDialog.Builder(this)
.setTitle(R.string.save_or_discard_draft_message_dlg_title)
.setMessage(R.string.save_or_discard_draft_message_instructions_fmt)
.setPositiveButton(R.string.save_draft_action, new DialogInterface.OnClickListener()
.setTitle(R.string.save_or_discard_draft_message_dlg_title)
.setMessage(R.string.save_or_discard_draft_message_instructions_fmt)
.setPositiveButton(R.string.save_draft_action, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
public void onClick(DialogInterface dialog, int whichButton)
{
dismissDialog(1);
onSave();
}
})
.setNegativeButton(R.string.discard_action, new DialogInterface.OnClickListener()
dismissDialog(1);
onSave();
}
})
.setNegativeButton(R.string.discard_action, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton)
{
public void onClick(DialogInterface dialog, int whichButton)
{
dismissDialog(1);
onDiscard();
}
})
.create();
dismissDialog(1);
onDiscard();
}
})
.create();
}
return super.onCreateDialog(id);
}
@ -1416,7 +1416,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
// the replaceAll() invocation.
final String escapedPrefix = prefix.replaceAll("(\\\\|\\$)", "\\\\$1");
quotedText += MimeUtility.getTextFromPart(part).replaceAll(
"(?m)^", escapedPrefix);
"(?m)^", escapedPrefix);
quotedText = quotedText.replaceAll("\\\r", "");
mQuotedText.setText(quotedText);

View File

@ -1505,7 +1505,7 @@ public class MessageList
break;
case R.id.same_sender:
MessageList.actionHandle(MessageList.this,
MessageList.actionHandle(MessageList.this,
"From "+holder.sender, holder.sender, true,
null, null);

View File

@ -1035,7 +1035,7 @@ public class MessageView extends K9Activity implements OnClickListener
}
showNextMessage();
MessagingController.getInstance(getApplication())
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
}
private void onSpam()
@ -1060,7 +1060,7 @@ public class MessageView extends K9Activity implements OnClickListener
}
showNextMessage();
MessagingController.getInstance(getApplication())
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
}
private void showNextMessage()

View File

@ -264,7 +264,7 @@ public class AccountSettings extends K9PreferenceActivity
return false;
}
});
mSyncRemoteDeletions = (CheckBoxPreference) findPreference(PREFERENCE_SYNC_REMOTE_DELETIONS);
mSyncRemoteDeletions.setChecked(mAccount.syncRemoteDeletions());

View File

@ -218,7 +218,7 @@ public class MessagingController implements Runnable
{
return true;
}
return false;
}
@ -854,7 +854,7 @@ public class MessagingController implements Runnable
if (isMessageSuppressed(message.getFolder().getAccount(), message.getFolder().getName(), message) == false)
{
List<Message> messages = new ArrayList<Message>();
messages.add(message);
stats.unreadMessageCount += (message.isSet(Flag.SEEN) == false) ? 1 : 0;
stats.flaggedMessageCount += (message.isSet(Flag.FLAGGED)) ? 1 : 0;
@ -1121,7 +1121,7 @@ public class MessagingController implements Runnable
}
}
/*
* Get the remote message count.
*/
@ -1131,7 +1131,7 @@ public class MessagingController implements Runnable
if (visibleLimit < 1)
{
visibleLimit = K9.DEFAULT_VISIBLE_LIMIT;
visibleLimit = K9.DEFAULT_VISIBLE_LIMIT;
}
Message[] remoteMessageArray = new Message[0];
@ -1184,7 +1184,7 @@ public class MessagingController implements Runnable
if (remoteUidMap.get(localMessage.getUid()) == null && !localMessage.isSet(Flag.DELETED))
{
localMessage.setFlag(Flag.X_DESTROYED, true);
for (MessagingListener l : getListeners())
{
l.synchronizeMailboxRemovedMessage(account, folder, localMessage);
@ -1495,18 +1495,18 @@ public class MessagingController implements Runnable
}
if (message.isSet(Flag.DELETED) || message.olderThan(earliestDate))
{
if (K9.DEBUG)
{
if (message.isSet(Flag.DELETED))
{
Log.v(K9.LOG_TAG, "Newly downloaded message " + account + ":" + folder + ":" + message.getUid()
+ " was already deleted on server, skipping");
+ " was already deleted on server, skipping");
}
else
{
Log.d(K9.LOG_TAG, "Newly downloaded message " + message.getUid() + " is older than "
+ earliestDate + ", skipping");
+ earliestDate + ", skipping");
}
}
progress.incrementAndGet();
@ -1516,7 +1516,7 @@ public class MessagingController implements Runnable
}
return;
}
if (message.getSize() > (MAX_SMALL_MESSAGE_SIZE))
{
largeMessages.add(message);
@ -1625,10 +1625,10 @@ public class MessagingController implements Runnable
if (K9.DEBUG)
{
Log.d(K9.LOG_TAG, "Message " + message.getUid() + " is older than "
+ earliestDate + ", hence not saving");
+ earliestDate + ", hence not saving");
}
progress.incrementAndGet();
return;
}
@ -1702,7 +1702,7 @@ public class MessagingController implements Runnable
if (K9.DEBUG)
{
Log.d(K9.LOG_TAG, "Message " + message.getUid() + " is older than "
+ earliestDate + ", hence not saving");
+ earliestDate + ", hence not saving");
}
progress.incrementAndGet();
@ -1725,7 +1725,7 @@ public class MessagingController implements Runnable
*/
remoteFolder.fetch(new Message[] { message }, fp, null);
// Store the updated message locally
localFolder.appendMessages(new Message[] { message });
@ -4548,8 +4548,8 @@ public class MessagingController implements Runnable
String folderName = folder.getName();
if (!K9.INBOX.equals(folderName) &&
(account.getTrashFolderName().equals(folderName)
|| account.getDraftsFolderName().equals(folderName)
|| account.getSentFolderName().equals(folderName)))
|| account.getDraftsFolderName().equals(folderName)
|| account.getSentFolderName().equals(folderName)))
{
return false;
}
@ -4636,28 +4636,40 @@ public class MessagingController implements Runnable
if (account.isVibrate())
{
int times = account.getVibrateTimes();
long[] pattern1 = new long[]{100,200};
long[] pattern2 = new long[]{100,500};
long[] pattern3 = new long[]{200,200};
long[] pattern4 = new long[]{200,500};
long[] pattern5 = new long[]{500,500};
long[] pattern1 = new long[] {100,200};
long[] pattern2 = new long[] {100,500};
long[] pattern3 = new long[] {200,200};
long[] pattern4 = new long[] {200,500};
long[] pattern5 = new long[] {500,500};
long[] src = null;
switch (account.getVibratePattern())
{
case 1: src = pattern1; break;
case 2: src = pattern2; break;
case 3: src = pattern3; break;
case 4: src = pattern4; break;
case 5: src = pattern5; break;
case 1:
src = pattern1;
break;
case 2:
src = pattern2;
break;
case 3:
src = pattern3;
break;
case 4:
src = pattern4;
break;
case 5:
src = pattern5;
break;
default:
notif.defaults |= Notification.DEFAULT_VIBRATE;
break;
}
if (src != null) {
if (src != null)
{
long[] dest = new long[src.length * times];
for (int n = 0; n < times; n++) {
for (int n = 0; n < times; n++)
{
System.arraycopy(src, 0, dest, n * src.length, src.length);
}
notif.vibrate = dest;

View File

@ -22,7 +22,7 @@ public abstract class Message implements Part, Body
protected Date mInternalDate;
protected Folder mFolder;
public boolean olderThan(Date earliestDate)
{
if (earliestDate == null)

View File

@ -92,7 +92,7 @@ public class ImapStore extends Store
private volatile String mPathPrefix;
private volatile String mCombinedPrefix = null;
private volatile String mPathDelimeter = null;
private static final SimpleDateFormat RFC3501_DATE = new SimpleDateFormat("dd-MMM-yyyy", Locale.US);
private LinkedList<ImapConnection> mConnections =
@ -278,7 +278,7 @@ public class ImapStore extends Store
if (subscribedFolderNames.contains(folder.getName()))
{
resultFolders.add(folder);
}
}
}
return resultFolders;
}
@ -298,69 +298,69 @@ public class ImapStore extends Store
releaseConnection(connection);
}
}
private List<? extends Folder> listFolders(ImapConnection connection, boolean LSUB) throws IOException, MessagingException
{
String commandResponse = LSUB ? "LSUB" : "LIST";
LinkedList<Folder> folders = new LinkedList<Folder>();
String commandResponse = LSUB ? "LSUB" : "LIST";
List<ImapResponse> responses =
connection.executeSimpleCommand(String.format(commandResponse + " \"\" \"%s*\"",
getCombinedPrefix()));
LinkedList<Folder> folders = new LinkedList<Folder>();
for (ImapResponse response : responses)
List<ImapResponse> responses =
connection.executeSimpleCommand(String.format(commandResponse + " \"\" \"%s*\"",
getCombinedPrefix()));
for (ImapResponse response : responses)
{
if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse))
{
if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse))
boolean includeFolder = true;
String folder = decodeFolderName(response.getString(3));
if (mPathDelimeter == null)
{
boolean includeFolder = true;
String folder = decodeFolderName(response.getString(3));
mPathDelimeter = response.getString(2);
mCombinedPrefix = null;
}
if (mPathDelimeter == null)
{
mPathDelimeter = response.getString(2);
mCombinedPrefix = null;
}
if (folder.equalsIgnoreCase(K9.INBOX))
{
continue;
}
else
{
if (folder.equalsIgnoreCase(K9.INBOX))
if (getCombinedPrefix().length() > 0)
{
continue;
}
else
{
if (getCombinedPrefix().length() > 0)
if (folder.length() >= getCombinedPrefix().length())
{
if (folder.length() >= getCombinedPrefix().length())
{
folder = folder.substring(getCombinedPrefix().length());
}
if (!decodeFolderName(response.getString(3)).equalsIgnoreCase(getCombinedPrefix() + folder))
{
includeFolder = false;
}
folder = folder.substring(getCombinedPrefix().length());
}
}
ImapList attributes = response.getList(1);
for (int i = 0, count = attributes.size(); i < count; i++)
{
String attribute = attributes.getString(i);
if (attribute.equalsIgnoreCase("\\NoSelect"))
if (!decodeFolderName(response.getString(3)).equalsIgnoreCase(getCombinedPrefix() + folder))
{
includeFolder = false;
}
}
if (includeFolder)
}
ImapList attributes = response.getList(1);
for (int i = 0, count = attributes.size(); i < count; i++)
{
String attribute = attributes.getString(i);
if (attribute.equalsIgnoreCase("\\NoSelect"))
{
folders.add(getFolder(folder));
includeFolder = false;
}
}
if (includeFolder)
{
folders.add(getFolder(folder));
}
}
folders.add(getFolder("INBOX"));
return folders;
}
folders.add(getFolder("INBOX"));
return folders;
}
@Override
@ -1022,13 +1022,13 @@ public class ImapStore extends Store
if (earliestDate != null)
{
dateSearchString.append(" SINCE ");
synchronized(RFC3501_DATE)
synchronized (RFC3501_DATE)
{
dateSearchString.append(RFC3501_DATE.format(earliestDate));
}
}
ImapSearcher searcher = new ImapSearcher()
{
public List<ImapResponse> search() throws IOException, MessagingException
@ -2850,7 +2850,7 @@ public class ImapStore extends Store
conn.setReadTimeout(Store.SOCKET_READ_TIMEOUT);
sendContinuation("DONE");
}
}
}
@ -2906,7 +2906,7 @@ public class ImapStore extends Store
receiver.pushError("IMAP server is not IDLE capable: " + conn.toString(), null);
throw new MessagingException("IMAP server is not IDLE capable:" + conn.toString());
}
if (stop.get() != true && mAccount.isPushPollOnConnect() && (conn != oldConnection || needsPoll.getAndSet(false) == true))
{
List<ImapResponse> untaggedResponses = new ArrayList<ImapResponse>(storedUntaggedResponses);
@ -2987,12 +2987,12 @@ public class ImapStore extends Store
receiver.setPushActive(getName(), true);
idling.set(true);
doneSent.set(false);
if (conn == null)
{
throw new MessagingException("No connection available for idling");
}
conn.setReadTimeout((getAccount().getIdleRefreshMinutes() * 60 * 1000) + IDLE_READ_TIMEOUT_INCREMENT);
if (conn == null)
{
throw new MessagingException("No connection available for idling");
}
conn.setReadTimeout((getAccount().getIdleRefreshMinutes() * 60 * 1000) + IDLE_READ_TIMEOUT_INCREMENT);
untaggedResponses = executeSimpleCommand(COMMAND_IDLE, false, ImapFolderPusher.this);
idling.set(false);
delayTime.set(NORMAL_DELAY_TIME);

View File

@ -369,7 +369,7 @@ public class WebDavStore extends Store
buffer.append("<?xml version='1.0' ?>");
buffer.append("<a:searchrequest xmlns:a='DAV:'><a:sql>\r\n");
buffer.append("SELECT \"DAV:uid\", \"DAV:ishidden\"\r\n");
buffer.append(" FROM SCOPE('hierarchical traversal of \""+this.mUrl+"\"')\r\n");
buffer.append(" FROM SCOPE('hierarchical traversal of \""+this.mUrl+"\"')\r\n");
buffer.append(" WHERE \"DAV:ishidden\"=False AND \"DAV:isfolder\"=True\r\n");
buffer.append("</a:sql></a:searchrequest>\r\n");
return buffer.toString();

View File

@ -434,7 +434,7 @@ public class SmtpTransport extends Transport
else
{
commandToLog = "SMTP >>> " + s;
}
}
Log.d(K9.LOG_TAG, commandToLog);
}
@ -474,9 +474,9 @@ public class SmtpTransport extends Transport
private List<String> executeSimpleCommand(String command) throws IOException, MessagingException
{
return executeSimpleCommand(command, false);
return executeSimpleCommand(command, false);
}
private List<String> executeSimpleCommand(String command, boolean sensitive)
throws IOException, MessagingException
{