[gnome-commander] Get the username and store it already when the user sets up a new remote connection



commit 247f6d5fcccb74367007a28351badca4c8bed5a0
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sun Sep 26 23:15:56 2021 +0200

    Get the username and store it already when the user sets up a new remote connection

 src/gnome-cmd-con-remote.cc | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/gnome-cmd-con-remote.cc b/src/gnome-cmd-con-remote.cc
index 34cca978..70e2e246 100644
--- a/src/gnome-cmd-con-remote.cc
+++ b/src/gnome-cmd-con-remote.cc
@@ -263,18 +263,21 @@ GnomeCmdConRemote *gnome_cmd_con_remote_new (const gchar *alias, const string &u
 
     GError *error = nullptr;
 
+    gchar *user = nullptr;
     gchar *host = nullptr;
     gint port = 0;
     gchar *path = nullptr;
 
-    g_uri_split (
+    g_uri_split_with_user (
         uri_str.c_str(),
-        G_URI_FLAGS_NONE,
+        G_URI_FLAGS_HAS_PASSWORD,
         nullptr, //scheme
-        nullptr, //userinfo
-        &host,
-        &port,
-        &path,
+        &user,
+        nullptr, //password
+        nullptr, //auth_params
+        &host, //host
+        &port, //port
+        &path, //path
         nullptr, //query
         nullptr, //fragment
         &error
@@ -290,6 +293,7 @@ GnomeCmdConRemote *gnome_cmd_con_remote_new (const gchar *alias, const string &u
 
     gnome_cmd_con_set_alias (con, alias);
     gnome_cmd_con_set_uri (con, uri_str.c_str());
+    gnome_cmd_con_set_user_name (con, user);
     gnome_cmd_con_set_host_name (con, host);
     gnome_cmd_con_set_port (con, port);
     gnome_cmd_con_set_root_path (con, path);


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