[geary/wip/ricotz/vala] Fix build with stricter async parameter checks of valac



commit 6176cfb737cfa5b531b71be2a386aaf45fb50622
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Oct 21 11:18:29 2018 +0200

    Fix build with stricter async parameter checks of valac

 src/engine/imap-db/imap-db-folder.vala                 |  4 ++--
 src/engine/imap-db/imap-db-gc.vala                     | 18 +++++++++---------
 .../replay-ops/imap-engine-replay-removal.vala         |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/engine/imap-db/imap-db-folder.vala b/src/engine/imap-db/imap-db-folder.vala
index bb9a9e34..528df3ff 100644
--- a/src/engine/imap-db/imap-db-folder.vala
+++ b/src/engine/imap-db/imap-db-folder.vala
@@ -997,8 +997,8 @@ private class Geary.ImapDB.Folder : BaseObject, Geary.ReferenceSemantics {
         }
     }
     
-    public async void detach_single_email_async(ImapDB.EmailIdentifier id, out bool is_marked,
-        Cancellable? cancellable) throws Error {
+    public async void detach_single_email_async(ImapDB.EmailIdentifier id, Cancellable? cancellable,
+        out bool is_marked) throws Error {
         bool internal_is_marked = false;
         bool was_unread = false;
         yield db.exec_transaction_async(Db.TransactionType.RW, (cx) => {
diff --git a/src/engine/imap-db/imap-db-gc.vala b/src/engine/imap-db/imap-db-gc.vala
index 004dd7c7..ce52e990 100644
--- a/src/engine/imap-db/imap-db-gc.vala
+++ b/src/engine/imap-db/imap-db-gc.vala
@@ -98,8 +98,8 @@ private class Geary.ImapDB.GC {
         DateTime? last_reap_time, last_vacuum_time;
         int reaped_messages_since_last_vacuum;
         int64 free_page_bytes;
-        yield fetch_gc_info_async(out last_reap_time, out last_vacuum_time, out 
reaped_messages_since_last_vacuum,
-            out free_page_bytes, cancellable);
+        yield fetch_gc_info_async(cancellable, out last_reap_time, out last_vacuum_time,
+            out reaped_messages_since_last_vacuum, out free_page_bytes);
         
         debug("[%s] GC state: last_reap_time=%s last_vacuum_time=%s reaped_messages_since=%d 
free_page_bytes=%s",
             to_string(),
@@ -370,7 +370,7 @@ private class Geary.ImapDB.GC {
         // as code (here and elsewhere) only removes files.
         //
         
-        count = yield delete_empty_attachment_directories_async(null, null, cancellable);
+        count = yield delete_empty_attachment_directories_async(null, cancellable, null);
         
         message("[%s] Deleted %d empty attachment directories", to_string(), count);
         
@@ -553,8 +553,8 @@ private class Geary.ImapDB.GC {
         return deleted;
     }
     
-    private async int delete_empty_attachment_directories_async(File? current, out bool empty,
-        Cancellable? cancellable) throws Error {
+    private async int delete_empty_attachment_directories_async(File? current, Cancellable? cancellable,
+        out bool empty) throws Error {
         File current_dir = current ?? db.attachments_path;
 
         // directory is considered empty until file or non-deleted child directory is found
@@ -578,8 +578,8 @@ private class Geary.ImapDB.GC {
                 File child = current_dir.get_child(info.get_name());
                 
                 bool child_empty;
-                deleted += yield delete_empty_attachment_directories_async(child, out child_empty,
-                    cancellable);
+                deleted += yield delete_empty_attachment_directories_async(child, cancellable,
+                    out child_empty);
                 if (!child_empty) {
                     empty = false;
                     
@@ -614,8 +614,8 @@ private class Geary.ImapDB.GC {
         return deleted;
     }
     
-    private async void fetch_gc_info_async(out DateTime? last_reap_time, out DateTime? last_vacuum_time,
-        out int reaped_messages_since_last_vacuum, out int64 free_page_bytes, Cancellable? cancellable)
+    private async void fetch_gc_info_async(Cancellable? cancellable, out DateTime? last_reap_time,
+        out DateTime? last_vacuum_time, out int reaped_messages_since_last_vacuum, out int64 free_page_bytes)
         throws Error {
         // dealing with out arguments for an async method inside a closure is asking for trouble
         int64 last_reap_time_t = -1, last_vacuum_time_t = -1, free_page_count = 0;
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala
index b90598e8..fc25e10c 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala
@@ -100,7 +100,7 @@ private class Geary.ImapEngine.ReplayRemoval : Geary.ImapEngine.ReplayOperation
                 owned_id.to_string());
             try {
                 // Reflect change in the local store and notify subscribers
-                yield this.owner.local_folder.detach_single_email_async(owned_id, out marked, null);
+                yield this.owner.local_folder.detach_single_email_async(owned_id, null, out marked);
             } catch (Error err) {
                 debug("%s do_replay_removed_message: unable to remove message #%s: %s", to_string(),
                     this.position.to_string(), err.message);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]