summaryrefslogtreecommitdiff
path: root/gtk/gtkplacessidebar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-12-19 11:22:02 -0500
committerMatthias Clasen <mclasen@redhat.com>2013-12-19 11:22:02 -0500
commit465d4be3cf52dba4c4da98bfcba72a543a11ff1f (patch)
treec400b809ffd00fbef527abefb8ceca4c718fc400 /gtk/gtkplacessidebar.c
parent98bdc9321eb3cd841347e7380279a9ef68a14778 (diff)
downloadgtk+-465d4be3cf52dba4c4da98bfcba72a543a11ff1f.tar.gz
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.
Diffstat (limited to 'gtk/gtkplacessidebar.c')
-rw-r--r--gtk/gtkplacessidebar.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 979700fb98..9562dd8e76 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -838,14 +838,17 @@ update_places (GtkPlacesSidebar *sidebar)
if (sidebar->show_desktop)
{
mount_uri = get_desktop_directory_uri ();
- icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_DESKTOP);
- 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);
- g_free (mount_uri);
+ if (mount_uri)
+ {
+ icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_DESKTOP);
+ 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);
+ g_free (mount_uri);
+ }
}
/* XDG directories */