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:05:51 +0200
commit54bebe19b83d61588e58e1842d173793b1bb1b34 (patch)
tree189b30d0e5abaa38c5471a1197b0787957d9f002
parent0bffcd8882c6ca52f41b1499bd98ebec38d757fe (diff)
downloadgtk+-wip/muktupavels/webdav-gtk3.tar.gz
pathbar: show webdav directorieswip/muktupavels/webdav-gtk3
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 99d5282888..9d1e497491 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1729,6 +1729,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,
@@ -1789,6 +1803,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 */
file_info->path_bar->priv->get_info_cancellable =