[nautilus] slot: make sure we have signal handlers before disconnecting them
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] slot: make sure we have signal handlers before disconnecting them
- Date: Tue, 2 Oct 2012 19:53:04 +0000 (UTC)
commit 70bdd33e0dd4737687b0b5a53279a85a99257d0c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Oct 2 15:42:54 2012 -0400
slot: make sure we have signal handlers before disconnecting them
This makes the code more robust in case it's called e.g. with visible =
FALSE on a slot that already has the query editor hidden.
src/nautilus-window-slot.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index bdf3a3e..aaa567a 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -239,12 +239,20 @@ nautilus_window_slot_set_query_editor_visible (NautilusWindowSlot *slot,
} else {
gtk_widget_hide (GTK_WIDGET (slot->query_editor));
- g_signal_handler_disconnect (slot->query_editor, slot->qe_changed_id);
- slot->qe_changed_id = 0;
- g_signal_handler_disconnect (slot->query_editor, slot->qe_cancel_id);
- slot->qe_cancel_id = 0;
- g_signal_handler_disconnect (slot->query_editor, slot->qe_activated_id);
- slot->qe_activated_id = 0;
+
+ if (slot->qe_changed_id > 0) {
+ g_signal_handler_disconnect (slot->query_editor, slot->qe_changed_id);
+ slot->qe_changed_id = 0;
+ }
+ if (slot->qe_cancel_id > 0) {
+ g_signal_handler_disconnect (slot->query_editor, slot->qe_cancel_id);
+ slot->qe_cancel_id = 0;
+ }
+ if (slot->qe_activated_id > 0) {
+ g_signal_handler_disconnect (slot->query_editor, slot->qe_activated_id);
+ slot->qe_activated_id = 0;
+ }
+
nautilus_query_editor_set_query (slot->query_editor, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]