From 587b63e1d100594586486d2c24e57bbd4aac6a0a Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 12 Mar 2016 14:48:18 +0100 Subject: [PATCH] Fixed: Use full path to launch Ryzom client and pass profile argument --HG-- branch : develop --- .../client_config_qt/client_config_dialog.cpp | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/code/ryzom/tools/client/client_config_qt/client_config_dialog.cpp b/code/ryzom/tools/client/client_config_qt/client_config_dialog.cpp index 4b3cf0648..5f645857d 100644 --- a/code/ryzom/tools/client/client_config_qt/client_config_dialog.cpp +++ b/code/ryzom/tools/client/client_config_qt/client_config_dialog.cpp @@ -149,15 +149,28 @@ void CClientConfigDialog::onClickPlay() { bool started = false; + QStringList arguments; + + if (Args.haveArg("p")) + { + arguments << "-p" << QString::fromUtf8(Args.getArg("p").front().c_str()); + } + + QString clientFullPath = QString::fromUtf8(Args.getProgramPath().c_str()); + #ifdef Q_OS_WIN32 - started = QProcess::startDetached( "ryzom_client_r.exe" ); - if( !started ) - QProcess::startDetached( "ryzom_client_d.exe" ); -#elif defined(Q_OS_MAC) - started = QProcess::startDetached( "./Ryzom.app" ); +#ifdef _DEBUG + clientFullPath += "ryzom_client_d.exe"; #else - started = QProcess::startDetached( "./ryzom_client" ); + clientFullPath += "ryzom_client_r.exe"; #endif +#elif defined(Q_OS_MAC) + clientFullPath += "Ryzom"; +#else + clientFullPath += "ryzom_client"; +#endif + + started = QProcess::startDetached(clientFullPath, arguments); onClickOK(); }