[gnome-commander] Change the way how async directory listing works for remote connectons



commit a5a166652a7c9f9878c7de15f7e3ee9473d2691a
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Wed Jan 5 15:01:43 2022 +0100

    Change the way how async directory listing works for remote connectons
    
    When a remote directory should be listed asynchronously, don't resolve the relative path between 
connection URI and the directory path.
    
    This is done because the URI to each directory is stored in each GnomeCmdDir gFile member. There should 
not be a need to resolve the relative path.

 src/dirlist.cc | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/src/dirlist.cc b/src/dirlist.cc
index 2e36ad33..d09da69f 100644
--- a/src/dirlist.cc
+++ b/src/dirlist.cc
@@ -116,23 +116,8 @@ void async_list (GnomeCmdDir *dir)
     GError *error = nullptr;
 
     dir->gFileInfoList = nullptr;
-    GFile *gFile;
-    auto con = gnome_cmd_dir_get_connection(dir);
-    if (con->is_local)
-    {
-        gFile = GNOME_CMD_FILE (dir)->gFile;
-    }
-    else
-    {
-        auto conUri = gnome_cmd_con_get_uri(con);
-        auto gFileTmp = g_file_new_for_uri (conUri);
-        auto dirPath = GNOME_CMD_FILE (dir)->get_path();
-        gFile = g_file_resolve_relative_path (gFileTmp, dirPath);
-
-        g_object_unref (gFileTmp);
-        g_free(dirPath);
-    }
 
+    auto gFile = GNOME_CMD_FILE (dir)->gFile;
     gchar *uri_str = g_file_get_uri(gFile);
     DEBUG('l', "async_list: %s\n", uri_str);
     g_free (uri_str);
@@ -140,7 +125,7 @@ void async_list (GnomeCmdDir *dir)
     dir->state = GnomeCmdDir::STATE_LISTING;
 
     GFileEnumerator *gFileEnumerator;
-    if (con->is_local)
+    if (gnome_cmd_dir_get_connection(dir)->is_local)
     {
         gFileEnumerator = get_gfileenumerator_sync(gFile, error);
         if (error)


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