This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 08ef3bcbfd19f1f7ab8486b21f62afb171f15031 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon May 25 04:19:55 2015 +0200 sessionexplorer.cpp: use a better shared logic for generating an arguments list for calling x2goclient.exe from a desktop shortcut. Respect the tray icon option also on Windows. Fixes: #871. --- debian/changelog | 3 +++ src/sessionexplorer.cpp | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 23500bc..41af179 100644 --- a/debian/changelog +++ b/debian/changelog @@ -427,6 +427,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low + wapi.cpp - sshmasterconnection.cpp: fix typo in last commit leading to a compile failure, correct content, remove superfluous newlines. + - sessionexplorer.cpp: use a better shared logic for generating an + arguments list for calling x2goclient.exe from a desktop shortcut. + Respect the tray icon option also on Windows. Fixes: #871. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/sessionexplorer.cpp b/src/sessionexplorer.cpp index 0ccbae9..8e54028 100644 --- a/src/sessionexplorer.cpp +++ b/src/sessionexplorer.cpp @@ -176,6 +176,17 @@ void SessionExplorer::slotCreateDesktopIcon ( SessionButton* bt ) { sessIcon="/usr/share/x2goclient/icons/x2gosession.png"; } + + QString cmd="x2goclient"; + QStringList args; + if ( crHidden ) + args << "--hide"; + + if (bShowTrayicon) + args << "--tray-icon"; + + args << QString ("--sessionid=" + bt->id ()); + #ifndef Q_OS_WIN QFile file ( QDesktopServices::storageLocation ( @@ -183,16 +194,9 @@ void SessionExplorer::slotCreateDesktopIcon ( SessionButton* bt ) if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) ) return; - QString cmd="x2goclient"; - if ( crHidden ) - cmd="x2goclient --hide"; - - if (bShowTrayicon) - cmd += " --tray-icon"; - QTextStream out ( &file ); out << "[Desktop Entry]\n"<< - "Exec="<<cmd<<" --sessionid="<<bt->id() <<"\n"<< + "Exec="<<cmd<<args.join (" ")<<"\n"<< "Icon="<<sessIcon<<"\n"<< "Name="<<name<<"\n"<< "StartupNotify=true\n"<< @@ -211,15 +215,12 @@ void SessionExplorer::slotCreateDesktopIcon ( SessionButton* bt ) QSettings::NativeFormat ); QString workDir=xst.value ( "Default" ).toString(); QString progname=workDir+"\\x2goclient.exe"; - QString args="--sessionid="+bt->id(); - if ( crHidden ) - args+=" --hide"; QTextStream out ( &file ); out << "Set Shell = CreateObject(\"WScript.Shell\")\n"<< "DesktopPath = Shell.SpecialFolders(\"Desktop\")\n"<< "Set link = Shell.CreateShortcut(DesktopPath & \"\\"<<name<< ".lnk\")\n"<< - "link.Arguments = \""<<args<<"\"\n"<< + "link.Arguments = \""<<args.join (" ")<<"\"\n"<< "link.Description = \""<<tr ( "X2Go Link to session " ) << "--"<<name<<"--"<<"\"\n"<< "link.TargetPath = \""<<progname<<"\"\n"<< -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git