Commit 2e372626 authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Emmanuele Bassi

Use the right object when disconnecting from the GtkRecentManager::changed

2006-12-31  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c (set_recent_manager): Use the
	right object when disconnecting from the GtkRecentManager::changed
	signal; save us a few indirections using a variable.

svn path=/trunk/; revision=16999
parent ccd897d2
2006-12-31 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchoosermenu.c (set_recent_manager): Use the
right object when disconnecting from the GtkRecentManager::changed
signal; save us a few indirections using a variable.
2006-12-31 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchoosermenu.c: Move the signal and idle
......
......@@ -264,7 +264,9 @@ gtk_recent_chooser_menu_dispose (GObject *object)
if (priv->manager_changed_id)
{
g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
if (priv->manager)
g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
priv->manager_changed_id = 0;
}
......@@ -1157,21 +1159,25 @@ static void
set_recent_manager (GtkRecentChooserMenu *menu,
GtkRecentManager *manager)
{
if (menu->priv->manager)
GtkRecentChooserMenuPrivate *priv = menu->priv;
if (priv->manager)
{
g_signal_handler_disconnect (menu, menu->priv->manager_changed_id);
menu->priv->manager = NULL;
if (priv->manager_changed_id)
g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
priv->manager = NULL;
}
if (manager)
menu->priv->manager = manager;
priv->manager = manager;
else
menu->priv->manager = gtk_recent_manager_get_default ();
priv->manager = gtk_recent_manager_get_default ();
if (menu->priv->manager)
menu->priv->manager_changed_id = g_signal_connect (menu->priv->manager, "changed",
G_CALLBACK (manager_changed_cb),
menu);
if (priv->manager)
priv->manager_changed_id = g_signal_connect (priv->manager, "changed",
G_CALLBACK (manager_changed_cb),
menu);
/* (re)populate the menu */
gtk_recent_chooser_menu_populate (menu);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment