[X2Go-Commits] [x2goclient] 221/257: src/onmainwindow.cpp: refactor generateKey () a little bit to compact it.
git-admin at x2go.org
git-admin at x2go.org
Mon Nov 28 16:06:22 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 6f850ff02eddc4e5705c1a238db948a31a1a1bad
Author: Mihai Moldovan <ionic at ionic.de>
Date: Thu Sep 22 05:32:59 2016 +0200
src/onmainwindow.cpp: refactor generateKey () a little bit to compact it.
---
debian/changelog | 2 ++
src/onmainwindow.cpp | 19 ++++++++++---------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 5dcce76..666c0b5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -386,6 +386,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
- src/onmainwindow.{cpp,h}: rename generateHostKey () to generateKey ()
and add a boolean parameter with a default of false to request a public
key. Change old invocations of generateHostKey () accordingly.
+ - src/onmainwindow.cpp: refactor generateKey () a little bit to compact
+ it.
[ Bernard Cafarelli ]
* New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 831cd51..355a12a 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10355,21 +10355,22 @@ void ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key)
close ();
}
- QString etcDir = homeDir + "/.x2go/etc/";
- QDir dr (homeDir);
- dr.mkpath (etcDir);
- QString private_key_file = etcDir + "/ssh_host_" + stringified_key_type + "_key";
+ QString etc_dir = homeDir + "/.x2go/etc/";
+ QDir dir (homeDir);
+ dir.mkpath (etc_dir);
+ QString private_key_file = "";
+#ifdef Q_OS_WIN
+ private_key_file = cygwinPath (wapiShortFileName (etc_dir));
+#else
+ private_key_file = etc_dir;
+#endif
+ private_key_file += "/ssh_host_" + stringified_key_type + "_key";
QString public_key_file = private_key_file + ".pub";
if ((!(QFile::exists (private_key_file))) || (!(QFile::exists (public_key_file))))
{
x2goDebug << "Generating host key. Type: " << stringified_key_type;
-#ifdef Q_OS_WIN
- private_key_file = cygwinPath (wapiShortFileName (etcDir))
- + "/ssh_host_" + stringified_key_type + "_key";
-#endif
-
QStringList args;
args << "-t"
<< stringified_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