forked from upstream-mirrors/quik
Minor cleanup
This commit is contained in:
@@ -757,12 +757,10 @@ public class Conversation {
|
|||||||
* @param deleteAll Delete the whole thread including locked messages
|
* @param deleteAll Delete the whole thread including locked messages
|
||||||
* @param threadIds Collection of thread IDs of the conversations to be deleted
|
* @param threadIds Collection of thread IDs of the conversations to be deleted
|
||||||
*/
|
*/
|
||||||
public static void startDelete(ConversationQueryHandler handler, int token, boolean deleteAll,
|
public static void startDelete(ConversationQueryHandler handler, int token, boolean deleteAll, Collection<Long> threadIds) {
|
||||||
Collection<Long> threadIds) {
|
|
||||||
synchronized (sDeletingThreadsLock) {
|
synchronized (sDeletingThreadsLock) {
|
||||||
if (DELETEDEBUG) {
|
if (DELETEDEBUG) {
|
||||||
Log.v(TAG, "Conversation startDelete sDeletingThreads: " +
|
Log.v(TAG, "Conversation startDelete sDeletingThreads: " + sDeletingThreads);
|
||||||
sDeletingThreads);
|
|
||||||
}
|
}
|
||||||
if (sDeletingThreads) {
|
if (sDeletingThreads) {
|
||||||
Log.e(TAG, "startDeleteAll already in the middle of a delete", new Exception());
|
Log.e(TAG, "startDeleteAll already in the middle of a delete", new Exception());
|
||||||
@@ -829,18 +827,11 @@ public class Conversation {
|
|||||||
@Override
|
@Override
|
||||||
protected void onDeleteComplete(int token, Object cookie, int result) {
|
protected void onDeleteComplete(int token, Object cookie, int result) {
|
||||||
if (token == mDeleteToken) {
|
if (token == mDeleteToken) {
|
||||||
// Test code
|
|
||||||
// try {
|
|
||||||
// Thread.sleep(10000);
|
|
||||||
// } catch (InterruptedException e) {
|
|
||||||
// }
|
|
||||||
|
|
||||||
// release lock
|
// release lock
|
||||||
synchronized (sDeletingThreadsLock) {
|
synchronized (sDeletingThreadsLock) {
|
||||||
sDeletingThreads = false;
|
sDeletingThreads = false;
|
||||||
if (DELETEDEBUG) {
|
if (DELETEDEBUG) {
|
||||||
Log.v(TAG, "Conversation onDeleteComplete sDeletingThreads: " +
|
Log.v(TAG, "Conversation onDeleteComplete sDeletingThreads: " + sDeletingThreads);
|
||||||
sDeletingThreads);
|
|
||||||
}
|
}
|
||||||
sDeletingThreadsLock.notifyAll();
|
sDeletingThreadsLock.notifyAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -697,16 +697,13 @@ public class MainActivity extends QKActivity implements SlidingMenu.OnOpenListen
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, final int whichButton) {
|
public void onClick(DialogInterface dialog, final int whichButton) {
|
||||||
MessageUtils.handleReadReport(mContext, mThreadIds,
|
MessageUtils.handleReadReport(mContext, mThreadIds,
|
||||||
PduHeaders.READ_STATUS__DELETED_WITHOUT_BEING_READ, new Runnable() {
|
PduHeaders.READ_STATUS__DELETED_WITHOUT_BEING_READ, () -> {
|
||||||
@Override
|
int token = DELETE_CONVERSATION_TOKEN;
|
||||||
public void run() {
|
if (mThreadIds == null) {
|
||||||
int token = DELETE_CONVERSATION_TOKEN;
|
Conversation.startDeleteAll(mHandler, token, mDeleteLockedMessages);
|
||||||
if (mThreadIds == null) {
|
DraftCache.getInstance().refresh();
|
||||||
Conversation.startDeleteAll(mHandler, token, mDeleteLockedMessages);
|
} else {
|
||||||
DraftCache.getInstance().refresh();
|
Conversation.startDelete(mHandler, token, mDeleteLockedMessages, mThreadIds);
|
||||||
} else {
|
|
||||||
Conversation.startDelete(mHandler, token, mDeleteLockedMessages, mThreadIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
+2
-1
@@ -120,7 +120,8 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the weighting for unread vs. read conversations that are selected
|
* Returns the weighting for unread vs. read conversations that are selected, to decide
|
||||||
|
* which options we should show in the multi selction toolbar
|
||||||
*/
|
*/
|
||||||
private int getUnreadWeight() {
|
private int getUnreadWeight() {
|
||||||
int unreadWeight = 0;
|
int unreadWeight = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user