[X2Go-Commits] [x2goclient] 257/267: src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance.

git-admin at x2go.org git-admin at x2go.org
Sat Dec 10 13:36:30 CET 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit 09241131872d7e45b54f884f00f4f795300840af
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Oct 26 22:05:10 2016 +0200

    src/onmainwindow.cpp: use QFileInfo to get the key file's basename in exportDirs () instead of the old, potentially faulty string replace dance.
---
 debian/changelog     |    3 +++
 src/onmainwindow.cpp |   11 +++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index dfef957..fe4d3ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -465,6 +465,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
       it back.
     - src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in
       generateKey (). Refactor a bit to drop the now-unnecessary ret variable.
+    - src/onmainwindow.cpp: use QFileInfo to get the key file's basename in
+      exportDirs () instead of the old, potentially faulty string replace
+      dance.
 
   [ Bernard Cafarelli ]
   * New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 95a8dce..d51525d 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -7965,12 +7965,11 @@ void ONMainWindow::exportDirs ( QString exports,bool removable )
 
 
     QString uname=getCurrentUname();
-    QString dst=dr.key;
-    QString dhdir=homeDir+"/.x2go";
-#ifdef Q_OS_WIN
-    dhdir=wapiShortFileName ( dhdir );
-#endif
-    dst.replace ( dhdir +"/ssh/gen/","" );
+
+    /* For the destination, fetch the base name only. */
+    QFileInfo tmp_file_info (dr.key);
+    QString dst = tmp_file_info.fileName ();
+
     dst="~"+uname +"/.x2go/ssh/"+dst;
     dr.dstKey=dst;
     dr.isRemovable=removable;

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list