evolution r36326 - trunk/mail
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36326 - trunk/mail
- Date: Sun, 14 Sep 2008 15:11:01 +0000 (UTC)
Author: msuman
Date: Sun Sep 14 15:11:01 2008
New Revision: 36326
URL: http://svn.gnome.org/viewvc/evolution?rev=36326&view=rev
Log:
Milan Crha <mcrha redhat com> Fix for bug #551915 (Manage error on idle, to call gtk functions in the main thread).
Modified:
trunk/mail/ChangeLog
trunk/mail/em-junk-hook.c
Modified: trunk/mail/em-junk-hook.c
==============================================================================
--- trunk/mail/em-junk-hook.c (original)
+++ trunk/mail/em-junk-hook.c Sun Sep 14 15:11:01 2008
@@ -300,18 +300,52 @@
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*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]