aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-junk-hook.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-02 04:56:04 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-02 04:56:04 +0800
commitb2cda1d0c6d44f53f71bad9e256f41188677dfba (patch)
tree65bd7560e802baf1740482ae48b952dc5c5957fc /mail/em-junk-hook.c
parente52986f4225cbe8496043da74ca250521d244705 (diff)
downloadgsoc2013-evolution-b2cda1d0c6d44f53f71bad9e256f41188677dfba.tar.gz
gsoc2013-evolution-b2cda1d0c6d44f53f71bad9e256f41188677dfba.tar.zst
gsoc2013-evolution-b2cda1d0c6d44f53f71bad9e256f41188677dfba.zip
Merge revisions 36016:36533 from trunk.
svn path=/branches/kill-bonobo/; revision=36534
Diffstat (limited to 'mail/em-junk-hook.c')
-rw-r--r--mail/em-junk-hook.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/mail/em-junk-hook.c b/mail/em-junk-hook.c
index 62a05fd4ff..c4ea8b16f3 100644
--- a/mail/em-junk-hook.c
+++ b/mail/em-junk-hook.c
@@ -300,18 +300,52 @@ emjh_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root)
return 0;
}
+struct manage_error_idle_data
+{
+ const char *msg;
+ GError *error;
+};
+
static void
-manage_error (const char *msg, GError *error)
+free_mei (gpointer data)
+{
+ struct manage_error_idle_data *mei = (struct manage_error_idle_data*) data;
+
+ if (!mei)
+ return;
+
+ g_error_free (mei->error);
+ g_free (mei);
+}
+
+static gboolean
+manage_error_idle (gpointer data)
{
GtkWidget *w;
+ struct manage_error_idle_data *mei = (struct manage_error_idle_data *) data;
+
+ if (!mei)
+ return FALSE;
+
+ w = e_error_new (NULL, mei->msg, mei->error->message, NULL);
+ em_utils_show_error_silent (w);
+
+ return FALSE;
+}
+
+static void
+manage_error (const char *msg, GError *error)
+{
+ struct manage_error_idle_data *mei;
if (!error)
return;
- w = e_error_new (NULL, msg, error->message, NULL);
- em_utils_show_error_silent (w);
+ mei = g_new0 (struct manage_error_idle_data, 1);
+ mei->msg = msg; /* it's a static string, should be safe to use it as this */
+ mei->error = error;
- g_error_free (error);
+ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, manage_error_idle, mei, free_mei);
}
/*XXX: don't think we need here*/