aboutsummaryrefslogtreecommitdiff
path: root/src/timezone-completion.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-07-08 09:36:52 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-07-08 09:36:52 -0400
commit5b77a3aec6cef0cf0c1c34d9b185ea0f110c6641 (patch)
treea2b904d64fd68ca304540c20e00ec4137f2013cb /src/timezone-completion.c
parent33d9b7f27eed027e1986ba4197d14434bc6ce37b (diff)
parentaf8dd7371a8743b02751fe2e71341f33de744fff (diff)
downloadayatana-indicator-datetime-5b77a3aec6cef0cf0c1c34d9b185ea0f110c6641.tar.gz
ayatana-indicator-datetime-5b77a3aec6cef0cf0c1c34d9b185ea0f110c6641.tar.bz2
ayatana-indicator-datetime-5b77a3aec6cef0cf0c1c34d9b185ea0f110c6641.zip
* New upstream release.
* libindicator 0.4 transition * Making preferences a gnome-control-center plugin * Calling gnome-control-center from the menu * Fixing timezone setting with new gsd * Dropped debian/patches/fix-timezones.patch: merged upstream
Diffstat (limited to 'src/timezone-completion.c')
-rw-r--r--src/timezone-completion.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/timezone-completion.c b/src/timezone-completion.c
index 6ba1e88..d190035 100644
--- a/src/timezone-completion.c
+++ b/src/timezone-completion.c
@@ -492,21 +492,26 @@ timezone_completion_watch_entry (TimezoneCompletion * completion, GtkEntry * ent
}
if (priv->entry) {
g_signal_handler_disconnect (priv->entry, priv->changed_id);
+ priv->changed_id = 0;
g_signal_handler_disconnect (priv->entry, priv->keypress_id);
+ priv->keypress_id = 0;
g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *)&priv->entry);
gtk_entry_set_completion (priv->entry, NULL);
}
- guint id = g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), completion);
- priv->changed_id = id;
+ priv->entry = entry;
- id = g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_keypress), completion);
- priv->keypress_id = id;
+ if (entry) {
+ guint id = g_signal_connect (entry, "changed", G_CALLBACK (entry_changed), completion);
+ priv->changed_id = id;
- priv->entry = entry;
- g_object_add_weak_pointer (G_OBJECT (entry), (gpointer *)&priv->entry);
+ id = g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_keypress), completion);
+ priv->keypress_id = id;
- gtk_entry_set_completion (entry, GTK_ENTRY_COMPLETION (completion));
+ g_object_add_weak_pointer (G_OBJECT (entry), (gpointer *)&priv->entry);
+
+ gtk_entry_set_completion (entry, GTK_ENTRY_COMPLETION (completion));
+ }
}
static GtkListStore *
@@ -640,7 +645,9 @@ timezone_completion_dispose (GObject * object)
}
if (priv->entry != NULL) {
+ gtk_entry_set_completion (priv->entry, NULL);
g_object_remove_weak_pointer (G_OBJECT (priv->entry), (gpointer *)&priv->entry);
+ priv->entry = NULL;
}
if (priv->initial_model != NULL) {