find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs

This commit is contained in:
Jesse Vincent 2010-10-05 06:04:28 +00:00
parent 58bb54a588
commit 6061c42ea9
20 changed files with 120 additions and 103 deletions

View File

@ -326,7 +326,7 @@ public class Account implements BaseAccount
mNotificationSetting.setVibrateTimes(prefs.getInt(mUuid + ".vibrateTimes", 5));
mNotificationSetting.setRing(prefs.getBoolean(mUuid + ".ring", true));
mNotificationSetting.setRingtone(prefs.getString(mUuid + ".ringtone",
"content://settings/system/notification_sound"));
"content://settings/system/notification_sound"));
mNotificationSetting.setLed(prefs.getBoolean(mUuid + ".led", true));
mNotificationSetting.setLedColor(prefs.getInt(mUuid+".ledColor", mChipColor));

View File

@ -40,7 +40,7 @@ public class K9 extends Application
{
/**
* Called when the Application instance is available and ready.
*
*
* @param application
* The application instance. Never <code>null</code>.
* @throws Exception
@ -55,7 +55,7 @@ public class K9 extends Application
/**
* Components that are interested in knowing when the K9 instance is
* available and ready.
*
*
* @see ApplicationAware
*/
private static List<ApplicationAware> observers = new ArrayList<ApplicationAware>();
@ -547,7 +547,7 @@ public class K9 extends Application
/**
* Register a component to be notified when the {@link K9} instance is ready.
*
*
* @param component
* Never <code>null</code>.
*/
@ -695,11 +695,13 @@ public class K9 extends Application
mChangeRegisteredNameColor = checkboxes;
}
public static int getRegisteredNameColor() {
public static int getRegisteredNameColor()
{
return mRegisteredNameColor;
}
public static void setRegisteredNameColor(int registeredNameColor) {
public static void setRegisteredNameColor(int registeredNameColor)
{
mRegisteredNameColor = registeredNameColor;
}

View File

@ -33,7 +33,7 @@ public class NotificationSetting
/**
* Set the ringtone kill switch. Allow to disable ringtone without losing
* ringtone selection.
*
*
* @param ring
* <code>true</code> to allow ringtones, <code>false</code>
* otherwise.

View File

@ -79,7 +79,7 @@ public class K9ListActivity extends ListActivity
{
currentPosition = listView.getFirstVisiblePosition();
}
if (currentPosition < listView.getCount())
{
listView.setSelection(currentPosition + 1);

View File

@ -1022,7 +1022,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
bp.addHeader(MimeHeader.HEADER_CONTENT_TYPE, String.format("%s;\n name=\"%s\"",
attachment.contentType,
EncoderUtil.encodeIfNecessary(attachment.name,
EncoderUtil.Usage.WORD_ENTITY, 7)));
EncoderUtil.Usage.WORD_ENTITY, 7)));
bp.addHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64");
@ -1874,37 +1874,40 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
if (quotedText == null)
{
part = MimeUtility.findFirstPartByMimeType(message, "text/plain");
if (part != null) {
if (part != null)
{
quotedText = MimeUtility.getTextFromPart(part);
}
}
if (quotedText == null)
{
part = MimeUtility.findFirstPartByMimeType(message, "text/html");
if (part != null) {
if (part != null)
{
quotedText = (Html.fromHtml(MimeUtility.getTextFromPart(part))).toString();
}
}
}
if (quotedText != null)
{
String text = String.format(
getString(R.string.message_compose_fwd_header_fmt),
mSourceMessage.getSubject(),
Address.toString(mSourceMessage.getFrom()),
Address.toString(
mSourceMessage.getRecipients(RecipientType.TO)),
Address.toString(
mSourceMessage.getRecipients(RecipientType.CC)));
if (quotedText != null)
{
String text = String.format(
getString(R.string.message_compose_fwd_header_fmt),
mSourceMessage.getSubject(),
Address.toString(mSourceMessage.getFrom()),
Address.toString(
mSourceMessage.getRecipients(RecipientType.TO)),
Address.toString(
mSourceMessage.getRecipients(RecipientType.CC)));
if (quotedText != null) {
quotedText = quotedText.replaceAll("\\\r", "");
mQuotedText.setText(text);
mQuotedText.append(quotedText);
}
mQuotedTextBar.setVisibility(View.VISIBLE);
mQuotedText.setVisibility(View.VISIBLE);
}
mQuotedTextBar.setVisibility(View.VISIBLE);
mQuotedText.setVisibility(View.VISIBLE);
}
if (!mSourceMessageProcessed)
{

View File

@ -74,8 +74,8 @@ import com.fsck.k9.mail.store.LocalStore.LocalFolder;
* From this Activity the user can perform all standard message operations.
*/
public class MessageList
extends K9Activity
implements OnClickListener, AdapterView.OnItemClickListener
extends K9Activity
implements OnClickListener, AdapterView.OnItemClickListener
{
/**
@ -318,7 +318,8 @@ public class MessageList
private Context context = null;
/* package visibility for faster inner class access */ MessageHelper mMessageHelper = MessageHelper.getInstance(this);
/* package visibility for faster inner class access */
MessageHelper mMessageHelper = MessageHelper.getInstance(this);
class MessageListHandler
{
@ -1883,7 +1884,7 @@ public class MessageList
return true;
float deltaX = e2.getX() - e1.getX(),
deltaY = e2.getY() - e1.getY();
deltaY = e2.getY() - e1.getY();
boolean movedAcross = (Math.abs(deltaX) > Math.abs(deltaY * 4));
boolean steadyHand = (Math.abs(deltaX / deltaY) > 2);
@ -2746,7 +2747,7 @@ public class MessageList
}
class MessageViewHolder
implements OnCheckedChangeListener
implements OnCheckedChangeListener
{
public TextView subject;
public TextView preview;

View File

@ -1319,24 +1319,24 @@ public class MessageView extends K9Activity implements OnClickListener
builder.setTitle(R.string.dialog_confirm_delete_title);
builder.setMessage(R.string.dialog_confirm_delete_message);
builder.setPositiveButton(R.string.dialog_confirm_delete_confirm_button,
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dismissDialog(id);
delete();
}
});
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dismissDialog(id);
delete();
}
});
builder.setNegativeButton(R.string.dialog_confirm_delete_cancel_button,
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dismissDialog(id);
}
});
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dismissDialog(id);
}
});
final AlertDialog dialog = builder.create();
return dialog;
}

