summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2020-01-14 19:05:51 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2020-01-14 19:23:15 +0200
commit05f9bc1605bdcb87018add23a615684b07edbe89 (patch)
tree8183037161432c818d1db547830740f2e089bbcf
parenta7d72cf69b2a641dc71b944a2e51a5654e33a60d (diff)
downloadgtk+-wip/muktupavels/webdav-master.tar.gz
pathbar: show webdav directorieswip/muktupavels/webdav-master
Currently pathbar is not updated for webdav directories and shows previous non-webdav location pathbar. The problem seems to be fact that last(?) parent is not local file in which case g_file_query_info_async returns "The specified location is not mounted" error.
-rw-r--r--gtk/gtkpathbar.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 37a7b05487..5b2f0cae49 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1497,6 +1497,20 @@ gtk_path_bar_set_file_finish (struct SetFileInfo *info,
g_free (info);
}
+static gboolean
+is_local (GFile *file)
+{
+ gchar *path;
+
+ path = g_file_get_path (file);
+ if (path == NULL)
+ return FALSE;
+
+ g_free (path);
+
+ return TRUE;
+}
+
static void
gtk_path_bar_get_info_callback (GCancellable *cancellable,
GFileInfo *info,
@@ -1558,6 +1572,8 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
}
file_info->parent_file = g_file_get_parent (file_info->file);
+ if (!is_local (file_info->parent_file))
+ g_clear_object (&file_info->parent_file);
/* Recurse asynchronously */
priv->get_info_cancellable = _gtk_file_system_get_info (priv->file_system,