[nautilus] window-slot: simplify code



commit 79e915b6fad372878d79a52f814017600ccb3884
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed May 30 10:08:00 2012 -0400

    window-slot: simplify code
    
    Use gtk_widget_get_visible() instead of an additional member for
    NautilusWindowSlot, since it's a widget now.

 src/nautilus-window-slot.c |    1 -
 src/nautilus-window-slot.h |    2 --
 src/nautilus-window.c      |   11 +++--------
 3 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 3ebdbe9..cd23d85 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -179,7 +179,6 @@ nautilus_window_slot_init (NautilusWindowSlot *slot)
 
 	gtk_orientable_set_orientation (GTK_ORIENTABLE (slot),
 					GTK_ORIENTATION_VERTICAL);
-	gtk_widget_show (GTK_WIDGET (slot));
 
 	extras_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
 	slot->extra_location_widgets = extras_vbox;
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index a1ef1c8..2c3b2cb 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -106,8 +106,6 @@ struct NautilusWindowSlot {
 
 	GCancellable *find_mount_cancellable;
 
-	gboolean visible;
-
 	/* Back/Forward chain, and history list. 
 	 * The data in these lists are NautilusBookmark pointers. 
 	 */
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index f7ded56..868dc4c 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1458,24 +1458,19 @@ nautilus_window_view_visible (NautilusWindow *window,
 
 	slot = nautilus_window_get_slot_for_view (window, view);
 
-	if (slot->visible) {
+	if (gtk_widget_get_visible (GTK_WIDGET (slot))) {
 		return;
 	}
 
-	slot->visible = TRUE;
+	gtk_widget_show (GTK_WIDGET (slot));
 
 	/* Look for other non-visible slots */
 	for (l = window->details->slots; l != NULL; l = l->next) {
 		slot = l->data;
 
-		if (!slot->visible) {
+		if (!gtk_widget_get_visible (GTK_WIDGET (slot))) {
 			return;
 		}
-	}
-
-	/* Look for other non-visible slots */
-	for (l = window->details->slots; l != NULL; l = l->next) {
-		slot = l->data;
 
 		nautilus_window_slot_update_title (slot);
 		nautilus_window_slot_update_icon (slot);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]