1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-12 04:25:08 -05:00

ant astyle

This commit is contained in:
Jesse Vincent 2011-03-22 18:07:32 +11:00
parent 81644d0f4b
commit e19162cb86
10 changed files with 100 additions and 104 deletions

View File

@ -37,8 +37,7 @@ public class ActivityListener extends MessagingListener {
String displayName = mLoadingFolderName; String displayName = mLoadingFolderName;
if (K9.INBOX.equalsIgnoreCase(displayName)) { if (K9.INBOX.equalsIgnoreCase(displayName)) {
displayName = context.getString(R.string.special_mailbox_name_inbox); displayName = context.getString(R.string.special_mailbox_name_inbox);
} } else if ((mAccount != null) && mAccount.getOutboxFolderName().equals(displayName)) {
else if ((mAccount != null) && mAccount.getOutboxFolderName().equals(displayName)) {
displayName = context.getString(R.string.special_mailbox_name_outbox); displayName = context.getString(R.string.special_mailbox_name_outbox);
} }

View File

@ -313,7 +313,7 @@ public class FolderList extends K9ListActivity {
if (previousData != null) { if (previousData != null) {
mAdapter.mFolders = (ArrayList<FolderInfoHolder>) previousData; mAdapter.mFolders = (ArrayList<FolderInfoHolder>) previousData;
mAdapter.mFilteredFolders = Collections.unmodifiableList(mAdapter.mFolders); mAdapter.mFilteredFolders = Collections.unmodifiableList(mAdapter.mFolders);
} }
} }
@ -1029,7 +1029,7 @@ public class FolderList extends K9ListActivity {
return getItemView(position, convertView, parent); return getItemView(position, convertView, parent);
} else { } else {
Log.e(K9.LOG_TAG, "getView with illegal positon=" + position Log.e(K9.LOG_TAG, "getView with illegal positon=" + position
+ " called! count is only " + getCount()); + " called! count is only " + getCount());
return null; return null;
} }
} }
@ -1136,77 +1136,77 @@ public class FolderList extends K9ListActivity {
return true; return true;
} }
public void setFilter(final Filter filter) { public void setFilter(final Filter filter) {
this.mFilter = filter; this.mFilter = filter;
} }
public Filter getFilter() { public Filter getFilter() {
return mFilter; return mFilter;
} }
/** /**
* Filter to search for occurences of the search-expression in any place of the * Filter to search for occurences of the search-expression in any place of the
* folder-name instead of doing jsut a prefix-search. * folder-name instead of doing jsut a prefix-search.
* *
* @author Marcus@Wolschon.biz * @author Marcus@Wolschon.biz
*/ */
public class FolderListFilter extends Filter { public class FolderListFilter extends Filter {
/** /**
* Do the actual search. * Do the actual search.
* {@inheritDoc} * {@inheritDoc}
* *
* @see #publishResults(CharSequence, FilterResults) * @see #publishResults(CharSequence, FilterResults)
*/ */
@Override @Override
protected FilterResults performFiltering(CharSequence searchTerm) { protected FilterResults performFiltering(CharSequence searchTerm) {
FilterResults results = new FilterResults(); FilterResults results = new FilterResults();
if ((searchTerm == null) || (searchTerm.length() == 0)) { if ((searchTerm == null) || (searchTerm.length() == 0)) {
ArrayList<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders); ArrayList<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders);
results.values = list; results.values = list;
results.count = list.size(); results.count = list.size();
} else { } else {
final String searchTermString = searchTerm.toString().toLowerCase(); final String searchTermString = searchTerm.toString().toLowerCase();
final String[] words = searchTermString.split(" "); final String[] words = searchTermString.split(" ");
final int wordCount = words.length; final int wordCount = words.length;
final ArrayList<FolderInfoHolder> newValues = new ArrayList<FolderInfoHolder>(); final ArrayList<FolderInfoHolder> newValues = new ArrayList<FolderInfoHolder>();
for (final FolderInfoHolder value : mFolders) { for (final FolderInfoHolder value : mFolders) {
if (value.displayName == null) { if (value.displayName == null) {
continue; continue;
} }
final String valueText = value.displayName.toLowerCase(); final String valueText = value.displayName.toLowerCase();
for (int k = 0; k < wordCount; k++) { for (int k = 0; k < wordCount; k++) {
if (valueText.contains(words[k])) { if (valueText.contains(words[k])) {
newValues.add(value); newValues.add(value);
break; break;
} }
} }
} }
results.values = newValues; results.values = newValues;
results.count = newValues.size(); results.count = newValues.size();
} }
return results; return results;
} }
/** /**
* Publish the results to the user-interface. * Publish the results to the user-interface.
* {@inheritDoc} * {@inheritDoc}
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
protected void publishResults(CharSequence constraint, FilterResults results) { protected void publishResults(CharSequence constraint, FilterResults results) {
//noinspection unchecked //noinspection unchecked
mFilteredFolders = Collections.unmodifiableList((ArrayList<FolderInfoHolder>) results.values); mFilteredFolders = Collections.unmodifiableList((ArrayList<FolderInfoHolder>) results.values);
// Send notification that the data set changed now // Send notification that the data set changed now
notifyDataSetChanged(); notifyDataSetChanged();
} }
} }
} }
static class FolderViewHolder { static class FolderViewHolder {

View File

@ -101,24 +101,24 @@ public class FolderListFilter<T> extends Filter {
mFolders.setNotifyOnChange(false); mFolders.setNotifyOnChange(false);
try { try {
//noinspection unchecked //noinspection unchecked
final List<T> folders = (List<T>) results.values; final List<T> folders = (List<T>) results.values;
mFolders.clear(); mFolders.clear();
if (folders != null) { if (folders != null) {
for (T folder : folders) { for (T folder : folders) {
if (folder != null) { if (folder != null) {
mFolders.add(folder); mFolders.add(folder);
} }
} }
} else { } else {
Log.w(K9.LOG_TAG, "FolderListFilter.publishResults - null search-result "); Log.w(K9.LOG_TAG, "FolderListFilter.publishResults - null search-result ");
} }
// Send notification that the data set changed now // Send notification that the data set changed now
mFolders.notifyDataSetChanged(); mFolders.notifyDataSetChanged();
} finally { } finally {
// restore notification status // restore notification status
mFolders.setNotifyOnChange(true); mFolders.setNotifyOnChange(true);
} }
} }

View File

@ -547,10 +547,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
if (!ACTION_EDIT_DRAFT.equals(action)) { if (!ACTION_EDIT_DRAFT.equals(action)) {
String bccAddress = mAccount.getAlwaysBcc(); String bccAddress = mAccount.getAlwaysBcc();
if ((bccAddress != null) && !("".equals(bccAddress))) { if ((bccAddress != null) && !("".equals(bccAddress))) {
String[] bccAddresses = bccAddress.split(","); String[] bccAddresses = bccAddress.split(",");
for (String oneBccAddress : bccAddresses) { for (String oneBccAddress : bccAddresses) {
addAddress(mBccView, new Address(oneBccAddress, "")); addAddress(mBccView, new Address(oneBccAddress, ""));
} }
} }
} }

View File

@ -943,13 +943,13 @@ public class MessageView extends K9Activity implements OnClickListener {
@Override @Override
protected Dialog onCreateDialog(final int id) { protected Dialog onCreateDialog(final int id) {
switch (id) { switch (id) {
case R.id.dialog_confirm_delete: case R.id.dialog_confirm_delete:
return createConfirmDeleteDialog(id); return createConfirmDeleteDialog(id);
case R.id.dialog_attachment_progress: case R.id.dialog_attachment_progress:
ProgressDialog d = new ProgressDialog(this); ProgressDialog d = new ProgressDialog(this);
d.setIndeterminate(true); d.setIndeterminate(true);
d.setTitle(R.string.dialog_attachment_progress_title); d.setTitle(R.string.dialog_attachment_progress_title);
return d; return d;
} }
return super.onCreateDialog(id); return super.onCreateDialog(id);
} }

View File

@ -853,12 +853,10 @@ public class AccountSettings extends K9PreferenceActivity {
// TODO: In the future the call above should be changed to only return remote folders. // TODO: In the future the call above should be changed to only return remote folders.
// For now we just remove the Outbox folder if present. // For now we just remove the Outbox folder if present.
Iterator<? extends Folder> iter = folders.iterator(); Iterator <? extends Folder > iter = folders.iterator();
while (iter.hasNext()) while (iter.hasNext()) {
{
Folder folder = iter.next(); Folder folder = iter.next();
if (mAccount.getOutboxFolderName().equalsIgnoreCase(folder.getName())) if (mAccount.getOutboxFolderName().equalsIgnoreCase(folder.getName())) {
{
iter.remove(); iter.remove();
} }
} }

View File

@ -3016,7 +3016,7 @@ public class MessagingController implements Runnable {
Log.i(K9.LOG_TAG, "Send count for message " + message.getUid() + " is " + count.get()); Log.i(K9.LOG_TAG, "Send count for message " + message.getUid() + " is " + count.get());
if (count.incrementAndGet() > K9.MAX_SEND_ATTEMPTS) { if (count.incrementAndGet() > K9.MAX_SEND_ATTEMPTS) {
Log.e(K9.LOG_TAG, "Send count for message " + message.getUid() + " can't be delivered after "+ K9.MAX_SEND_ATTEMPTS + " attempts. Giving up until the user restarts the device"); Log.e(K9.LOG_TAG, "Send count for message " + message.getUid() + " can't be delivered after " + K9.MAX_SEND_ATTEMPTS + " attempts. Giving up until the user restarts the device");
notifySendTempFailed(account, new MessagingException(message.getSubject())); notifySendTempFailed(account, new MessagingException(message.getSubject()));
continue; continue;
} }

View File

@ -1074,8 +1074,8 @@ public class HtmlConverter {
private static String htmlifyMessageHeader() { private static String htmlifyMessageHeader() {
final String font = K9.messageViewFixedWidthFont() final String font = K9.messageViewFixedWidthFont()
? "monospace" ? "monospace"
: "sans-serif"; : "sans-serif";
return "<pre style=\"white-space: pre-wrap; word-wrap:break-word; font-family: " + font + "\">"; return "<pre style=\"white-space: pre-wrap; word-wrap:break-word; font-family: " + font + "\">";
} }

View File

@ -87,7 +87,7 @@ public class EncoderUtil {
int encodedLength = bEncodedLength(bytes); int encodedLength = bEncodedLength(bytes);
int totalLength = prefix.length() + encodedLength int totalLength = prefix.length() + encodedLength
+ ENC_WORD_SUFFIX.length(); + ENC_WORD_SUFFIX.length();
if (totalLength <= ENCODED_WORD_MAX_LENGTH) { if (totalLength <= ENCODED_WORD_MAX_LENGTH) {
return prefix + org.apache.james.mime4j.codec.EncoderUtil.encodeB(bytes) + ENC_WORD_SUFFIX; return prefix + org.apache.james.mime4j.codec.EncoderUtil.encodeB(bytes) + ENC_WORD_SUFFIX;
} else { } else {
@ -111,7 +111,7 @@ public class EncoderUtil {
int encodedLength = qEncodedLength(bytes); int encodedLength = qEncodedLength(bytes);
int totalLength = prefix.length() + encodedLength int totalLength = prefix.length() + encodedLength
+ ENC_WORD_SUFFIX.length(); + ENC_WORD_SUFFIX.length();
if (totalLength <= ENCODED_WORD_MAX_LENGTH) { if (totalLength <= ENCODED_WORD_MAX_LENGTH) {
return prefix + org.apache.james.mime4j.codec.EncoderUtil.encodeQ(bytes, org.apache.james.mime4j.codec.EncoderUtil.Usage.WORD_ENTITY) + ENC_WORD_SUFFIX; return prefix + org.apache.james.mime4j.codec.EncoderUtil.encodeQ(bytes, org.apache.james.mime4j.codec.EncoderUtil.Usage.WORD_ENTITY) + ENC_WORD_SUFFIX;
} else { } else {

View File

@ -147,8 +147,7 @@ public class MimeHeader {
} }
} }
public void setCharset(String charset) public void setCharset(String charset) {
{
mCharset = charset; mCharset = charset;
} }
} }