diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-05 05:07:15 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-05 05:07:15 +0800 |
commit | 983fce5e535e4e203815767cf6899f6dc8c5242a (patch) | |
tree | d6ca3538c046798597275132c66be6da18733d7f /modules/mail/e-mail-junk-hook.c | |
parent | c95a226217a68703c48397c23ea8accc491d44e4 (diff) | |
download | gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.gz gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.zst gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.zip |
Kill the default parent window hack in e-error.c.
Fix as many cases that relied on it as I could find, but there may be
more cases out there. They should be fixed too. Passing a NULL parent
window to e_error_new() is illegal and will emit a runtime warning.
Diffstat (limited to 'modules/mail/e-mail-junk-hook.c')
-rw-r--r-- | modules/mail/e-mail-junk-hook.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/mail/e-mail-junk-hook.c b/modules/mail/e-mail-junk-hook.c index 2687223af9..f19b502f69 100644 --- a/modules/mail/e-mail-junk-hook.c +++ b/modules/mail/e-mail-junk-hook.c @@ -25,6 +25,8 @@ #include <camel/camel-junk-plugin.h> #include "e-util/e-error.h" +#include "shell/e-shell.h" + #include "mail/em-junk.h" #include "mail/em-utils.h" #include "mail/mail-session.h" @@ -48,10 +50,17 @@ static GType mail_junk_hook_type; static gboolean mail_junk_hook_idle_cb (struct ErrorData *data) { + EShell *shell; + GtkWindow *parent; GtkWidget *widget; + GList *windows; + + shell = e_shell_get_default (); + windows = e_shell_get_watched_windows (shell); + parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL; widget = e_error_new ( - NULL, data->error_message, data->error->message, NULL); + parent, data->error_message, data->error->message, NULL); em_utils_show_error_silent (widget); g_error_free (data->error); |