[geary/mjog/account-command-stacks: 63/77] Remove ConversationEmail::load_error
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/account-command-stacks: 63/77] Remove ConversationEmail::load_error
- Date: Tue, 5 Nov 2019 00:38:23 +0000 (UTC)
commit ac87b21e6ad80e2f2e6c5519e97598dde684cc09
Author: Michael Gratton <mike vee net>
Date: Tue Oct 29 12:47:45 2019 +1100
Remove ConversationEmail::load_error
The class can just handle submitting problem reports directly rather
than handballing to MainWindow to do so.
src/client/components/main-window.vala | 9 ---------
src/client/conversation-viewer/conversation-email.vala | 14 +++++++++-----
2 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index 9ca7575b..4ca33df0 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -1397,8 +1397,6 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
}
private void on_conversation_viewer_email_added(ConversationEmail view) {
- view.load_error.connect(on_email_load_error);
-
view.forward_message.connect(on_forward_message);
view.reply_all_message.connect(on_reply_all_message);
view.reply_to_message.connect(on_reply_to_message);
@@ -1797,13 +1795,6 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
}
}
- private void on_email_load_error(ConversationEmail view, GLib.Error err) {
- handle_error(
- this.selected_account != null ? this.selected_account.information : null,
- err
- );
- }
-
private void on_reply_to_message(ConversationEmail target_view) {
Geary.Account? account = this.selected_account;
if (account != null) {
diff --git a/src/client/conversation-viewer/conversation-email.vala
b/src/client/conversation-viewer/conversation-email.vala
index 7b29e3fb..e77e6bcb 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -248,9 +248,6 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
private bool shift_key_down;
- /** Fired when an error occurs loading the message body. */
- public signal void load_error(GLib.Error err);
-
/** Fired when the user clicks "reply" in the message menu. */
public signal void reply_to_message();
@@ -768,10 +765,17 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
}
}
- private void handle_load_failure(GLib.Error err) {
- load_error(err);
+ private void handle_load_failure(GLib.Error error) {
this.message_body_state = FAILED;
this.primary_message.show_load_error_pane();
+
+ MainWindow? main = get_toplevel() as MainWindow;
+ if (main != null) {
+ Geary.AccountInformation account = this.email_store.account.information;
+ main.application.controller.report_problem(
+ new Geary.ServiceProblemReport(account, account.incoming, error)
+ );
+ }
}
private void handle_load_offline() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]