[nautilus] application: open the home directory when no location is provided



commit de45140c8ee599c59885a607ca1d30c72266e89a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 2 18:28:14 2013 +0100

    application: open the home directory when no location is provided
    
    Instead of hitting an assertion later. This will be used in a later
    commit.
    Also, remove a duplicate debug message; we will print a similar one in
    nautilus_window_slot_open_location().

 src/nautilus-application.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index b65bc59..00db5c6 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -558,14 +558,15 @@ open_window (NautilusApplication *application,
 	     GFile *location, GdkScreen *screen, const char *geometry)
 {
 	NautilusWindow *window;
-	gchar *uri;
 
-	uri = g_file_get_uri (location);
-	DEBUG ("Opening new window at uri %s", uri);
 	nautilus_profile_start (NULL);
-	window = nautilus_application_create_window (application,
-						     screen);
-	nautilus_window_go_to (window, location);
+	window = nautilus_application_create_window (application, screen);
+
+	if (location != NULL) {
+		nautilus_window_go_to (window, location);
+	} else {
+		nautilus_window_slot_go_home (nautilus_window_get_active_slot (window), 0);
+	}
 
 	if (geometry != NULL && !gtk_widget_get_visible (GTK_WIDGET (window))) {
 		/* never maximize windows opened from shell if a
@@ -580,8 +581,6 @@ open_window (NautilusApplication *application,
 	}
 
 	nautilus_profile_end (NULL);
-
-	g_free (uri);
 }
 
 static void



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