aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-19 05:43:24 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-07-19 05:43:24 +0800
commit75ecbc91bdc043517df8f45413499de6f53bc266 (patch)
treebb5564d51887e6deab828c45dc2a981fff541198 /modules
parentae3305a74b82cc31f9472ef87b4abcce65d0bc43 (diff)
downloadgsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.tar
gsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.tar.gz
gsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.tar.bz2
gsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.tar.lz
gsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.tar.xz
gsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.tar.zst
gsoc2013-evolution-75ecbc91bdc043517df8f45413499de6f53bc266.zip
EMailShellBackend: Fix an EAlertSink runtime warning.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-backend.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index a07a79fe62..6fab84bb96 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -472,12 +472,13 @@ mail_shell_backend_changes_committed_cb (EMailConfigWindow *window,
EMailShellBackend *mail_shell_backend)
{
EMailSession *session;
+ EShell *shell;
EShellBackend *shell_backend;
ESource *original_source;
CamelService *service;
EActivity *activity;
GCancellable *cancellable;
- GtkWindow *parent;
+ GList *list, *link;
const gchar *uid;
session = e_mail_config_window_get_session (window);
@@ -489,12 +490,20 @@ mail_shell_backend_changes_committed_cb (EMailConfigWindow *window,
shell_backend = E_SHELL_BACKEND (mail_shell_backend);
+ shell = e_shell_backend_get_shell (shell_backend);
+ list = gtk_application_get_windows (GTK_APPLICATION (shell));
+
activity = e_activity_new ();
- /* XXX Can we be sure the parent window will always implement
- * EAlertSink? May need some kind of fallback behavior. */
- parent = gtk_window_get_transient_for (GTK_WINDOW (window));
- e_activity_set_alert_sink (activity, E_ALERT_SINK (parent));
+ /* Find an EShellWindow to serve as an EAlertSink. */
+ for (link = list; link != NULL; link = g_list_next (link)) {
+ GtkWindow *window = GTK_WINDOW (link->data);
+
+ if (E_IS_SHELL_WINDOW (window)) {
+ EAlertSink *alert_sink = E_ALERT_SINK (window);
+ e_activity_set_alert_sink (activity, alert_sink);
+ }
+ }
cancellable = camel_operation_new ();
e_activity_set_cancellable (activity, cancellable);