Replacement for nautilus_get_home_directory_uri()

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This commit is contained in:
Federico Mena Quintero 2011-10-03 11:08:25 -05:00
parent 0bc1be008c
commit c2a922bfcb

View File

@ -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)) {