summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-bookmark.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-10-22 16:56:19 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-10-22 16:56:19 -0400
commit71ad0d3adc2553ef5bcd06ec32600302e9169765 (patch)
tree0391df623c477d037bfd5320fb807ae7f165da36 /libnautilus-private/nautilus-bookmark.c
parent1dcd2d816a1278f7eec1d074ec5d9134af34a803 (diff)
downloadnautilus-71ad0d3adc2553ef5bcd06ec32600302e9169765.tar.gz
bookmark: add nautilus_bookmark_get_is_builtin()
Move the builtin check for bookmarks from the sidebar to a method on NautilusBookmark itself, since we need to use the same check in the bookmark window.
Diffstat (limited to 'libnautilus-private/nautilus-bookmark.c')
-rw-r--r--libnautilus-private/nautilus-bookmark.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-bookmark.c b/libnautilus-private/nautilus-bookmark.c
index 2cb8e9fee..4b3652d75 100644
--- a/libnautilus-private/nautilus-bookmark.c
+++ b/libnautilus-private/nautilus-bookmark.c
@@ -35,6 +35,7 @@
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-file-utilities.h>
+#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-icon-names.h>
#define DEBUG_FLAG NAUTILUS_DEBUG_BOOKMARKS
@@ -184,6 +185,25 @@ apply_warning_emblem (GIcon **base,
}
gboolean
+nautilus_bookmark_get_is_builtin (NautilusBookmark *bookmark)
+{
+ GUserDirectory xdg_type;
+
+ /* if this is not an XDG dir, it's never builtin */
+ if (!nautilus_bookmark_get_xdg_type (bookmark, &xdg_type)) {
+ return FALSE;
+ }
+
+ /* exclude XDG locations which are not in our builtin list */
+ if (xdg_type == G_USER_DIRECTORY_DESKTOP &&
+ !g_settings_get_boolean (gnome_background_preferences, NAUTILUS_PREFERENCES_SHOW_DESKTOP)) {
+ return FALSE;
+ }
+
+ return (xdg_type != G_USER_DIRECTORY_TEMPLATES) && (xdg_type != G_USER_DIRECTORY_PUBLIC_SHARE);
+}
+
+gboolean
nautilus_bookmark_get_xdg_type (NautilusBookmark *bookmark,
GUserDirectory *directory)
{