[nautilus] window-pane: don't open another window when toggling off the search



commit 0e6d9d7da5e2deac33d14261fbe9a22bbc7de192
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Feb 23 15:51:38 2011 -0500

    window-pane: don't open another window when toggling off the search
    
    When 'Open new windows in separate folders' is toggled.
    This is not yet complete, but fixes at least one case.

 src/nautilus-window-pane.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/src/nautilus-window-pane.c b/src/nautilus-window-pane.c
index 6dc83f5..9c35cbf 100644
--- a/src/nautilus-window-pane.c
+++ b/src/nautilus-window-pane.c
@@ -613,12 +613,10 @@ action_show_hide_search_callback (GtkAction *action,
 		GFile *location = NULL;
 
 		slot = pane->active_slot;
+		nautilus_window_pane_hide_search_bar (pane);
 
 		/* Use the location bar as the return location */
-		if (slot->query_editor == NULL){
-			location = nautilus_window_slot_get_location (slot);
-		/* Use the search location as the return location */
-		} else {
+		if (slot->query_editor != NULL) {
 			NautilusQuery *query;
 			char *uri;
 
@@ -631,17 +629,15 @@ action_show_hide_search_callback (GtkAction *action,
 				}
 				g_object_unref (query);
 			}
-		}
-
-		/* Last try: use the home directory as the return location */
-		if (location == NULL) {
-			location = g_file_new_for_path (g_get_home_dir ());
-		}
 
-		nautilus_window_go_to (window, location);
-		g_object_unref (location);
+			/* Last try: use the home directory as the return location */
+			if (location == NULL) {
+				location = g_file_new_for_path (g_get_home_dir ());
+			}
 
-		nautilus_window_pane_hide_search_bar (pane);
+			nautilus_window_go_to (window, location);
+			g_object_unref (location);
+		}
 	}
 }
 



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