GtkPlacesSidebar: Don't show desktop if its home

We go to extra length to set the desktop_uri to NULL when
desktop == home, but then we were adding the (non-functional)
place item anyway. Don't do that.
This commit is contained in:
Matthias Clasen 2013-12-19 11:22:02 -05:00
parent 98bdc9321e
commit 465d4be3cf

View File

@ -838,14 +838,17 @@ update_places (GtkPlacesSidebar *sidebar)
if (sidebar->show_desktop) if (sidebar->show_desktop)
{ {
mount_uri = get_desktop_directory_uri (); mount_uri = get_desktop_directory_uri ();
icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_DESKTOP); if (mount_uri)
add_place (sidebar, PLACES_BUILT_IN, {
SECTION_COMPUTER, icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_DESKTOP);
_("Desktop"), icon, mount_uri, add_place (sidebar, PLACES_BUILT_IN,
NULL, NULL, NULL, 0, SECTION_COMPUTER,
_("Open the contents of your desktop in a folder")); _("Desktop"), icon, mount_uri,
g_object_unref (icon); NULL, NULL, NULL, 0,
g_free (mount_uri); _("Open the contents of your desktop in a folder"));
g_object_unref (icon);
g_free (mount_uri);
}
} }
/* XDG directories */ /* XDG directories */