[geary/wip/strict-async-out-param-0.12] Fix remaining async calls in 0.12 that place out param before in param



commit 68413bfcab12c1b504525c7d6c5e151081e640b3
Author: Michael Gratton <mike vee net>
Date:   Tue Feb 5 09:31:14 2019 +1100

    Fix remaining async calls in 0.12 that place out param before in param

 src/engine/api/geary-folder.vala                     |  4 ++--
 src/engine/app/app-conversation-monitor.vala         |  8 ++++----
 .../conversation-monitor/app-conversation-set.vala   |  9 +++++----
 src/engine/imap-db/outbox/smtp-outbox-folder.vala    |  3 +--
 src/engine/imap-db/search/imap-db-search-folder.vala |  3 +--
 .../imap-engine/imap-engine-generic-account.vala     | 12 ++++++------
 .../imap-engine/imap-engine-minimal-folder.vala      |  7 +++----
 src/engine/imap/api/imap-account.vala                |  8 ++++----
 src/engine/imap/api/imap-folder.vala                 | 20 ++++++++++----------
 .../imap/transport/imap-client-connection.vala       |  4 ++--
 src/engine/imap/transport/imap-serializer.vala       |  4 ++--
 11 files changed, 40 insertions(+), 42 deletions(-)
---
diff --git a/src/engine/api/geary-folder.vala b/src/engine/api/geary-folder.vala
index 63772d0f..708602f1 100644
--- a/src/engine/api/geary-folder.vala
+++ b/src/engine/api/geary-folder.vala
@@ -473,8 +473,8 @@ public abstract class Geary.Folder : BaseObject {
      * in the folder.  If none of the given set are in the folder, return null.
      */
     public abstract async void find_boundaries_async(Gee.Collection<Geary.EmailIdentifier> ids,
-        out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high,
-        Cancellable? cancellable = null) throws Error;
+                                                     Cancellable? cancellable = null,
+        out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high) throws Error;
     
     /**
      * List emails from the {@link Folder} starting at a particular location within the vector
diff --git a/src/engine/app/app-conversation-monitor.vala b/src/engine/app/app-conversation-monitor.vala
index c974a99e..7056a8cf 100644
--- a/src/engine/app/app-conversation-monitor.vala
+++ b/src/engine/app/app-conversation-monitor.vala
@@ -575,8 +575,8 @@ public class Geary.App.ConversationMonitor : BaseObject {
         Gee.MultiMap<Geary.App.Conversation, Geary.Email>? appended = null;
         Gee.Collection<Conversation>? removed_due_to_merge = null;
         try {
-            yield conversations.add_all_emails_async(job.emails.values, this, folder.path, out added, out 
appended,
-                out removed_due_to_merge, null);
+            yield conversations.add_all_emails_async(job.emails.values, this, folder.path, null,
+                out added, out appended, out removed_due_to_merge);
         } catch (Error err) {
             debug("Unable to add emails to conversation: %s", err.message);
             
@@ -631,7 +631,7 @@ public class Geary.App.ConversationMonitor : BaseObject {
         Gee.Collection<Geary.App.Conversation> removed;
         Gee.MultiMap<Geary.App.Conversation, Geary.Email> trimmed;
         yield conversations.remove_emails_and_check_in_folder_async(removed_ids, folder.account,
-            folder.path, out removed, out trimmed, null);
+            folder.path, null, out removed, out trimmed);
         
         foreach (Conversation conversation in trimmed.get_keys())
             notify_conversation_trimmed(conversation, trimmed.get(conversation));
@@ -684,7 +684,7 @@ public class Geary.App.ConversationMonitor : BaseObject {
         Geary.EmailIdentifier? earliest_id = null;
         try {
             yield folder.find_boundaries_async(conversations.get_email_identifiers(),
-                out earliest_id, null, cancellable);
+                                               cancellable, out earliest_id, null);
         } catch (Error e) {
             debug("Error finding earliest email identifier: %s", e.message);
         }
diff --git a/src/engine/app/conversation-monitor/app-conversation-set.vala 
b/src/engine/app/conversation-monitor/app-conversation-set.vala
index 62f3affd..77978d59 100644
--- a/src/engine/app/conversation-monitor/app-conversation-set.vala
+++ b/src/engine/app/conversation-monitor/app-conversation-set.vala
@@ -134,10 +134,10 @@ private class Geary.App.ConversationSet : BaseObject {
     
     public async void add_all_emails_async(Gee.Collection<Geary.Email> emails,
         ConversationMonitor monitor, Geary.FolderPath? preferred_folder_path,
+        Cancellable? cancellable,
         out Gee.Collection<Conversation> added,
         out Gee.MultiMap<Conversation, Geary.Email> appended,
-        out Gee.Collection<Conversation> removed_due_to_merge,
-        Cancellable? cancellable) throws Error {
+        out Gee.Collection<Conversation> removed_due_to_merge) throws Error {
         // Get known paths for all emails
         Gee.Map<Geary.EmailIdentifier, Geary.Email>? id_map = Email.emails_to_map(emails);
         Gee.MultiMap<Geary.EmailIdentifier, Geary.FolderPath>? id_to_paths = null;
@@ -389,8 +389,9 @@ private class Geary.App.ConversationSet : BaseObject {
     
     public async void remove_emails_and_check_in_folder_async(
         Gee.Collection<Geary.EmailIdentifier> ids, Geary.Account account,
-        Geary.FolderPath required_folder_path, out Gee.Collection<Conversation> removed,
-        out Gee.MultiMap<Conversation, Geary.Email> trimmed, Cancellable? cancellable) {
+        Geary.FolderPath required_folder_path, Cancellable? cancellable,
+        out Gee.Collection<Conversation> removed,
+        out Gee.MultiMap<Conversation, Geary.Email> trimmed) {
         Gee.HashSet<Conversation> _removed = new Gee.HashSet<Conversation>();
         Gee.HashMultiMap<Conversation, Geary.Email> _trimmed
             = new Gee.HashMultiMap<Conversation, Geary.Email>();
diff --git a/src/engine/imap-db/outbox/smtp-outbox-folder.vala 
b/src/engine/imap-db/outbox/smtp-outbox-folder.vala
index 926ed950..ba766288 100644
--- a/src/engine/imap-db/outbox/smtp-outbox-folder.vala
+++ b/src/engine/imap-db/outbox/smtp-outbox-folder.vala
@@ -83,8 +83,7 @@ private class Geary.SmtpOutboxFolder : Geary.AbstractLocalFolder, Geary.FolderSu
     }
     
     public override async void find_boundaries_async(Gee.Collection<Geary.EmailIdentifier> ids,
-        out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high,
-        Cancellable? cancellable = null) throws Error {
+        Cancellable? cancellable = null, out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high) 
throws Error {
         SmtpOutboxEmailIdentifier? outbox_low = null;
         SmtpOutboxEmailIdentifier? outbox_high = null;
         yield db.exec_transaction_async(Db.TransactionType.RO, (cx) => {
diff --git a/src/engine/imap-db/search/imap-db-search-folder.vala 
b/src/engine/imap-db/search/imap-db-search-folder.vala
index 0e5b0846..d25ca526 100644
--- a/src/engine/imap-db/search/imap-db-search-folder.vala
+++ b/src/engine/imap-db/search/imap-db-search-folder.vala
@@ -50,8 +50,7 @@ private class Geary.ImapDB.SearchFolder : Geary.SearchFolder, Geary.FolderSuppor
     }
     
     public override async void find_boundaries_async(Gee.Collection<Geary.EmailIdentifier> ids,
-        out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high,
-        Cancellable? cancellable = null) throws Error {
+        Cancellable? cancellable = null, out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high) 
throws Error {
         low = null;
         high = null;
         
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 5625c268..69671c73 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -355,12 +355,12 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
         try {
             bool folder_created;
             Imap.Folder remote_folder = yield remote.fetch_folder_async(folder.path,
-                out folder_created, null, cancellable);
+                null, cancellable, out folder_created);
             
             // if created, don't need to fetch count because it was fetched when it was created
             int unseen, total;
             if (!folder_created) {
-                yield remote.fetch_counts_async(folder.path, out unseen, out total, cancellable);
+                yield remote.fetch_counts_async(folder.path, cancellable, out unseen, out total);
                 remote_folder.properties.set_status_unseen(unseen);
                 remote_folder.properties.set_status_message_count(total, false);
             } else {
@@ -435,7 +435,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
         // startup of the UI), enumerate the remote folders
         bool remote_folders_suspect;
         Gee.HashMap<FolderPath, Imap.Folder>? remote_folders = yield enumerate_remote_folders_async(
-            null, out remote_folders_suspect, cancellable);
+            null, cancellable, out remote_folders_suspect);
         
         // pair the local and remote folders and make sure everything is up-to-date
         yield update_folders_async(existing_folders, remote_folders, remote_folders_suspect, cancellable);
@@ -467,7 +467,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
     }
     
     private async Gee.HashMap<FolderPath, Imap.Folder> enumerate_remote_folders_async(
-        Geary.FolderPath? parent, out bool results_suspect, Cancellable? cancellable) throws Error {
+        Geary.FolderPath? parent, Cancellable? cancellable, out bool results_suspect) throws Error {
         results_suspect = false;
         check_open();
         
@@ -491,7 +491,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
                     bool recursive_results_suspect;
                     Collection.map_set_all<FolderPath, Imap.Folder>(result,
                         yield enumerate_remote_folders_async(
-                        remote_child.path, out recursive_results_suspect, cancellable));
+                        remote_child.path, cancellable, out recursive_results_suspect));
                     if (recursive_results_suspect)
                         results_suspect = true;
                 }
@@ -545,7 +545,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
                 continue;
             
             Imap.Folder remote_folder = (Imap.Folder) yield remote.fetch_folder_async(folder,
-                null, null, cancellable);
+                null, cancellable, null);
             
             yield local.clone_folder_async(remote_folder, cancellable);
         }
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala 
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index dfe8ec66..9bd6b75c 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -643,8 +643,8 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
                 ImapDB.Folder.ListFlags.NONE, cancellable);
             
             debug("Fetching information for remote folder %s", to_string());
-            opening_folder = yield remote.fetch_folder_async(local_folder.get_path(), null, local_status,
-                cancellable);
+            opening_folder = yield remote.fetch_folder_async(local_folder.get_path(), local_status,
+                                                             cancellable, null);
             
             debug("Opening remote folder %s", opening_folder.to_string());
             yield opening_folder.open_async(cancellable);
@@ -1025,8 +1025,7 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
     }
     
     public override async void find_boundaries_async(Gee.Collection<Geary.EmailIdentifier> ids,
-        out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high,
-        Cancellable? cancellable = null) throws Error {
+        Cancellable? cancellable = null, out Geary.EmailIdentifier? low, out Geary.EmailIdentifier? high) 
throws Error {
         low = null;
         high = null;
         
diff --git a/src/engine/imap/api/imap-account.vala b/src/engine/imap/api/imap-account.vala
index 14c1b0ec..fe0ef27f 100644
--- a/src/engine/imap/api/imap-account.vala
+++ b/src/engine/imap/api/imap-account.vala
@@ -270,8 +270,8 @@ private class Geary.Imap.Account : BaseObject {
     
     // By supplying fallback STATUS, the Folder may be fetched if a network error occurs; if null,
     // the network error is thrown
-    public async Imap.Folder fetch_folder_async(FolderPath path, out bool created,
-        StatusData? fallback_status_data, Cancellable? cancellable) throws Error {
+    public async Imap.Folder fetch_folder_async(FolderPath path, StatusData? fallback_status_data,
+                                                Cancellable? cancellable, out bool created) throws Error {
         check_open();
         
         created = false;
@@ -357,8 +357,8 @@ private class Geary.Imap.Account : BaseObject {
         }
     }
     
-    public async void fetch_counts_async(FolderPath path, out int unseen, out int total,
-        Cancellable? cancellable) throws Error {
+    public async void fetch_counts_async(FolderPath path, Cancellable? cancellable,
+                                         out int unseen, out int total) throws Error {
         check_open();
         
         MailboxInformation? mailbox_info = path_to_mailbox.get(path);
diff --git a/src/engine/imap/api/imap-folder.vala b/src/engine/imap/api/imap-folder.vala
index f8600248..be9c08e3 100644
--- a/src/engine/imap/api/imap-folder.vala
+++ b/src/engine/imap/api/imap-folder.vala
@@ -315,8 +315,8 @@ private class Geary.Imap.Folder : BaseObject {
     // FETCH commands can generate a FolderError.RETRY.  State will be updated to accomodate retry,
     // but all Commands must be regenerated to ensure new state is reflected in requests.
     private async Gee.Map<Command, StatusResponse>? exec_commands_async(Gee.Collection<Command> cmds,
-        out Gee.HashMap<SequenceNumber, FetchedData>? fetched, out Gee.Set<Imap.UID>? search_results,
-        Cancellable? cancellable) throws Error {
+                                                                        Cancellable? cancellable,
+        out Gee.HashMap<SequenceNumber, FetchedData>? fetched, out Gee.Set<Imap.UID>? search_results) throws 
Error {
         int token = yield cmd_mutex.claim_async(cancellable);
         Gee.Map<Command, StatusResponse>? responses = null;
         // execute commands with mutex locked
@@ -434,8 +434,8 @@ private class Geary.Imap.Folder : BaseObject {
         SearchCommand cmd = new SearchCommand.uid(criteria);
         
         Gee.Set<Imap.UID>? search_results;
-        yield exec_commands_async(Geary.iterate<Command>(cmd).to_array_list(), null, out search_results,
-            cancellable);
+        yield exec_commands_async(Geary.iterate<Command>(cmd).to_array_list(), cancellable,
+                                  null, out search_results);
         
         return (search_results != null && search_results.size > 0) ? search_results : null;
     }
@@ -548,7 +548,7 @@ private class Geary.Imap.Folder : BaseObject {
             
             // Commands prepped, do the fetch and accumulate all the responses
             try {
-                yield exec_commands_async(cmds, out fetched, null, cancellable);
+                yield exec_commands_async(cmds, cancellable, out fetched, null);
             } catch (Error err) {
                 if (err is FolderError.RETRY) {
                     debug("Retryable server failure detected for %s: %s", to_string(), err.message);
@@ -614,7 +614,7 @@ private class Geary.Imap.Folder : BaseObject {
         cmds.add(new FetchCommand.data_type(msg_set, FetchDataSpecifier.UID));
         
         Gee.HashMap<SequenceNumber, FetchedData>? fetched;
-        yield exec_commands_async(cmds, out fetched, null, cancellable);
+        yield exec_commands_async(cmds, cancellable, out fetched, null);
         
         if (fetched == null || fetched.size == 0)
             return null;
@@ -658,7 +658,7 @@ private class Geary.Imap.Folder : BaseObject {
             cmds.add(new ExpungeCommand());
         }
         
-        yield exec_commands_async(cmds, null, null, cancellable);
+        yield exec_commands_async(cmds, cancellable, null, null);
     }
     
     public async void mark_email_async(Gee.List<MessageSet> msg_sets, Geary.EmailFlags? flags_to_add,
@@ -682,7 +682,7 @@ private class Geary.Imap.Folder : BaseObject {
                 cmds.add(new StoreCommand(msg_set, msg_flags_remove, StoreCommand.Option.REMOVE_FLAGS));
         }
         
-        yield exec_commands_async(cmds, null, null, cancellable);
+        yield exec_commands_async(cmds, cancellable, null, null);
     }
     
     // Returns a mapping of the source UID to the destination UID.  If the MessageSet is not for
@@ -695,7 +695,7 @@ private class Geary.Imap.Folder : BaseObject {
             new MailboxSpecifier.from_folder_path(destination, this.delim));
 
         Gee.Map<Command, StatusResponse>? responses = yield exec_commands_async(
-            Geary.iterate<Command>(cmd).to_array_list(), null, null, cancellable);
+            Geary.iterate<Command>(cmd).to_array_list(), cancellable, null, null);
         
         if (!responses.has_key(cmd))
             return null;
@@ -742,7 +742,7 @@ private class Geary.Imap.Folder : BaseObject {
         cmds.add(new SearchCommand.uid(criteria));
         
         Gee.Set<Imap.UID>? search_results;
-        yield exec_commands_async(cmds, null, out search_results, cancellable);
+        yield exec_commands_async(cmds, cancellable, null, out search_results);
         if (search_results == null || search_results.size == 0)
             return null;
         
diff --git a/src/engine/imap/transport/imap-client-connection.vala 
b/src/engine/imap/transport/imap-client-connection.vala
index f6978efd..d2a8e962 100644
--- a/src/engine/imap/transport/imap-client-connection.vala
+++ b/src/engine/imap/transport/imap-client-connection.vala
@@ -657,7 +657,7 @@ public class Geary.Imap.ClientConnection : BaseObject {
                 synchronization_status_response = null;
                 
                 Tag? synchronize_tag;
-                yield ser.flush_async(is_synchronized, out synchronize_tag);
+                yield ser.flush_async(is_synchronized, null, out synchronize_tag);
                 
                 // if no tag returned, all done, otherwise synchronization required
                 if (synchronize_tag == null)
@@ -727,7 +727,7 @@ public class Geary.Imap.ClientConnection : BaseObject {
                 idle_cmd.serialize(ser, idle_cmd.tag);
                 
                 Tag? synchronize_tag;
-                yield ser.flush_async(false, out synchronize_tag);
+                yield ser.flush_async(false, null, out synchronize_tag);
                 
                 // flushing IDLE should never require synchronization
                 assert(synchronize_tag == null);
diff --git a/src/engine/imap/transport/imap-serializer.vala b/src/engine/imap/transport/imap-serializer.vala
index 78696d69..5deb7c78 100644
--- a/src/engine/imap/transport/imap-serializer.vala
+++ b/src/engine/imap/transport/imap-serializer.vala
@@ -186,8 +186,8 @@ public class Geary.Imap.Serializer : BaseObject {
      * flush_async() again with is_synchronized set to true.  The tag is supplied to watch for
      * an error condition from the server (which may reject the synchronization request).
      */
-    public async void flush_async(bool is_synchronized, out Tag? synchronize_tag,
-        Cancellable? cancellable = null) throws Error {
+    public async void flush_async(bool is_synchronized, Cancellable? cancellable = null,
+                                  out Tag? synchronize_tag) throws Error {
         synchronize_tag = null;
         
         // commit the last buffer to the queue (although this is best done with push_end_message)


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