[geary/wip/713150-conversations: 4/4] Merge branch 'master' into wip/713150-conversations
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/713150-conversations: 4/4] Merge branch 'master' into wip/713150-conversations
- Date: Fri, 6 Mar 2015 01:30:35 +0000 (UTC)
commit 7cf7fd3d3321f66cd631dd4f7b09dee4a96add82
Merge: b6f7589 32f3371
Author: Jim Nelson <jim yorba org>
Date: Thu Mar 5 17:30:25 2015 -0800
Merge branch 'master' into wip/713150-conversations
help/C/shortcuts.page | 12 +++++++
src/client/application/geary-controller.vala | 33 ++++++++++++++++++--
src/client/folder-list/folder-list-tree.vala | 16 +++++++++
src/engine/api/geary-abstract-local-folder.vala | 6 ++-
src/engine/api/geary-folder.vala | 9 +++--
src/engine/app/app-conversation-monitor.vala | 12 +++++--
.../imap-engine/imap-engine-minimal-folder.vala | 12 +++++--
.../replay-ops/imap-engine-user-close.vala | 4 ++-
8 files changed, 88 insertions(+), 16 deletions(-)
---
diff --cc src/client/application/geary-controller.vala
index e1640cc,0105feb..83cbadd
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@@ -278,16 -270,22 +279,23 @@@ public class GearyController : Geary.Ba
// close the ConversationMonitor
try {
if (current_conversations != null) {
- yield current_conversations.stop_monitoring_async(null);
+ debug("Stopping conversation monitor for %s...", current_conversations.folder.to_string());
+
+ bool closing = yield current_conversations.stop_monitoring_async(null);
// If not an Inbox, wait for it to close so all pending operations are flushed
- if (!inboxes.values.contains(current_conversations.folder))
+ if (closing) {
+ debug("Waiting for %s to close...", current_conversations.folder.to_string());
yield current_conversations.folder.wait_for_close_async(null);
+ }
+
+ debug("Stopped conversation monitor for %s", current_conversations.folder.to_string());
}
} catch (Error err) {
- message("Error closing conversation at shutdown: %s", err.message);
+ message("Error closing conversation monitor %s at shutdown: %s",
+ current_conversations.folder.to_string(), err.message);
} finally {
+ last_deleted_conversation = null;
current_conversations = null;
}
diff --cc src/engine/app/app-conversation-monitor.vala
index d282a52,12ca9d8..463ad5f
--- a/src/engine/app/app-conversation-monitor.vala
+++ b/src/engine/app/app-conversation-monitor.vala
@@@ -400,11 -339,11 +403,12 @@@ public class Geary.App.ConversationMoni
folder.opened.disconnect(on_folder_opened);
folder.account.email_flags_changed.disconnect(on_account_email_flags_changed);
folder.account.email_locally_complete.disconnect(on_account_email_locally_complete);
+ folder.account.email_removed.disconnect(on_account_email_removed);
+ bool closing = false;
Error? close_err = null;
try {
- yield folder.close_async(cancellable);
+ closing = yield folder.close_async(cancellable);
} catch (Error err) {
// throw, but only after cleaning up (which is to say, if close_async() fails,
// then the Folder is still treated as closed, which is the best that can be
@@@ -416,36 -355,38 +420,38 @@@
notify_monitoring_stopped();
+ clear();
+
if (close_err != null)
throw close_err;
+
+ return closing;
}
- /**
- * See Geary.Folder.list_email_by_id_async() for details of how these parameters operate. Instead
- * of returning emails, this method will load the Conversations object with them sorted into
- * Conversation objects.
- */
- private async void load_by_id_async(Geary.EmailIdentifier? initial_id, int count,
- Geary.Folder.ListFlags flags, Cancellable? cancellable) throws Error {
- notify_scan_started();
- try {
- yield process_email_async(yield folder.list_email_by_id_async(initial_id,
- count, required_fields, flags, cancellable), new ProcessJobContext(true));
- } catch (Error err) {
- list_error(err);
- throw err;
- }
+ private void clear() {
+ foreach (Conversation conversation in conversations)
+ conversation.clear_owner();
+
+ conversations.clear();
+ all_email_id_to_conversation.clear();
+ primary_email_id_to_conversation.clear();
}
- private async void load_by_sparse_id(Gee.Collection<Geary.EmailIdentifier> ids,
+ // By passing required_fields, this forces the email to be downloaded (if not already) at the
+ // potential expense of loading it twice; use Email.Field.NONE to only load the email identifiers
+ // and potentially not be able to load the email due to unavailability (but will be loaded
+ // later when locally-available)
+ private async void load_by_id_async(Geary.EmailIdentifier? initial_id, int count, Email.Field fields,
Geary.Folder.ListFlags flags, Cancellable? cancellable) {
notify_scan_started();
-
try {
- yield process_email_async(yield folder.list_email_by_sparse_id_async(ids,
- required_fields, flags, cancellable), new ProcessJobContext(true));
+ yield process_email_async(folder.path,
+ yield folder.list_email_by_id_async(initial_id, count, fields, flags, cancellable),
+ cancellable);
} catch (Error err) {
- list_error(err);
+ notify_scan_error(err);
+ } finally {
+ notify_scan_completed();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]