1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-16 22:45:04 -05:00

Merge commit '4.115' into issue-162-new

Conflicts:
	src/com/fsck/k9/K9.java

trivial conflict.
This commit is contained in:
ashley willis 2012-09-11 01:13:01 -05:00
commit b6df5c908b
3 changed files with 37 additions and 3 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest <manifest
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="15013" android:versionCode="15014"
android:versionName="4.114" package="com.fsck.k9" android:versionName="4.115" package="com.fsck.k9"
> >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"

View File

@ -4,6 +4,7 @@ package com.fsck.k9;
import java.io.File; import java.io.File;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue; import java.util.concurrent.SynchronousQueue;
@ -24,6 +25,7 @@ import android.os.Looper;
import android.text.format.Time; import android.text.format.Time;
import android.util.Log; import android.util.Log;
import com.fsck.k9.Account.SortType;
import com.fsck.k9.activity.MessageCompose; import com.fsck.k9.activity.MessageCompose;
import com.fsck.k9.controller.MessagingController; import com.fsck.k9.controller.MessagingController;
import com.fsck.k9.controller.MessagingListener; import com.fsck.k9.controller.MessagingListener;
@ -195,6 +197,8 @@ public class K9 extends Application {
private static boolean useGalleryBugWorkaround = false; private static boolean useGalleryBugWorkaround = false;
private static boolean galleryBuggy; private static boolean galleryBuggy;
private static SortType mSortType;
private static HashMap<SortType, Boolean> mSortAscending = new HashMap<SortType, Boolean>();
/** /**
* The MIME type(s) of attachments we're willing to view. * The MIME type(s) of attachments we're willing to view.
@ -473,6 +477,8 @@ public class K9 extends Application {
super.onCreate(); super.onCreate();
app = this; app = this;
mSortType = Account.DEFAULT_SORT_TYPE;
mSortAscending.put(Account.DEFAULT_SORT_TYPE, Account.DEFAULT_SORT_ASCENDING);
galleryBuggy = checkForBuggyGallery(); galleryBuggy = checkForBuggyGallery();
@ -1123,6 +1129,25 @@ public class K9 extends Application {
K9.mAttachmentDefaultPath = attachmentDefaultPath; K9.mAttachmentDefaultPath = attachmentDefaultPath;
} }
public static synchronized SortType getSortType() {
return mSortType;
}
public static synchronized void setSortType(SortType sortType) {
mSortType = sortType;
}
public static synchronized boolean isSortAscending(SortType sortType) {
if (mSortAscending.get(sortType) == null) {
mSortAscending.put(sortType, sortType.isDefaultAscending());
}
return mSortAscending.get(sortType);
}
public static synchronized void setSortAscending(SortType sortType, boolean sortAscending) {
mSortAscending.put(sortType, sortAscending);
}
public static boolean isShowAdvancedOptions() { public static boolean isShowAdvancedOptions() {
return mShowAdvancedOptions; return mShowAdvancedOptions;
} }
@ -1131,5 +1156,4 @@ public class K9 extends Application {
mShowAdvancedOptions = showAdvancedOptions; mShowAdvancedOptions = showAdvancedOptions;
} }
} }

View File

@ -839,6 +839,9 @@ public class MessageList
} else { } else {
Preferences preferences = Preferences.getPreferences(this); Preferences preferences = Preferences.getPreferences(this);
accountsWithNotification = preferences.getAccounts(); accountsWithNotification = preferences.getAccounts();
mSortType = K9.getSortType(); // ASH
mSortAscending = K9.isSortAscending(mSortType);
mSortDateAscending = K9.isSortAscending(SortType.SORT_DATE);
} }
for (Account accountWithNotification : accountsWithNotification) { for (Account accountWithNotification : accountsWithNotification) {
@ -1223,6 +1226,10 @@ public class MessageList
mSortAscending = mAccount.isSortAscending(mSortType); mSortAscending = mAccount.isSortAscending(mSortType);
mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE); mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE);
mAccount.save(Preferences.getPreferences(this)); mAccount.save(Preferences.getPreferences(this));
} else {
K9.setSortType(mSortType);
mSortAscending = K9.isSortAscending(mSortType);
mSortDateAscending = K9.isSortAscending(SortType.SORT_DATE);
} }
reSort(); reSort();
} }
@ -1263,6 +1270,9 @@ public class MessageList
mAccount.setSortAscending(mSortType, mSortAscending); mAccount.setSortAscending(mSortType, mSortAscending);
mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE); mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE);
mAccount.save(Preferences.getPreferences(this)); mAccount.save(Preferences.getPreferences(this));
} else {
K9.setSortAscending(mSortType, mSortAscending);
mSortDateAscending = K9.isSortAscending(SortType.SORT_DATE);
} }
reSort(); reSort();
} }