[nautilus] bookmark-list: add a can_bookmark() method
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] bookmark-list: add a can_bookmark() method
- Date: Mon, 22 Oct 2012 17:35:27 +0000 (UTC)
commit ddf3a8180c0f91d2327851c8a3a0538ca04440bd
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Oct 22 13:06:30 2012 -0400
bookmark-list: add a can_bookmark() method
Using the previously added API.
src/nautilus-bookmark-list.c | 11 +++++++++++
src/nautilus-bookmark-list.h | 2 ++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index 24dbe92..87d42dc 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -655,6 +655,17 @@ nautilus_bookmark_list_save_file (NautilusBookmarkList *bookmarks)
}
}
+gboolean
+nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
+ GFile *location)
+{
+ if (nautilus_bookmark_list_item_with_location (list, location)) {
+ return FALSE;
+ }
+
+ return !nautilus_is_home_directory (location);
+}
+
/**
* nautilus_bookmark_list_new:
*
diff --git a/src/nautilus-bookmark-list.h b/src/nautilus-bookmark-list.h
index 451e217..dc0459d 100644
--- a/src/nautilus-bookmark-list.h
+++ b/src/nautilus-bookmark-list.h
@@ -76,5 +76,7 @@ NautilusBookmark * nautilus_bookmark_list_item_with_location (NautilusBook
void nautilus_bookmark_list_move_item (NautilusBookmarkList *bookmarks,
guint index,
guint destination);
+gboolean nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
+ GFile *location);
#endif /* NAUTILUS_BOOKMARK_LIST_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]