View File

@ -35,7 +35,7 @@ import java.net.URLEncoder;
* AccountSetupAccountType activity.
*/
public class AccountSetupBasics extends K9Activity
implements OnClickListener, TextWatcher
implements OnClickListener, TextWatcher
{
private final static String EXTRA_ACCOUNT = "com.fsck.k9.AccountSetupBasics.account";
private final static int DIALOG_NOTE = 1;

View File

@ -23,7 +23,7 @@ import java.net.URLDecoder;
import java.net.URLEncoder;
public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
OnCheckedChangeListener
OnCheckedChangeListener
{
private static final String EXTRA_ACCOUNT = "account";

View File

@ -243,11 +243,13 @@ public class Prefs extends K9PreferenceActivity
{
public boolean onPreferenceChange(Preference preference, Object newValue)
{
if ((boolean)(Boolean)newValue == true) {
if ((boolean)(Boolean)newValue == true)
{
onChooseRegisteredNameColor();
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
}
else {
else
{
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_default);
}
mChangeRegisteredNameColor.setChecked((Boolean)newValue);

View File

@ -4584,7 +4584,7 @@ public class MessagingController implements Runnable
{
subject = context.getString(R.string.general_no_subject);
}
if (from != null)
{
// Show From: address by default
@ -4599,7 +4599,7 @@ public class MessagingController implements Runnable
{
return false;
}
Address[] rcpts = message.getRecipients(Message.RecipientType.TO);
String to = rcpts.length > 0 ? rcpts[0].toFriendly().toString() : null;
if (to != null)
@ -4609,9 +4609,9 @@ public class MessagingController implements Runnable
else
{
messageNotice.append(context.getString(R.string.general_no_sender) + ": "+subject);
}
}
}
}

View File

@ -51,7 +51,7 @@ public class MessageHelper
}
public void populate(final MessageInfoHolder target, final Message m,
final FolderInfoHolder folder, final Account account)
final FolderInfoHolder folder, final Account account)
{
final Contacts contactHelper = Contacts.getInstance(mContext);
try

View File

@ -23,7 +23,7 @@ public class Utility
// repetition matching as we might want to strip ML tags. Ex:
// Re: [foo] Re: RE : [foo] blah blah blah
private static final Pattern RESPONSE_PATTERN = Pattern.compile(
"((Re|Fw|Fwd|Aw|R\\u00E9f\\.)(\\[\\d+\\])?[\\u00A0 ]?: *)+", Pattern.CASE_INSENSITIVE);
"((Re|Fw|Fwd|Aw|R\\u00E9f\\.)(\\[\\d+\\])?[\\u00A0 ]?: *)+", Pattern.CASE_INSENSITIVE);
/**
* Mailing-list tag pattern to match strings like "[foobar] "
@ -406,11 +406,11 @@ public class Utility
* Extract the 'original' subject value, by ignoring leading
* response/forward marker and '[XX]' formatted tags (as many mailing-list
* softwares do).
*
*
* <p>
* Result is also trimmed.
* </p>
*
*
* @param subject
* Never <code>null</code>.
* @return Never <code>null</code>.

View File

@ -38,7 +38,8 @@ public class Address
private static final Address[] EMPTY_ADDRESS_ARRAY = new Address[0];
private static Map<String,String> sContactsName = new ConcurrentHashMap<String, String>();
public static void clearContactsNameCache() {
public static void clearContactsNameCache()
{
sContactsName.clear();
}
@ -263,16 +264,18 @@ public class Address
if (name != null && name != NO_ENTRY)
{
if (K9.changeRegisteredNameColor()) {
if (K9.changeRegisteredNameColor())
{
SpannableString sname = new SpannableString(name);
sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
0,
sname.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
);
);
return sname;
}
else {
else
{
return name;
}
}
@ -287,19 +290,22 @@ public class Address
{
cursor.moveToFirst();
name = contacts.getName(cursor); // name might return null
if (name != null) {
if (name != null)
{
sContactsName.put(mAddress, name);
if (K9.changeRegisteredNameColor()) {
if (K9.changeRegisteredNameColor())
{
SpannableString sname = new SpannableString(name);
sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
0,
sname.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
);
);
return sname;
}
else {
else
{
return name;
}
}

View File

@ -388,7 +388,8 @@ public class MimeUtility
String extension = filename.substring(filename.lastIndexOf('.')+1).toLowerCase();
returnedType = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
}
if (returnedType != null) {
if (returnedType != null)
{
return returnedType;
}
else

View File

@ -2660,13 +2660,13 @@ public class ImapStore extends Store
}
public List<ImapResponse> executeSimpleCommand(String command) throws IOException,
ImapException, MessagingException
ImapException, MessagingException
{
return executeSimpleCommand(command, false);
}
public List<ImapResponse> executeSimpleCommand(String command, boolean sensitive) throws IOException,
ImapException, MessagingException
ImapException, MessagingException
{
return executeSimpleCommand(command, sensitive, null);
}

View File

@ -180,7 +180,8 @@ public class LocalStore extends Store implements Serializable
+ "DELETE FROM headers where old.id = message_id; END;");
}
else
{ // in the case that we're starting out at 29 or newer, run all the needed updates
{
// in the case that we're starting out at 29 or newer, run all the needed updates
if (mDb.getVersion() < 30)
{

View File

@ -530,7 +530,7 @@ public class SmtpTransport extends Transport
// S: 235 2.0.0 OK Authenticated
private void saslAuthLogin(String username, String password) throws MessagingException,
AuthenticationFailedException, IOException
AuthenticationFailedException, IOException
{
try
{
@ -550,7 +550,7 @@ public class SmtpTransport extends Transport
}
private void saslAuthPlain(String username, String password) throws MessagingException,
AuthenticationFailedException, IOException
AuthenticationFailedException, IOException
{
byte[] data = ("\000" + username + "\000" + password).getBytes();
data = new Base64().encode(data);
@ -570,7 +570,7 @@ public class SmtpTransport extends Transport
}
private void saslAuthCramMD5(String username, String password) throws MessagingException,
AuthenticationFailedException, IOException
AuthenticationFailedException, IOException
{
List<String> respList = executeSimpleCommand("AUTH CRAM-MD5");
if (respList.size() != 1) throw new AuthenticationFailedException("Unable to negotiate CRAM-MD5");

View File

@ -45,15 +45,15 @@ public class CheckBoxListPreference extends DialogPreference
System.arraycopy(mCheckedItems, 0, mPendingItems, 0, mCheckedItems.length);
builder.setMultiChoiceItems(mItems, mPendingItems,
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(final DialogInterface dialog, final int which,
final boolean isChecked)
{
mPendingItems[which] = isChecked;
}
});
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(final DialogInterface dialog, final int which,
final boolean isChecked)
{
mPendingItems[which] = isChecked;
}
});
}
@Override

View File

@ -38,7 +38,7 @@ public class MessageProvider extends ContentProvider
{
/**
* The path this instance is able to respond to.
*
*
* @return Never <code>null</code>.
*/
String getPath();
@ -54,7 +54,7 @@ public class MessageProvider extends ContentProvider
* @see {@link ContentProvider#query(Uri, String[], String, String[], String)}
*/
Cursor query(Uri uri, String[] projection,
String selection, String[] selectionArgs, String sortOrder) throws Exception;
String selection, String[] selectionArgs, String sortOrder) throws Exception;
}
/**
@ -71,7 +71,7 @@ public class MessageProvider extends ContentProvider
@Override
public Cursor query(final Uri uri, final String[] projection, final String selection,
final String[] selectionArgs, final String sortOrder) throws Exception
final String[] selectionArgs, final String sortOrder) throws Exception
{
return getMessages(projection);
}
@ -94,13 +94,13 @@ public class MessageProvider extends ContentProvider
final MessagingController msgController = MessagingController.getInstance(K9.app);
msgController.searchLocalMessages(integratedInboxAccount, null,
new MesssageInfoHolderRetrieverListener(queue));
new MesssageInfoHolderRetrieverListener(queue));
final List<MessageInfoHolder> holders = queue.take();
// TODO add sort order parameter
Collections.sort(holders, new MessageList.ReverseComparator<MessageInfoHolder>(
new MessageList.DateComparator()));
new MessageList.DateComparator()));
int id = -1;
for (final MessageInfoHolder holder : holders)
@ -109,17 +109,18 @@ public class MessageProvider extends ContentProvider
id++;
cursor.addRow(new Object[]
{
id,
holder.fullDate,
holder.sender,
holder.subject,
holder.preview,
holder.account,
holder.uri,
CONTENT_URI + "/delete_message/"
+ message.getFolder().getAccount().getAccountNumber() + "/"
+ message.getFolder().getName() + "/" + message.getUid() });
{
id,
holder.fullDate,
holder.sender,
holder.subject,
holder.preview,
holder.account,
holder.uri,
CONTENT_URI + "/delete_message/"
+ message.getFolder().getAccount().getAccountNumber() + "/"
+ message.getFolder().getName() + "/" + message.getUid()
});
}
return cursor;
}
@ -140,7 +141,7 @@ public class MessageProvider extends ContentProvider
@Override
public Cursor query(final Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) throws Exception
String[] selectionArgs, String sortOrder) throws Exception
{
return getAllAccounts();
}
@ -179,7 +180,7 @@ public class MessageProvider extends ContentProvider
@Override
public Cursor query(final Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) throws Exception
String[] selectionArgs, String sortOrder) throws Exception
{
List<String> segments = null;
int accountId = -1;
@ -261,7 +262,7 @@ public class MessageProvider extends ContentProvider
final Account messageAccount = messageFolder.getAccount();
helper.populate(messageInfoHolder, message, new FolderInfoHolder(context,
messageFolder, messageAccount), messageAccount);
messageFolder, messageAccount), messageAccount);
holders.add(messageInfoHolder);
}
@ -419,7 +420,7 @@ public class MessageProvider extends ContentProvider
@Override
public Cursor query(final Uri uri, final String[] projection, final String selection,
final String[] selectionArgs, final String sortOrder)
final String[] selectionArgs, final String sortOrder)
{
if (K9.app == null)
{
@ -477,7 +478,7 @@ public class MessageProvider extends ContentProvider
/**
* Register a {@link QueryHandler} to handle a certain {@link Uri} for
* {@link #query(Uri, String[], String, String[], String)}
*
*
* @param handler
* Never <code>null</code>.
*/