[nautilus] places-sidebar: make Desktop dir bookmarkable if not shown by default
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] places-sidebar: make Desktop dir bookmarkable if not shown by default
- Date: Mon, 19 Dec 2011 09:22:45 +0000 (UTC)
commit 773fdc3e2ba7fef4bf824c865a0f3aba14fc785a
Author: Stefano Teso <stefano teso gmail com>
Date: Sun Dec 4 14:19:21 2011 +0100
places-sidebar: make Desktop dir bookmarkable if not shown by default
See: https://bugzilla.gnome.org/show_bug.cgi?id=663956
src/nautilus-places-sidebar.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index a9d6b34..fc6a312 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -266,6 +266,13 @@ get_eject_icon (NautilusPlacesSidebar *sidebar,
}
static gboolean
+should_show_desktop (void)
+{
+ return g_settings_get_boolean (gnome_background_preferences, NAUTILUS_PREFERENCES_SHOW_DESKTOP) &&
+ !g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR);
+}
+
+static gboolean
is_built_in_bookmark (NautilusFile *file)
{
gboolean built_in;
@@ -275,6 +282,10 @@ is_built_in_bookmark (NautilusFile *file)
return TRUE;
}
+ if (nautilus_file_is_desktop_directory (file) && !should_show_desktop ()) {
+ return FALSE;
+ }
+
built_in = FALSE;
for (idx = 0; idx < G_USER_N_DIRECTORIES; idx++) {
@@ -678,8 +689,7 @@ update_places (NautilusPlacesSidebar *sidebar)
&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)) {
+ if (should_show_desktop ()) {
/* desktop */
desktop_path = nautilus_get_desktop_directory ();
mount_uri = g_filename_to_uri (desktop_path, NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]