[geary/wip/search-fixes] Minor source code formatting improvements
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/search-fixes] Minor source code formatting improvements
- Date: Tue, 6 Aug 2019 13:23:58 +0000 (UTC)
commit 6beeefdb34f747973ab8c95ed40429939c821a0f
Author: Michael Gratton <mike vee net>
Date: Tue Aug 6 23:22:41 2019 +1000
Minor source code formatting improvements
.../imap-db/search/imap-db-search-folder.vala | 86 ++++++++++++----------
1 file changed, 48 insertions(+), 38 deletions(-)
---
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 cfd1cf89..5664b361 100644
--- a/src/engine/imap-db/search/imap-db-search-folder.vala
+++ b/src/engine/imap-db/search/imap-db-search-folder.vala
@@ -52,16 +52,6 @@ private class Geary.ImapDB.SearchFolder : Geary.SearchFolder, Geary.FolderSuppor
account.email_removed.disconnect(on_account_email_removed);
}
- private void on_folders_available_unavailable(Gee.Collection<Geary.Folder>? available,
- Gee.Collection<Geary.Folder>? unavailable) {
- if (available != null) {
- // Exclude it from searching if it's got the right special type.
- foreach(Geary.Folder folder in Geary.traverse<Geary.Folder>(available)
- .filter(f => f.special_folder_type in EXCLUDE_TYPES))
- exclude_folder(folder);
- }
- }
-
private async void append_new_email_async(Geary.SearchQuery query, Geary.Folder folder,
Gee.Collection<Geary.EmailIdentifier> ids, Cancellable? cancellable) throws Error {
int result_mutex_token = yield result_mutex.claim_async();
@@ -79,20 +69,6 @@ private class Geary.ImapDB.SearchFolder : Geary.SearchFolder, Geary.FolderSuppor
throw error;
}
- private void on_append_new_email_complete(Object? source, AsyncResult result) {
- try {
- append_new_email_async.end(result);
- } catch(Error e) {
- debug("Error appending new email to search results: %s", e.message);
- }
- }
-
- private void on_email_locally_complete(Geary.Folder folder,
- Gee.Collection<Geary.EmailIdentifier> ids) {
- if (search_query != null)
- append_new_email_async.begin(search_query, folder, ids, null, on_append_new_email_complete);
- }
-
private async void handle_removed_email_async(Geary.SearchQuery query, Geary.Folder folder,
Gee.Collection<Geary.EmailIdentifier> ids, Cancellable? cancellable) throws Error {
int result_mutex_token = yield result_mutex.claim_async();
@@ -117,20 +93,6 @@ private class Geary.ImapDB.SearchFolder : Geary.SearchFolder, Geary.FolderSuppor
throw error;
}
- private void on_handle_removed_email_complete(Object? source, AsyncResult result) {
- try {
- handle_removed_email_async.end(result);
- } catch(Error e) {
- debug("Error removing removed email from search results: %s", e.message);
- }
- }
-
- private void on_account_email_removed(Geary.Folder folder,
- Gee.Collection<Geary.EmailIdentifier> ids) {
- if (search_query != null)
- handle_removed_email_async.begin(search_query, folder, ids, null,
on_handle_removed_email_complete);
- }
-
/**
* Clears the search query and results.
*/
@@ -401,6 +363,16 @@ private class Geary.ImapDB.SearchFolder : Geary.SearchFolder, Geary.FolderSuppor
ImapDB.SearchEmailIdentifier.compare_descending);
}
+ private void on_folders_available_unavailable(Gee.Collection<Geary.Folder>? available,
+ Gee.Collection<Geary.Folder>? unavailable) {
+ if (available != null) {
+ // Exclude it from searching if it's got the right special type.
+ foreach(Geary.Folder folder in Geary.traverse<Geary.Folder>(available)
+ .filter(f => f.special_folder_type in EXCLUDE_TYPES))
+ exclude_folder(folder);
+ }
+ }
+
private void on_folders_special_type(Gee.Collection<Geary.Folder> folders) {
foreach (Geary.Folder folder in folders) {
if (folder.special_folder_type in EXCLUDE_TYPES) {
@@ -411,4 +383,42 @@ private class Geary.ImapDB.SearchFolder : Geary.SearchFolder, Geary.FolderSuppor
}
}
+ private void on_email_locally_complete(Geary.Folder folder,
+ Gee.Collection<Geary.EmailIdentifier> ids) {
+ if (search_query != null) {
+ this.append_new_email_async.begin(
+ search_query, folder, ids, null, on_append_new_email_complete
+ );
+ }
+ }
+
+ private void on_append_new_email_complete(GLib.Object? source,
+ GLib.AsyncResult result) {
+ try {
+ this.append_new_email_async.end(result);
+ } catch (GLib.Error e) {
+ debug("Error appending new email to search results: %s", e.message);
+ }
+ }
+
+ private void on_account_email_removed(Geary.Folder folder,
+ Gee.Collection<Geary.EmailIdentifier> ids) {
+ if (search_query != null) {
+ this.handle_removed_email_async.begin(
+ search_query, folder, ids, null,
+ on_handle_removed_email_complete
+ );
+ }
+ }
+
+ private void on_handle_removed_email_complete(GLib.Object? source,
+ GLib.AsyncResult result) {
+ try {
+ this.handle_removed_email_async.end(result);
+ } catch (GLib.Error e) {
+ debug("Error removing removed email from search results: %s",
+ e.message);
+ }
+ }
+
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]