[geary: 5/66] Signalling for locally removed messages
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 5/66] Signalling for locally removed messages
- Date: Tue, 30 Jun 2020 07:07:49 +0000 (UTC)
commit 52bd48bab5f520d2ef68f912c085f27565315920
Author: Chris Heywood <15127-creywood users noreply gitlab gnome org>
Date: Wed Jan 8 11:04:51 2020 +0100
Signalling for locally removed messages
src/engine/api/geary-account.vala | 10 ++++++++++
src/engine/api/geary-folder.vala | 6 ++++++
src/engine/app/app-conversation-monitor.vala | 2 ++
src/engine/app/app-search-folder.vala | 2 ++
src/engine/imap-engine/imap-engine-generic-account.vala | 7 +++++++
5 files changed, 27 insertions(+)
---
diff --git a/src/engine/api/geary-account.vala b/src/engine/api/geary-account.vala
index 37ade9e3a..30bb1d1ba 100644
--- a/src/engine/api/geary-account.vala
+++ b/src/engine/api/geary-account.vala
@@ -236,6 +236,11 @@ public abstract class Geary.Account : BaseObject, Logging.Source {
*/
public signal void email_removed(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> ids);
+ /**
+ * Fired when emails are removed from a local folder in this account.
+ */
+ public signal void email_locally_removed(Geary.Folder folder, Gee.Collection<Geary.EmailIdentifier> ids);
+
/**
* Fired when one or more emails have been locally saved to a folder with
* the full set of Fields.
@@ -549,6 +554,11 @@ public abstract class Geary.Account : BaseObject, Logging.Source {
email_removed(folder, ids);
}
+ /** Fires a {@link email_locally_removed} signal. */
+ protected virtual void notify_email_locally_removed(Geary.Folder folder,
Gee.Collection<Geary.EmailIdentifier> ids) {
+ email_locally_removed(folder, ids);
+ }
+
/** Fires a {@link email_locally_complete} signal. */
protected virtual void notify_email_locally_complete(Geary.Folder folder,
Gee.Collection<Geary.EmailIdentifier> ids) {
diff --git a/src/engine/api/geary-folder.vala b/src/engine/api/geary-folder.vala
index 2602f87ef..a219c282d 100644
--- a/src/engine/api/geary-folder.vala
+++ b/src/engine/api/geary-folder.vala
@@ -364,6 +364,12 @@ public abstract class Geary.Folder : BaseObject, Logging.Source {
*/
public signal void email_removed(Gee.Collection<Geary.EmailIdentifier> ids);
+
+ /**
+ * Fired when emails are removed from the local folder.
+ */
+ public signal void email_locally_removed(Gee.Collection<Geary.EmailIdentifier> ids);
+
/**
* Fired when the total count of email in a folder has changed in any way.
*
diff --git a/src/engine/app/app-conversation-monitor.vala b/src/engine/app/app-conversation-monitor.vala
index a4de164db..7b87b783c 100644
--- a/src/engine/app/app-conversation-monitor.vala
+++ b/src/engine/app/app-conversation-monitor.vala
@@ -320,6 +320,7 @@ public class Geary.App.ConversationMonitor : BaseObject {
this.base_folder.email_inserted.connect(on_folder_email_inserted);
this.base_folder.email_locally_complete.connect(on_folder_email_complete);
this.base_folder.email_removed.connect(on_folder_email_removed);
+ this.base_folder.email_locally_removed.connect(on_folder_email_removed);
this.base_folder.opened.connect(on_folder_opened);
this.base_folder.account.email_appended.connect(on_account_email_appended);
this.base_folder.account.email_inserted.connect(on_account_email_inserted);
@@ -653,6 +654,7 @@ public class Geary.App.ConversationMonitor : BaseObject {
this.base_folder.email_inserted.disconnect(on_folder_email_inserted);
this.base_folder.email_locally_complete.disconnect(on_folder_email_complete);
this.base_folder.email_removed.disconnect(on_folder_email_removed);
+ this.base_folder.email_locally_removed.disconnect(on_folder_email_removed);
this.base_folder.opened.disconnect(on_folder_opened);
this.base_folder.account.email_appended.disconnect(on_account_email_appended);
this.base_folder.account.email_inserted.disconnect(on_account_email_inserted);
diff --git a/src/engine/app/app-search-folder.vala b/src/engine/app/app-search-folder.vala
index 5867dd0e0..bdc3f743b 100644
--- a/src/engine/app/app-search-folder.vala
+++ b/src/engine/app/app-search-folder.vala
@@ -129,6 +129,7 @@ public class Geary.App.SearchFolder :
account.folders_special_type.connect(on_folders_special_type);
account.email_locally_complete.connect(on_email_locally_complete);
account.email_removed.connect(on_account_email_removed);
+ account.email_locally_removed.connect(on_account_email_removed);
new_contents();
@@ -142,6 +143,7 @@ public class Geary.App.SearchFolder :
account.folders_special_type.disconnect(on_folders_special_type);
account.email_locally_complete.disconnect(on_email_locally_complete);
account.email_removed.disconnect(on_account_email_removed);
+ account.email_locally_removed.disconnect(on_account_email_removed);
}
/**
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 0605c5de8..0cfc9ae15 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -764,6 +764,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
folder.email_appended.connect(notify_email_appended);
folder.email_inserted.connect(notify_email_inserted);
folder.email_removed.connect(notify_email_removed);
+ folder.email_locally_removed.connect(notify_email_locally_removed);
folder.email_locally_complete.connect(notify_email_locally_complete);
folder.email_flags_changed.connect(notify_email_flags_changed);
}
@@ -773,6 +774,7 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
folder.email_appended.disconnect(notify_email_appended);
folder.email_inserted.disconnect(notify_email_inserted);
folder.email_removed.disconnect(notify_email_removed);
+ folder.email_locally_removed.disconnect(notify_email_locally_removed);
folder.email_locally_complete.disconnect(notify_email_locally_complete);
folder.email_flags_changed.disconnect(notify_email_flags_changed);
}
@@ -797,6 +799,11 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
schedule_unseen_update(folder);
}
+ /** {@inheritDoc} */
+ protected override void notify_email_locally_removed(Geary.Folder folder,
Gee.Collection<Geary.EmailIdentifier> ids) {
+ base.notify_email_locally_removed(folder, ids);
+ }
+
/** {@inheritDoc} */
protected override void notify_email_flags_changed(Geary.Folder folder,
Gee.Map<Geary.EmailIdentifier, Geary.EmailFlags> flag_map) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]