[geary/wip/strict-async-out-param-0.12] Cherry pick fix for newer valac from commit 6176cfb7
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/strict-async-out-param-0.12] Cherry pick fix for newer valac from commit 6176cfb7
- Date: Mon, 4 Feb 2019 12:41:46 +0000 (UTC)
commit a53675aec5a53f73e5129afc6bdd290255f45edf
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Oct 21 11:18:29 2018 +0200
Cherry pick fix for newer valac from commit 6176cfb7
src/engine/imap-db/imap-db-folder.vala | 4 ++--
src/engine/imap-db/imap-db-gc.vala | 19 ++++++++++---------
.../imap-engine/imap-engine-minimal-folder.vala | 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/src/engine/imap-db/imap-db-folder.vala b/src/engine/imap-db/imap-db-folder.vala
index 80adf4c9..4a6a4446 100644
--- a/src/engine/imap-db/imap-db-folder.vala
+++ b/src/engine/imap-db/imap-db-folder.vala
@@ -939,8 +939,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 0ba62279..752fda63 100644
--- a/src/engine/imap-db/imap-db-gc.vala
+++ b/src/engine/imap-db/imap-db-gc.vala
@@ -99,8 +99,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);
@@ -568,8 +568,9 @@ 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 ?? Attachment.get_attachments_dir(db.db_file.get_parent());
// directory is considered empty until file or non-deleted child directory is found
@@ -593,8 +594,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;
@@ -629,8 +630,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/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index c1a8d99c..dfe8ec66 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -1222,7 +1222,7 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
owned_id.to_string());
try {
// Reflect change in the local store and notify subscribers
- yield local_folder.detach_single_email_async(owned_id, out marked, null);
+ yield 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(),
remote_position.to_string(), err.message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]