[gnome-commander] When doing the GnomeCmdFile setup, take care about remote files
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] When doing the GnomeCmdFile setup, take care about remote files
- Date: Sun, 19 Sep 2021 19:29:31 +0000 (UTC)
commit af8098560a5f7ab7dbe3bf74ea2b241fd9670245
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun Sep 19 21:27:19 2021 +0200
When doing the GnomeCmdFile setup, take care about remote files
src/gnome-cmd-file.cc | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 8c5f98b2..1f441978 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -239,12 +239,25 @@ void gnome_cmd_file_setup (GnomeCmdFile *gnomeCmdFile, GFileInfo *gFileInfo, Gno
}
auto path = gnomeCmdFile->get_path();
-
if (path)
{
- GNOME_CMD_FILE_BASE (gnomeCmdFile)->gFile = g_file_new_for_path(path);
- gnomeCmdFile->gFile = GNOME_CMD_FILE_BASE (gnomeCmdFile)->gFile;
- g_free(path);
+ auto con = gnome_cmd_dir_get_connection(dir);
+ if (con && !con->is_local)
+ {
+ auto conUri = gnome_cmd_con_get_uri(con);
+ auto gFileTmp = g_file_new_for_uri (conUri);
+
+ GNOME_CMD_FILE_BASE (gnomeCmdFile)->gFile = g_file_resolve_relative_path (gFileTmp, path);
+ gnomeCmdFile->gFile = GNOME_CMD_FILE_BASE (gnomeCmdFile)->gFile;
+ g_free(path);
+ g_object_unref (gFileTmp);
+ }
+ else
+ {
+ GNOME_CMD_FILE_BASE (gnomeCmdFile)->gFile = g_file_new_for_path(path);
+ gnomeCmdFile->gFile = GNOME_CMD_FILE_BASE (gnomeCmdFile)->gFile;
+ g_free(path);
+ }
}
// EVERY GnomeCmdFile instance must have a gFile reference
if (!gnomeCmdFile->gFile)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]