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:
parent
96b93f7327
commit
a826f33eb3
@ -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();
|
||||
}
|
||||
|
@ -62,12 +62,12 @@ public class Identity implements Serializable
|
||||
}
|
||||
|
||||
public synchronized String getReplyTo()
|
||||
{
|
||||
{
|
||||
return replyTo;
|
||||
}
|
||||
|
||||
public synchronized void setReplyTo(String replyTo)
|
||||
{
|
||||
{
|
||||
this.replyTo = replyTo;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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];
|
||||
@ -1501,12 +1501,12 @@ public class MessagingController implements Runnable
|
||||
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();
|
||||
@ -1625,7 +1625,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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
@ -302,64 +302,64 @@ public class ImapStore extends Store
|
||||
|
||||
private List<? extends Folder> listFolders(ImapConnection connection, boolean LSUB) throws IOException, MessagingException
|
||||
{
|
||||
String commandResponse = LSUB ? "LSUB" : "LIST";
|
||||
String commandResponse = LSUB ? "LSUB" : "LIST";
|
||||
|
||||
LinkedList<Folder> folders = new LinkedList<Folder>();
|
||||
LinkedList<Folder> folders = new LinkedList<Folder>();
|
||||
|
||||
List<ImapResponse> responses =
|
||||
connection.executeSimpleCommand(String.format(commandResponse + " \"\" \"%s*\"",
|
||||
getCombinedPrefix()));
|
||||
List<ImapResponse> responses =
|
||||
connection.executeSimpleCommand(String.format(commandResponse + " \"\" \"%s*\"",
|
||||
getCombinedPrefix()));
|
||||
|
||||
for (ImapResponse response : responses)
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
@ -1022,7 +1022,7 @@ public class ImapStore extends Store
|
||||
if (earliestDate != null)
|
||||
{
|
||||
dateSearchString.append(" SINCE ");
|
||||
synchronized(RFC3501_DATE)
|
||||
synchronized (RFC3501_DATE)
|
||||
{
|
||||
dateSearchString.append(RFC3501_DATE.format(earliestDate));
|
||||
}
|
||||
@ -2988,11 +2988,11 @@ public class ImapStore extends Store
|
||||
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);
|
||||
|
@ -434,7 +434,7 @@ public class SmtpTransport extends Transport
|
||||
else
|
||||
{
|
||||
commandToLog = "SMTP >>> " + s;
|
||||
}
|
||||
}
|
||||
Log.d(K9.LOG_TAG, commandToLog);
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ 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)
|
||||
|
Loading…
Reference in New Issue
Block a user