aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-browser.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-04-23 17:06:31 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-04-23 17:06:31 +0800
commit0696568dc90ebe0c1eab8e9b58a8f32707d1663c (patch)
treee9ff0006c8474eb02a7f826d21ef5e9faa0707bd /mail/em-folder-browser.c
parent4b831234e0a82f9694913f9286356abf344745a3 (diff)
downloadgsoc2013-evolution-0696568dc90ebe0c1eab8e9b58a8f32707d1663c.tar.gz
gsoc2013-evolution-0696568dc90ebe0c1eab8e9b58a8f32707d1663c.tar.zst
gsoc2013-evolution-0696568dc90ebe0c1eab8e9b58a8f32707d1663c.zip
** Fix for bug #529179
2008-04-23 Milan Crha <mcrha@redhat.com> ** Fix for bug #529179 * em-folder-browser.c: (struct _EMFolderBrowserPrivate), (labels_changed_idle_cb), (gconf_labels_changed), (emfb_destroy): Rebuild search menu rather on idle, then immediately after the change in gconf, because other parts may not have this change propagated yet. svn path=/trunk/; revision=35408
Diffstat (limited to 'mail/em-folder-browser.c')
-rw-r--r--mail/em-folder-browser.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index d8f5aa74ea..d9b790837d 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -130,6 +130,7 @@ struct _EMFolderBrowserPrivate {
EMMenu *menu; /* toplevel menu manager */
guint labels_change_notify_id; /* mail_config's notify id */
+ guint labels_change_idle_id; /* rebuild menu on idle, when all know about a change */
};
typedef struct EMFBSearchBarItem {
@@ -436,13 +437,27 @@ html_scroll (GtkHTML *html,
}
}
+static gboolean
+labels_changed_idle_cb (gpointer user_data)
+{
+ EMFolderBrowser *emfb = (EMFolderBrowser*) user_data;
+
+ emfb_realize (GTK_WIDGET (emfb));
+
+ emfb->priv->labels_change_idle_id = 0;
+
+ return FALSE;
+}
+
static void
gconf_labels_changed (GConfClient *client, guint cnxn_id,
GConfEntry *entry, gpointer user_data)
{
+ EMFolderBrowser *emfb = (EMFolderBrowser*) user_data;
+
/* regenerate menu option whenever something changed in labels */
- if (user_data)
- emfb_realize (user_data);
+ if (emfb && !emfb->priv->labels_change_idle_id)
+ emfb->priv->labels_change_idle_id = g_idle_add (labels_changed_idle_cb, emfb);
}
static void
@@ -580,6 +595,12 @@ emfb_destroy(GtkObject *o)
emfb->priv->labels_change_notify_id = 0;
}
+ if (emfb->priv->labels_change_idle_id) {
+ g_source_remove (emfb->priv->labels_change_idle_id);
+
+ emfb->priv->labels_change_idle_id = 0;
+ }
+
((GtkObjectClass *)emfb_parent)->destroy(o);
}