[geary: 36/36] Merge branch 'wip/778276-better-flag-updates'. Fixes Bug 778276.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 36/36] Merge branch 'wip/778276-better-flag-updates'. Fixes Bug 778276.
- Date: Fri, 12 Jan 2018 00:59:15 +0000 (UTC)
commit 6c5a7d5868d87b5959e562fbd85f0021a2722e46
Merge: f913d18 4cb9f2f
Author: Michael James Gratton <mike vee net>
Date: Fri Jan 12 11:56:57 2018 +1100
Merge branch 'wip/778276-better-flag-updates'. Fixes Bug 778276.
po/POTFILES.in | 4 +-
po/id.po | 1791 ++++++++++++--------
src/CMakeLists.txt | 6 +-
src/engine/api/geary-account.vala | 54 +-
src/engine/api/geary-contact-store.vala | 2 +-
src/engine/app/app-draft-manager.vala | 10 +-
src/engine/app/app-email-store.vala | 14 +-
.../app-conversation-operation-queue.vala | 6 +-
src/engine/imap-db/imap-db-account.vala | 9 +-
src/engine/imap-db/outbox/smtp-outbox-folder.vala | 4 +-
.../gmail/imap-engine-gmail-account.vala | 20 +-
.../imap-engine/imap-engine-account-operation.vala | 169 ++
.../imap-engine/imap-engine-account-processor.vala | 116 ++
.../imap-engine-account-synchronizer.vala | 668 +++-----
.../imap-engine-email-flag-watcher.vala | 158 --
.../imap-engine/imap-engine-email-prefetcher.vala | 107 +-
.../imap-engine/imap-engine-generic-account.vala | 985 ++++++-----
.../imap-engine/imap-engine-minimal-folder.vala | 449 +++---
.../imap-engine/imap-engine-replay-queue.vala | 17 +-
.../imap-engine-revokable-committed-move.vala | 3 +
.../imap-engine/imap-engine-revokable-move.vala | 54 +-
.../imap-engine-send-replay-operation.vala | 12 +-
.../other/imap-engine-other-account.vala | 9 +-
.../outlook/imap-engine-outlook-account.vala | 14 +-
.../replay-ops/imap-engine-replay-append.vala | 94 +-
.../replay-ops/imap-engine-replay-removal.vala | 120 ++-
.../replay-ops/imap-engine-replay-update.vala | 96 ++
.../yahoo/imap-engine-yahoo-account.vala | 10 +-
src/engine/imap/api/imap-folder-properties.vala | 2 +-
src/engine/imap/api/imap-folder.vala | 236 ++--
src/engine/nonblocking/nonblocking-mailbox.vala | 109 --
src/engine/nonblocking/nonblocking-queue.vala | 171 ++
test/CMakeLists.txt | 2 +
test/engine/api/geary-account-test.vala | 130 ++
.../engine/imap-engine/account-processor-test.vala | 175 ++
test/test-engine.vala | 1 +
36 files changed, 3494 insertions(+), 2333 deletions(-)
---
diff --cc src/engine/api/geary-account.vala
index 685b30c,4bf6c1c..21247c9
--- a/src/engine/api/geary-account.vala
+++ b/src/engine/api/geary-account.vala
@@@ -369,13 -395,17 +395,17 @@@ public abstract class Geary.Account : B
folders_available_unavailable(available, unavailable);
}
- /** Fires a {@link folders_added_removed} signal. */
- protected virtual void notify_folders_added_removed(Gee.List<Geary.Folder>? added,
- Gee.List<Geary.Folder>? removed) {
- folders_added_removed(added, removed);
- /** Fires a {@link folders_created}} signal. */
++ /** Fires a {@link folders_created} signal. */
+ protected virtual void notify_folders_created(Gee.List<Geary.Folder> created) {
+ folders_created(created);
+ }
+
- /** Fires a {@link folders_deleted}} signal. */
++ /** Fires a {@link folders_deleted} signal. */
+ protected virtual void notify_folders_deleted(Gee.List<Geary.Folder> deleted) {
+ folders_deleted(deleted);
}
- /** Fires a {@link folders_contents_altered}} signal. */
+ /** Fires a {@link folders_contents_altered} signal. */
protected virtual void notify_folders_contents_altered(Gee.Collection<Geary.Folder> altered) {
folders_contents_altered(altered);
}
diff --cc src/engine/imap-engine/imap-engine-generic-account.vala
index 3f6d2d2,c6e0a1f..c964ddd
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@@ -559,63 -366,38 +366,43 @@@ private abstract class Geary.ImapEngine
return yield remote.folder_exists_async(path, cancellable);
}
-
- // TODO: This needs to be made into a single transaction
+
public override async Geary.Folder fetch_folder_async(Geary.FolderPath path,
- Cancellable? cancellable = null) throws Error {
+ Cancellable? cancellable = null)
+ throws Error {
check_open();
-
- if (local_only.has_key(path))
- return local_only.get(path);
-
- try {
- return build_folder((ImapDB.Folder) yield local.fetch_folder_async(path, cancellable));
- } catch (EngineError err) {
- // don't thrown NOT_FOUND's, that means we need to fall through and clone from the
- // server
- if (!(err is EngineError.NOT_FOUND))
- throw err;
- }
-
- // clone the entire path
- int length = path.get_path_length();
- for (int ctr = 0; ctr < length; ctr++) {
- Geary.FolderPath folder = path.get_folder_at(ctr);
-
- if (yield local.folder_exists_async(folder))
- continue;
- Imap.Folder remote_folder = yield remote.fetch_folder_cached_async(
- folder, false, cancellable
- );
+ Geary.Folder? folder = this.local_only.get(path);
+ if (folder == null) {
+ folder = this.folder_map.get(path);
- yield local.clone_folder_async(remote_folder, cancellable);
+ if (folder == null) {
+ throw new EngineError.NOT_FOUND(path.to_string());
+ }
}
-
- // Fetch the local account's version of the folder for the MinimalFolder
- return build_folder((ImapDB.Folder) yield local.fetch_folder_async(path, cancellable));
+ return folder;
}
-
+
/**
- * Returns an Imap.Folder that is not connected (is detached) to a MinimalFolder or any other
- * ImapEngine container.
+ * Returns an Imap.Folder that is not connected (is detached) to a
+ * MinimalFolder or any other ImapEngine container.
*
- * This is useful for one-shot operations that need to bypass the heavyweight synchronization
- * routines inside MinimalFolder. This also means that operations performed on this Folder will
- * not be reflected in the local database unless there's a separate connection to the server
- * that is notified or detects these changes.
+ * This is useful for one-shot operations that need to bypass the
+ * heavyweight synchronization routines inside MinimalFolder.
+ * This also means that operations performed on this Folder will
+ * not be reflected in the local database unless there's a
+ * separate connection to the server that is notified or detects
+ * these changes.
*
- * The returned Folder must be opened prior to use and closed once completed. ''Leaving a
- * Folder open will cause a connection leak.''
+ * The returned Folder must be opened prior to use and closed once
+ * completed.
*
- * It is not recommended this object be held open long-term, or that its status or notifications
- * be directly written to the database unless you know exactly what you're doing. ''Caveat
- * implementor.''
+ * ''Leaving a Folder open will cause a connection leak.''
+ *
+ * It is not recommended this object be held open long-term, or
+ * that its status or notifications be directly written to the
+ * database unless you know exactly what you're doing.
+ * ''Caveat implementor.''
*/
public async Imap.Folder fetch_detached_folder_async(Geary.FolderPath path, Cancellable? cancellable)
throws Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]