[gtk+] GtkPlacesSidebar: Only create bookmarks for folders, not files
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkPlacesSidebar: Only create bookmarks for folders, not files
- Date: Wed, 22 May 2013 22:40:16 +0000 (UTC)
commit dc2f399dd0ccc0710ee46b2fce610237fe18d998
Author: Federico Mena Quintero <federico gnome org>
Date: Wed May 22 17:22:28 2013 -0500
GtkPlacesSidebar: Only create bookmarks for folders, not files
https://bugzilla.gnome.org/show_bug.cgi?id=561221
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkplacessidebar.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 4a04611..ed6af4a 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -1769,8 +1769,18 @@ drop_files_as_bookmarks (GtkPlacesSidebar *sidebar,
for (l = files; l; l = l->next) {
GFile *f = G_FILE (l->data);
+ GFileInfo *info = g_file_query_info (f,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ NULL,
+ NULL);
- _gtk_bookmarks_manager_insert_bookmark (sidebar->bookmarks_manager, f, position++, NULL); /*
NULL-GError */
+ if (info) {
+ if (_gtk_file_info_consider_as_directory (info))
+ _gtk_bookmarks_manager_insert_bookmark (sidebar->bookmarks_manager, f,
position++, NULL); /* NULL-GError */
+
+ g_object_unref (info);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]