[X2Go-Commits] [x2goclient] 256/276: src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in generateKey ().

git-admin at x2go.org git-admin at x2go.org
Sat Dec 31 01:35:38 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 e5cf0f17147cc811e2616259ae33f10fae62d622
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Oct 26 21:27:37 2016 +0200

    src/onmainwindow.cpp: only pass non-Cygwin paths to QFile::exists () in generateKey ().
    
    Refactor a bit to drop the now-unnecessary ret variable.
---
 debian/changelog     |    2 ++
 src/onmainwindow.cpp |   23 ++++++++++++++---------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1e9ce34..c0d348b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -465,6 +465,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
       constructor.
     - src/onmainwindow.h: actually, we do need startSshd () to be public. Move
       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.
 
   [ Bernard Cafarelli ]
   * New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 0e69ac5..95a8dce 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10253,8 +10253,6 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k
   QString stringified_key_type (key_type_to_string (key_type));
   std::size_t key_bits = default_size_for_key_type (key_type);
 
-  QString ret ("");
-
   QString base_dir (homeDir);
   QString private_key_file ("");
 
@@ -10276,12 +10274,10 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k
     }
   }
 
-#ifdef Q_OS_WIN
-  private_key_file = cygwinPath (wapiShortFileName (base_dir));
-#else
   private_key_file = base_dir;
+#ifdef Q_OS_WIN
+  QString private_key_file_cygwin = cygwinPath (wapiShortFileName (base_dir));
 #endif
-  ret = base_dir;
 
   {
     QString tmp_to_add ("");
@@ -10304,14 +10300,23 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k
     }
 
     private_key_file += tmp_to_add;
-    ret += tmp_to_add;
+#ifdef Q_OS_WIN
+    private_key_file_cygwin += tmp_to_add;
+#endif
   }
 
   QString public_key_file (private_key_file + ".pub");
 
   if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file)))) {
     x2goDebug << "Generating SSH key. Type: " << stringified_key_type.toUpper ()
-              << "; Location: " << private_key_file;
+              << "; Location: "
+              <<
+#ifdef Q_OS_WIN
+                 private_key_file_cygwin
+#else
+                 private_key_file
+#endif
+              ;
 
     QStringList args;
 
@@ -10366,7 +10371,7 @@ QString ONMainWindow::generateKey (ONMainWindow::key_types key_type, bool host_k
     }
   }
 
-  return (ret);
+  return (private_key_file);
 }
 
 QString ONMainWindow::createKeyBundle (key_types key_type) {

--
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