[X2Go-Commits] x2goclient.git - build-main (branch) updated: 4.0.1.1-19-g74913d5

X2Go dev team git-admin at x2go.org
Tue Dec 17 15:43:30 CET 2013


The branch, build-main has been updated
       via  74913d557824edb1dedc0784223484070399e072 (commit)
      from  2f53855ca00741af1f2276163201607484ddd861 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    2 ++
 onmainwindow.cpp |   27 +++++++++++++++++----------
 onmainwindow.h   |    1 +
 3 files changed, 20 insertions(+), 10 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 2d6cd76..ef36c0f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ x2goclient (4.0.1.2-0~x2go2) UNRELEASED; urgency=low
     - Update man page for new --tray-icon cmdline option.
     - Properly handle (=expand) the "~" character in key filenames. (Brought to
       attention by Eldamir on IRC. Thanks!).
+    - Expand tilde operator for all other file paths handed over to X2Go Client
+      via sessions file or cmdline parameter.
   * Pull-in packaging changes from Debian.
 
   [ Ricardo Díaz Martín ]
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 164b2a6..9d1c353 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -2071,6 +2071,7 @@ void ONMainWindow::slotCreateDesktopIcon ( SessionButton* bt )
                          ( QVariant )
                          ":icons/128x128/x2gosession.png"
                      ).toString();
+    sessIcon = expandHome(sessIcon);
     if ( sessIcon.startsWith ( ":icons",Qt::CaseInsensitive ) ||
             !sessIcon.endsWith ( ".png",Qt::CaseInsensitive ) )
     {
@@ -2681,9 +2682,7 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session )
         currentKey=st->setting()->value (
                        sid+"/key",
                        ( QVariant ) QString::null ).toString();
-        if ( currentKey.startsWith("~") ) {
-            currentKey = currentKey.replace(QString("~"), QDir::homePath());
-        }
+        currentKey=expandHome(currentKey);
 
         autologin=st->setting()->value (
                       sid+"/autologin",
@@ -3179,6 +3178,14 @@ void ONMainWindow::continueLDAPSession()
     sshConnection->executeCommand ( "x2gogetservers", this, SLOT ( slotGetServers ( bool, QString,int ) ));
 }
 
+QString ONMainWindow::expandHome( QString path )
+{
+    if ( path.startsWith("~/") || path.startsWith("~\\") ) {
+        path = path.replace(QString("~"), QDir::homePath());
+    }
+    return path;
+}
+
 #ifdef Q_OS_LINUX
 void ONMainWindow::startDirectRDP()
 {
@@ -3423,9 +3430,7 @@ bool ONMainWindow::startSession ( const QString& sid )
                   sid+"/sshproxykeyfile",
                   QString()
               ).toString() );
-    if ( proxyKey.startsWith("~") ) {
-        proxyKey = proxyKey.replace(QString("~"), QDir::homePath());
-    }
+    proxyKey=expandHome(proxyKey);
 
     proxyserver=(st->setting()->value (
                      sid+"/sshproxyhost",
@@ -6546,7 +6551,7 @@ bool ONMainWindow::parseParameter ( QString param )
     }
     if ( setting=="--session-conf" )
     {
-        ONMainWindow::sessionCfg=value;
+        ONMainWindow::sessionCfg=expandHome(value);
         return true;
     }
     if ( setting=="--sessionid" )
@@ -6589,13 +6594,13 @@ bool ONMainWindow::parseParameter ( QString param )
     }
     if ( setting=="--read-exports-from" )
     {
-        readExportsFrom=value;
+        readExportsFrom=expandHome(value);
         return true;
     }
     if ( setting=="--external-login" )
     {
         extLogin=true;
-        readLoginsFrom=value;
+        readLoginsFrom=expandHome(value);
         return true;
     }
     if ( setting=="--ssh-port" )
@@ -6682,7 +6687,7 @@ bool ONMainWindow::parseParameter ( QString param )
     }
     if ( setting == "--auth-id")
     {
-        QFile file(value);
+        QFile file(expandHome(value));
         if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
         {
             printError ( param + tr(" (can't open file)"));
@@ -6726,6 +6731,8 @@ bool ONMainWindow::parseParameter ( QString param )
     {
         QDir dr;
 
+        value = expandHome(value);
+
 #ifdef Q_OS_WIN
         int find=value.indexOf("(");
         int lind=value.indexOf(")");
diff --git a/onmainwindow.h b/onmainwindow.h
index 7e51291..8bc1c6f 100644
--- a/onmainwindow.h
+++ b/onmainwindow.h
@@ -1088,6 +1088,7 @@ private:
     void printSshDError();
     void loadPulseModuleNativeProtocol();
     void initEmbedToolBar();
+    QString expandHome( QString path );
 #ifdef Q_OS_LINUX
     void startDirectRDP();
 #endif


hooks/post-receive
-- 
x2goclient.git (X2Go Client)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goclient.git" (X2Go Client).




More information about the x2go-commits mailing list