From 0160710ced687138ee26c2309588f49304de30dd Mon Sep 17 00:00:00 2001 From: Tomasz Wisniewski Date: Fri, 29 Jun 2012 09:06:43 +0200 Subject: [PATCH] shortcuts_fix --- thunar/thunar-shortcuts-model.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c index a2f67eb..3408e4d 100644 --- a/thunar/thunar-shortcuts-model.c +++ b/thunar/thunar-shortcuts-model.c @@ -794,10 +794,12 @@ thunar_shortcuts_model_load (ThunarShortcutsModel *model) { ThunarShortcut *shortcut; GtkTreePath *path; + GError *derror = NULL; const gchar *user_special_dir = NULL; ThunarFile *file; GFile *file_path; GFile *home; + gboolean file_is_uri = FALSE; gchar *bookmarks_path; gchar line[2048]; gchar *name; @@ -832,18 +834,27 @@ thunar_shortcuts_model_load (ThunarShortcutsModel *model) for (; g_ascii_isspace (*name); ++name) ; + /* check if the given bookmark points to external media */ + if (exo_str_looks_like_an_uri (line)) + { + file_is_uri = TRUE; + file = thunar_file_get_for_uri (line, &derror); + } + else + { /* parse the URI */ file_path = g_file_new_for_uri (line); /* try to open the file corresponding to the uri */ file = thunar_file_get (file_path, NULL); g_object_unref (file_path); + } if (G_UNLIKELY (file == NULL)) continue; /* make sure the file refers to a directory */ - if (G_UNLIKELY (thunar_file_is_directory (file))) + if (G_UNLIKELY (thunar_file_is_directory (file)) || file_is_uri) { /* create the shortcut entry */ shortcut = g_slice_new0 (ThunarShortcut); -- 1.7.11.1