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:
commit
b6df5c908b
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionCode="15013"
|
||||
android:versionName="4.114" package="com.fsck.k9"
|
||||
android:versionCode="15014"
|
||||
android:versionName="4.115" package="com.fsck.k9"
|
||||
>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
|
@ -4,6 +4,7 @@ package com.fsck.k9;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.SynchronousQueue;
|
||||
@ -24,6 +25,7 @@ import android.os.Looper;
|
||||
import android.text.format.Time;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fsck.k9.Account.SortType;
|
||||
import com.fsck.k9.activity.MessageCompose;
|
||||
import com.fsck.k9.controller.MessagingController;
|
||||
import com.fsck.k9.controller.MessagingListener;
|
||||
@ -195,6 +197,8 @@ public class K9 extends Application {
|
||||
private static boolean useGalleryBugWorkaround = false;
|
||||
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.
|
||||
@ -473,6 +477,8 @@ public class K9 extends Application {
|
||||
super.onCreate();
|
||||
app = this;
|
||||
|
||||
mSortType = Account.DEFAULT_SORT_TYPE;
|
||||
mSortAscending.put(Account.DEFAULT_SORT_TYPE, Account.DEFAULT_SORT_ASCENDING);
|
||||
|
||||
galleryBuggy = checkForBuggyGallery();
|
||||
|
||||
@ -1123,6 +1129,25 @@ public class K9 extends Application {
|
||||
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() {
|
||||
return mShowAdvancedOptions;
|
||||
}
|
||||
@ -1131,5 +1156,4 @@ public class K9 extends Application {
|
||||
mShowAdvancedOptions = showAdvancedOptions;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -839,6 +839,9 @@ public class MessageList
|
||||
} else {
|
||||
Preferences preferences = Preferences.getPreferences(this);
|
||||
accountsWithNotification = preferences.getAccounts();
|
||||
mSortType = K9.getSortType(); // ASH
|
||||
mSortAscending = K9.isSortAscending(mSortType);
|
||||
mSortDateAscending = K9.isSortAscending(SortType.SORT_DATE);
|
||||
}
|
||||
|
||||
for (Account accountWithNotification : accountsWithNotification) {
|
||||
@ -1223,6 +1226,10 @@ public class MessageList
|
||||
mSortAscending = mAccount.isSortAscending(mSortType);
|
||||
mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE);
|
||||
mAccount.save(Preferences.getPreferences(this));
|
||||
} else {
|
||||
K9.setSortType(mSortType);
|
||||
mSortAscending = K9.isSortAscending(mSortType);
|
||||
mSortDateAscending = K9.isSortAscending(SortType.SORT_DATE);
|
||||
}
|
||||
reSort();
|
||||
}
|
||||
@ -1263,6 +1270,9 @@ public class MessageList
|
||||
mAccount.setSortAscending(mSortType, mSortAscending);
|
||||
mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE);
|
||||
mAccount.save(Preferences.getPreferences(this));
|
||||
} else {
|
||||
K9.setSortAscending(mSortType, mSortAscending);
|
||||
mSortDateAscending = K9.isSortAscending(SortType.SORT_DATE);
|
||||
}
|
||||
reSort();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user