diff --git a/plugins/filebrowser/lapiz-file-bookmarks-store.c b/plugins/filebrowser/lapiz-file-bookmarks-store.c index fb334c8..ac52575 100644 --- a/plugins/filebrowser/lapiz-file-bookmarks-store.c +++ b/plugins/filebrowser/lapiz-file-bookmarks-store.c @@ -828,10 +828,8 @@ lapiz_file_bookmarks_store_get_uri (LapizFileBookmarksStore * model, CtkTreeIter * iter) { GObject * obj; - GFile * file = NULL; guint flags; gchar * ret = NULL; - gboolean isfs; g_return_val_if_fail (LAPIZ_IS_FILE_BOOKMARKS_STORE (model), NULL); g_return_val_if_fail (iter != NULL, NULL); @@ -843,26 +841,24 @@ lapiz_file_bookmarks_store_get_uri (LapizFileBookmarksStore * model, &obj, -1); - if (obj == NULL) - return NULL; - - isfs = (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_FS); - - if (isfs && (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_MOUNT)) - { - file = g_mount_get_root (G_MOUNT (obj)); - } - else if (!isfs) + if (obj != NULL) { - file = g_object_ref (obj); - } - - g_object_unref (obj); + if (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_FS) + { + if (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_MOUNT) + { + GFile * file; - if (file) - { - ret = g_file_get_uri (file); - g_object_unref (file); + file = g_mount_get_root (G_MOUNT (obj)); + ret = g_file_get_uri (file); + g_object_unref (file); + } + } + else + { + ret = g_file_get_uri (G_FILE (obj)); + } + g_object_unref (obj); } return ret;