diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 0aa05e4bc3..f930fea272 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -411,6 +411,18 @@ compare_for_selection (GtkPlacesSidebar *sidebar, } } +static char * +get_home_directory_uri (void) +{ + const char *home; + + home = g_get_home_dir (); + if (!home) + return NULL; + + return g_strconcat ("file://", home, NULL); +} + static void update_places (GtkPlacesSidebar *sidebar) { @@ -638,18 +650,20 @@ update_places (GtkPlacesSidebar *sidebar) /* add built in bookmarks */ /* home folder */ - mount_uri = nautilus_get_home_directory_uri (); - icon = g_themed_icon_new (NAUTILUS_ICON_HOME); - last_iter = add_place (sidebar, PLACES_BUILT_IN, - SECTION_COMPUTER, - _("Home"), icon, - mount_uri, NULL, NULL, NULL, 0, - _("Open your personal folder")); - g_object_unref (icon); - compare_for_selection (sidebar, - location, mount_uri, last_uri, - &last_iter, &select_path); - g_free (mount_uri); + mount_uri = get_home_directory_uri (); + if (mount_uri) { + icon = g_themed_icon_new ("user-home"); + last_iter = add_place (sidebar, PLACES_BUILT_IN, + SECTION_COMPUTER, + _("Home"), icon, + mount_uri, NULL, NULL, NULL, 0, + _("Open your personal folder")); + g_object_unref (icon); + compare_for_selection (sidebar, + location, mount_uri, last_uri, + &last_iter, &select_path); + g_free (mount_uri); + } if (g_settings_get_boolean (gnome_background_preferences, NAUTILUS_PREFERENCES_SHOW_DESKTOP) && !g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR)) {