From 8926c42fd69d02ea4ff977039e37fd64d98ee039 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 31 Dec 2017 17:59:59 -0500 Subject: places-sidebar: show user's home dir when it is also the desktop Current behavior is to show Desktop but hide the user's home directory in the sidebar when desktop-is-home-directory is set. This is opposite what would be expected so invert it. Patch by https://github.com/TomaszGasior --- src/caja-places-sidebar.c | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index 9aba1bb8..ba2e6c0e 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -490,42 +490,42 @@ update_places (CajaPlacesSidebar *sidebar) _("Computer")); /* add built in bookmarks */ - desktop_path = caja_get_desktop_directory (); /* home folder */ - if (strcmp (g_get_home_dir(), desktop_path) != 0) { - char *display_name; - - mount_uri = caja_get_home_directory_uri (); - display_name = g_filename_display_basename (g_get_home_dir ()); - icon = g_themed_icon_new (CAJA_ICON_HOME); - last_iter = add_place (sidebar, PLACES_BUILT_IN, - SECTION_COMPUTER, - display_name, icon, - mount_uri, NULL, NULL, NULL, 0, - _("Open your personal folder")); - g_object_unref (icon); - g_free (display_name); - compare_for_selection (sidebar, - location, mount_uri, last_uri, - &last_iter, &select_path); - g_free (mount_uri); - } + char *display_name; - /* desktop */ - mount_uri = g_filename_to_uri (desktop_path, NULL, NULL); - icon = g_themed_icon_new (CAJA_ICON_DESKTOP); + mount_uri = caja_get_home_directory_uri (); + display_name = g_filename_display_basename (g_get_home_dir ()); + icon = g_themed_icon_new (CAJA_ICON_HOME); last_iter = add_place (sidebar, PLACES_BUILT_IN, SECTION_COMPUTER, - _("Desktop"), icon, + display_name, icon, mount_uri, NULL, NULL, NULL, 0, - _("Open the contents of your desktop in a folder")); + _("Open your personal folder")); g_object_unref (icon); + g_free (display_name); compare_for_selection (sidebar, location, mount_uri, last_uri, &last_iter, &select_path); g_free (mount_uri); - g_free (desktop_path); + + /* desktop */ + desktop_path = caja_get_desktop_directory (); + if (strcmp (g_get_home_dir(), desktop_path) != 0) { + mount_uri = g_filename_to_uri (desktop_path, NULL, NULL); + icon = g_themed_icon_new (CAJA_ICON_DESKTOP); + last_iter = add_place (sidebar, PLACES_BUILT_IN, + SECTION_COMPUTER, + _("Desktop"), icon, + mount_uri, NULL, NULL, NULL, 0, + _("Open the contents of your desktop in a folder")); + g_object_unref (icon); + compare_for_selection (sidebar, + location, mount_uri, last_uri, + &last_iter, &select_path); + g_free (mount_uri); + } + g_free (desktop_path); /* file system root */ mount_uri = "file:///"; /* No need to strdup */ -- cgit v1.2.1