[gtk/wip/muktupavels/webdav-gtk2] pathbar: show webdav directories



commit 53e237d72e276e5ad1e1ef2ed497618dbf85c8bd
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jan 14 19:05:51 2020 +0200

    pathbar: show webdav directories
    
    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.

 gtk/gtkpathbar.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 2813c8e945..a018820db0 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1630,6 +1630,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,
@@ -1683,6 +1697,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);
 
   file_info->path_bar->get_info_cancellable =
     _gtk_file_system_get_info (file_info->path_bar->file_system,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]