mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-14 06:00:21 -05:00
find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs
This commit is contained in:
parent
58bb54a588
commit
6061c42ea9
@ -326,7 +326,7 @@ public class Account implements BaseAccount
|
|||||||
mNotificationSetting.setVibrateTimes(prefs.getInt(mUuid + ".vibrateTimes", 5));
|
mNotificationSetting.setVibrateTimes(prefs.getInt(mUuid + ".vibrateTimes", 5));
|
||||||
mNotificationSetting.setRing(prefs.getBoolean(mUuid + ".ring", true));
|
mNotificationSetting.setRing(prefs.getBoolean(mUuid + ".ring", true));
|
||||||
mNotificationSetting.setRingtone(prefs.getString(mUuid + ".ringtone",
|
mNotificationSetting.setRingtone(prefs.getString(mUuid + ".ringtone",
|
||||||
"content://settings/system/notification_sound"));
|
"content://settings/system/notification_sound"));
|
||||||
mNotificationSetting.setLed(prefs.getBoolean(mUuid + ".led", true));
|
mNotificationSetting.setLed(prefs.getBoolean(mUuid + ".led", true));
|
||||||
mNotificationSetting.setLedColor(prefs.getInt(mUuid+".ledColor", mChipColor));
|
mNotificationSetting.setLedColor(prefs.getInt(mUuid+".ledColor", mChipColor));
|
||||||
|
|
||||||
|
@ -695,11 +695,13 @@ public class K9 extends Application
|
|||||||
mChangeRegisteredNameColor = checkboxes;
|
mChangeRegisteredNameColor = checkboxes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getRegisteredNameColor() {
|
public static int getRegisteredNameColor()
|
||||||
|
{
|
||||||
return mRegisteredNameColor;
|
return mRegisteredNameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRegisteredNameColor(int registeredNameColor) {
|
public static void setRegisteredNameColor(int registeredNameColor)
|
||||||
|
{
|
||||||
mRegisteredNameColor = registeredNameColor;
|
mRegisteredNameColor = registeredNameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1022,7 +1022,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
bp.addHeader(MimeHeader.HEADER_CONTENT_TYPE, String.format("%s;\n name=\"%s\"",
|
bp.addHeader(MimeHeader.HEADER_CONTENT_TYPE, String.format("%s;\n name=\"%s\"",
|
||||||
attachment.contentType,
|
attachment.contentType,
|
||||||
EncoderUtil.encodeIfNecessary(attachment.name,
|
EncoderUtil.encodeIfNecessary(attachment.name,
|
||||||
EncoderUtil.Usage.WORD_ENTITY, 7)));
|
EncoderUtil.Usage.WORD_ENTITY, 7)));
|
||||||
|
|
||||||
bp.addHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64");
|
bp.addHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64");
|
||||||
|
|
||||||
@ -1874,37 +1874,40 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
if (quotedText == null)
|
if (quotedText == null)
|
||||||
{
|
{
|
||||||
part = MimeUtility.findFirstPartByMimeType(message, "text/plain");
|
part = MimeUtility.findFirstPartByMimeType(message, "text/plain");
|
||||||
if (part != null) {
|
if (part != null)
|
||||||
|
{
|
||||||
quotedText = MimeUtility.getTextFromPart(part);
|
quotedText = MimeUtility.getTextFromPart(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (quotedText == null)
|
if (quotedText == null)
|
||||||
{
|
{
|
||||||
part = MimeUtility.findFirstPartByMimeType(message, "text/html");
|
part = MimeUtility.findFirstPartByMimeType(message, "text/html");
|
||||||
if (part != null) {
|
if (part != null)
|
||||||
|
{
|
||||||
quotedText = (Html.fromHtml(MimeUtility.getTextFromPart(part))).toString();
|
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)
|
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", "");
|
quotedText = quotedText.replaceAll("\\\r", "");
|
||||||
mQuotedText.setText(text);
|
mQuotedText.setText(text);
|
||||||
mQuotedText.append(quotedText);
|
mQuotedText.append(quotedText);
|
||||||
}
|
}
|
||||||
mQuotedTextBar.setVisibility(View.VISIBLE);
|
mQuotedTextBar.setVisibility(View.VISIBLE);
|
||||||
mQuotedText.setVisibility(View.VISIBLE);
|
mQuotedText.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
if (!mSourceMessageProcessed)
|
if (!mSourceMessageProcessed)
|
||||||
{
|
{
|
||||||
|
@ -74,8 +74,8 @@ import com.fsck.k9.mail.store.LocalStore.LocalFolder;
|
|||||||
* From this Activity the user can perform all standard message operations.
|
* From this Activity the user can perform all standard message operations.
|
||||||
*/
|
*/
|
||||||
public class MessageList
|
public class MessageList
|
||||||
extends K9Activity
|
extends K9Activity
|
||||||
implements OnClickListener, AdapterView.OnItemClickListener
|
implements OnClickListener, AdapterView.OnItemClickListener
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -318,7 +318,8 @@ public class MessageList
|
|||||||
|
|
||||||
private Context context = null;
|
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
|
class MessageListHandler
|
||||||
{
|
{
|
||||||
@ -1883,7 +1884,7 @@ public class MessageList
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
float deltaX = e2.getX() - e1.getX(),
|
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 movedAcross = (Math.abs(deltaX) > Math.abs(deltaY * 4));
|
||||||
boolean steadyHand = (Math.abs(deltaX / deltaY) > 2);
|
boolean steadyHand = (Math.abs(deltaX / deltaY) > 2);
|
||||||
@ -2746,7 +2747,7 @@ public class MessageList
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MessageViewHolder
|
class MessageViewHolder
|
||||||
implements OnCheckedChangeListener
|
implements OnCheckedChangeListener
|
||||||
{
|
{
|
||||||
public TextView subject;
|
public TextView subject;
|
||||||
public TextView preview;
|
public TextView preview;
|
||||||
|
@ -1319,24 +1319,24 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
builder.setTitle(R.string.dialog_confirm_delete_title);
|
builder.setTitle(R.string.dialog_confirm_delete_title);
|
||||||
builder.setMessage(R.string.dialog_confirm_delete_message);
|
builder.setMessage(R.string.dialog_confirm_delete_message);
|
||||||
builder.setPositiveButton(R.string.dialog_confirm_delete_confirm_button,
|
builder.setPositiveButton(R.string.dialog_confirm_delete_confirm_button,
|
||||||
new DialogInterface.OnClickListener()
|
new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
dismissDialog(id);
|
dismissDialog(id);
|
||||||
delete();
|
delete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setNegativeButton(R.string.dialog_confirm_delete_cancel_button,
|
builder.setNegativeButton(R.string.dialog_confirm_delete_cancel_button,
|
||||||
new DialogInterface.OnClickListener()
|
new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
dismissDialog(id);
|
dismissDialog(id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
final AlertDialog dialog = builder.create();
|
final AlertDialog dialog = builder.create();
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ import java.net.URLEncoder;
|
|||||||
* AccountSetupAccountType activity.
|
* AccountSetupAccountType activity.
|
||||||
*/
|
*/
|
||||||
public class AccountSetupBasics extends K9Activity
|
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 String EXTRA_ACCOUNT = "com.fsck.k9.AccountSetupBasics.account";
|
||||||
private final static int DIALOG_NOTE = 1;
|
private final static int DIALOG_NOTE = 1;
|
||||||
|
@ -23,7 +23,7 @@ import java.net.URLDecoder;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
|
public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
|
||||||
OnCheckedChangeListener
|
OnCheckedChangeListener
|
||||||
{
|
{
|
||||||
private static final String EXTRA_ACCOUNT = "account";
|
private static final String EXTRA_ACCOUNT = "account";
|
||||||
|
|
||||||
|
@ -243,11 +243,13 @@ public class Prefs extends K9PreferenceActivity
|
|||||||
{
|
{
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue)
|
public boolean onPreferenceChange(Preference preference, Object newValue)
|
||||||
{
|
{
|
||||||
if ((boolean)(Boolean)newValue == true) {
|
if ((boolean)(Boolean)newValue == true)
|
||||||
|
{
|
||||||
onChooseRegisteredNameColor();
|
onChooseRegisteredNameColor();
|
||||||
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
|
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_changed);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_default);
|
mChangeRegisteredNameColor.setSummary(R.string.global_settings_registered_name_color_default);
|
||||||
}
|
}
|
||||||
mChangeRegisteredNameColor.setChecked((Boolean)newValue);
|
mChangeRegisteredNameColor.setChecked((Boolean)newValue);
|
||||||
|
@ -51,7 +51,7 @@ public class MessageHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void populate(final MessageInfoHolder target, final Message m,
|
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);
|
final Contacts contactHelper = Contacts.getInstance(mContext);
|
||||||
try
|
try
|
||||||
|
@ -23,7 +23,7 @@ public class Utility
|
|||||||
// repetition matching as we might want to strip ML tags. Ex:
|
// repetition matching as we might want to strip ML tags. Ex:
|
||||||
// Re: [foo] Re: RE : [foo] blah blah blah
|
// Re: [foo] Re: RE : [foo] blah blah blah
|
||||||
private static final Pattern RESPONSE_PATTERN = Pattern.compile(
|
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] "
|
* Mailing-list tag pattern to match strings like "[foobar] "
|
||||||
|
@ -38,7 +38,8 @@ public class Address
|
|||||||
private static final Address[] EMPTY_ADDRESS_ARRAY = new Address[0];
|
private static final Address[] EMPTY_ADDRESS_ARRAY = new Address[0];
|
||||||
private static Map<String,String> sContactsName = new ConcurrentHashMap<String, String>();
|
private static Map<String,String> sContactsName = new ConcurrentHashMap<String, String>();
|
||||||
|
|
||||||
public static void clearContactsNameCache() {
|
public static void clearContactsNameCache()
|
||||||
|
{
|
||||||
sContactsName.clear();
|
sContactsName.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,16 +264,18 @@ public class Address
|
|||||||
|
|
||||||
if (name != null && name != NO_ENTRY)
|
if (name != null && name != NO_ENTRY)
|
||||||
{
|
{
|
||||||
if (K9.changeRegisteredNameColor()) {
|
if (K9.changeRegisteredNameColor())
|
||||||
|
{
|
||||||
SpannableString sname = new SpannableString(name);
|
SpannableString sname = new SpannableString(name);
|
||||||
sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
|
sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
|
||||||
0,
|
0,
|
||||||
sname.length(),
|
sname.length(),
|
||||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
);
|
);
|
||||||
return sname;
|
return sname;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,19 +290,22 @@ public class Address
|
|||||||
{
|
{
|
||||||
cursor.moveToFirst();
|
cursor.moveToFirst();
|
||||||
name = contacts.getName(cursor); // name might return null
|
name = contacts.getName(cursor); // name might return null
|
||||||
if (name != null) {
|
if (name != null)
|
||||||
|
{
|
||||||
sContactsName.put(mAddress, name);
|
sContactsName.put(mAddress, name);
|
||||||
|
|
||||||
if (K9.changeRegisteredNameColor()) {
|
if (K9.changeRegisteredNameColor())
|
||||||
|
{
|
||||||
SpannableString sname = new SpannableString(name);
|
SpannableString sname = new SpannableString(name);
|
||||||
sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
|
sname.setSpan(new ForegroundColorSpan(K9.getRegisteredNameColor()),
|
||||||
0,
|
0,
|
||||||
sname.length(),
|
sname.length(),
|
||||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
);
|
);
|
||||||
return sname;
|
return sname;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,8 @@ public class MimeUtility
|
|||||||
String extension = filename.substring(filename.lastIndexOf('.')+1).toLowerCase();
|
String extension = filename.substring(filename.lastIndexOf('.')+1).toLowerCase();
|
||||||
returnedType = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
|
returnedType = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
|
||||||
}
|
}
|
||||||
if (returnedType != null) {
|
if (returnedType != null)
|
||||||
|
{
|
||||||
return returnedType;
|
return returnedType;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2660,13 +2660,13 @@ public class ImapStore extends Store
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<ImapResponse> executeSimpleCommand(String command) throws IOException,
|
public List<ImapResponse> executeSimpleCommand(String command) throws IOException,
|
||||||
ImapException, MessagingException
|
ImapException, MessagingException
|
||||||
{
|
{
|
||||||
return executeSimpleCommand(command, false);
|
return executeSimpleCommand(command, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ImapResponse> executeSimpleCommand(String command, boolean sensitive) throws IOException,
|
public List<ImapResponse> executeSimpleCommand(String command, boolean sensitive) throws IOException,
|
||||||
ImapException, MessagingException
|
ImapException, MessagingException
|
||||||
{
|
{
|
||||||
return executeSimpleCommand(command, sensitive, null);
|
return executeSimpleCommand(command, sensitive, null);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,8 @@ public class LocalStore extends Store implements Serializable
|
|||||||
+ "DELETE FROM headers where old.id = message_id; END;");
|
+ "DELETE FROM headers where old.id = message_id; END;");
|
||||||
}
|
}
|
||||||
else
|
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)
|
if (mDb.getVersion() < 30)
|
||||||
{
|
{
|
||||||
|
@ -530,7 +530,7 @@ public class SmtpTransport extends Transport
|
|||||||
// S: 235 2.0.0 OK Authenticated
|
// S: 235 2.0.0 OK Authenticated
|
||||||
|
|
||||||
private void saslAuthLogin(String username, String password) throws MessagingException,
|
private void saslAuthLogin(String username, String password) throws MessagingException,
|
||||||
AuthenticationFailedException, IOException
|
AuthenticationFailedException, IOException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -550,7 +550,7 @@ public class SmtpTransport extends Transport
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saslAuthPlain(String username, String password) throws MessagingException,
|
private void saslAuthPlain(String username, String password) throws MessagingException,
|
||||||
AuthenticationFailedException, IOException
|
AuthenticationFailedException, IOException
|
||||||
{
|
{
|
||||||
byte[] data = ("\000" + username + "\000" + password).getBytes();
|
byte[] data = ("\000" + username + "\000" + password).getBytes();
|
||||||
data = new Base64().encode(data);
|
data = new Base64().encode(data);
|
||||||
@ -570,7 +570,7 @@ public class SmtpTransport extends Transport
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saslAuthCramMD5(String username, String password) throws MessagingException,
|
private void saslAuthCramMD5(String username, String password) throws MessagingException,
|
||||||
AuthenticationFailedException, IOException
|
AuthenticationFailedException, IOException
|
||||||
{
|
{
|
||||||
List<String> respList = executeSimpleCommand("AUTH CRAM-MD5");
|
List<String> respList = executeSimpleCommand("AUTH CRAM-MD5");
|
||||||
if (respList.size() != 1) throw new AuthenticationFailedException("Unable to negotiate CRAM-MD5");
|
if (respList.size() != 1) throw new AuthenticationFailedException("Unable to negotiate CRAM-MD5");
|
||||||
|
@ -45,15 +45,15 @@ public class CheckBoxListPreference extends DialogPreference
|
|||||||
System.arraycopy(mCheckedItems, 0, mPendingItems, 0, mCheckedItems.length);
|
System.arraycopy(mCheckedItems, 0, mPendingItems, 0, mCheckedItems.length);
|
||||||
|
|
||||||
builder.setMultiChoiceItems(mItems, mPendingItems,
|
builder.setMultiChoiceItems(mItems, mPendingItems,
|
||||||
new DialogInterface.OnMultiChoiceClickListener()
|
new DialogInterface.OnMultiChoiceClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(final DialogInterface dialog, final int which,
|
public void onClick(final DialogInterface dialog, final int which,
|
||||||
final boolean isChecked)
|
final boolean isChecked)
|
||||||
{
|
{
|
||||||
mPendingItems[which] = isChecked;
|
mPendingItems[which] = isChecked;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -54,7 +54,7 @@ public class MessageProvider extends ContentProvider
|
|||||||
* @see {@link ContentProvider#query(Uri, String[], String, String[], String)}
|
* @see {@link ContentProvider#query(Uri, String[], String, String[], String)}
|
||||||
*/
|
*/
|
||||||
Cursor query(Uri uri, String[] projection,
|
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
|
@Override
|
||||||
public Cursor query(final Uri uri, final String[] projection, final String selection,
|
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);
|
return getMessages(projection);
|
||||||
}
|
}
|
||||||
@ -94,13 +94,13 @@ public class MessageProvider extends ContentProvider
|
|||||||
final MessagingController msgController = MessagingController.getInstance(K9.app);
|
final MessagingController msgController = MessagingController.getInstance(K9.app);
|
||||||
|
|
||||||
msgController.searchLocalMessages(integratedInboxAccount, null,
|
msgController.searchLocalMessages(integratedInboxAccount, null,
|
||||||
new MesssageInfoHolderRetrieverListener(queue));
|
new MesssageInfoHolderRetrieverListener(queue));
|
||||||
|
|
||||||
final List<MessageInfoHolder> holders = queue.take();
|
final List<MessageInfoHolder> holders = queue.take();
|
||||||
|
|
||||||
// TODO add sort order parameter
|
// TODO add sort order parameter
|
||||||
Collections.sort(holders, new MessageList.ReverseComparator<MessageInfoHolder>(
|
Collections.sort(holders, new MessageList.ReverseComparator<MessageInfoHolder>(
|
||||||
new MessageList.DateComparator()));
|
new MessageList.DateComparator()));
|
||||||
|
|
||||||
int id = -1;
|
int id = -1;
|
||||||
for (final MessageInfoHolder holder : holders)
|
for (final MessageInfoHolder holder : holders)
|
||||||
@ -109,17 +109,18 @@ public class MessageProvider extends ContentProvider
|
|||||||
id++;
|
id++;
|
||||||
|
|
||||||
cursor.addRow(new Object[]
|
cursor.addRow(new Object[]
|
||||||
{
|
{
|
||||||
id,
|
id,
|
||||||
holder.fullDate,
|
holder.fullDate,
|
||||||
holder.sender,
|
holder.sender,
|
||||||
holder.subject,
|
holder.subject,
|
||||||
holder.preview,
|
holder.preview,
|
||||||
holder.account,
|
holder.account,
|
||||||
holder.uri,
|
holder.uri,
|
||||||
CONTENT_URI + "/delete_message/"
|
CONTENT_URI + "/delete_message/"
|
||||||
+ message.getFolder().getAccount().getAccountNumber() + "/"
|
+ message.getFolder().getAccount().getAccountNumber() + "/"
|
||||||
+ message.getFolder().getName() + "/" + message.getUid() });
|
+ message.getFolder().getName() + "/" + message.getUid()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
@ -140,7 +141,7 @@ public class MessageProvider extends ContentProvider
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor query(final Uri uri, String[] projection, String selection,
|
public Cursor query(final Uri uri, String[] projection, String selection,
|
||||||
String[] selectionArgs, String sortOrder) throws Exception
|
String[] selectionArgs, String sortOrder) throws Exception
|
||||||
{
|
{
|
||||||
return getAllAccounts();
|
return getAllAccounts();
|
||||||
}
|
}
|
||||||
@ -179,7 +180,7 @@ public class MessageProvider extends ContentProvider
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor query(final Uri uri, String[] projection, String selection,
|
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;
|
List<String> segments = null;
|
||||||
int accountId = -1;
|
int accountId = -1;
|
||||||
@ -261,7 +262,7 @@ public class MessageProvider extends ContentProvider
|
|||||||
final Account messageAccount = messageFolder.getAccount();
|
final Account messageAccount = messageFolder.getAccount();
|
||||||
|
|
||||||
helper.populate(messageInfoHolder, message, new FolderInfoHolder(context,
|
helper.populate(messageInfoHolder, message, new FolderInfoHolder(context,
|
||||||
messageFolder, messageAccount), messageAccount);
|
messageFolder, messageAccount), messageAccount);
|
||||||
|
|
||||||
holders.add(messageInfoHolder);
|
holders.add(messageInfoHolder);
|
||||||
}
|
}
|
||||||
@ -419,7 +420,7 @@ public class MessageProvider extends ContentProvider
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor query(final Uri uri, final String[] projection, final String selection,
|
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)
|
if (K9.app == null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user