From 1c97d53aeeb43ddffb2c2803532f78eb84ba1410 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Sun, 22 Apr 2018 14:13:40 +0200 Subject: [PATCH] SteamTarget: Fix launch args --- SteamTarget/SteamTarget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SteamTarget/SteamTarget.cpp b/SteamTarget/SteamTarget.cpp index a6a40b5..7bf90b4 100644 --- a/SteamTarget/SteamTarget.cpp +++ b/SteamTarget/SteamTarget.cpp @@ -143,6 +143,9 @@ void SteamTarget::readIni() else if (childkey == "Path") { launch_app_path_ = settings.value(childkey).toString().toStdString(); } + else if (childkey == "Args") { + launch_app_args_ = settings.value(childkey).toString().toStdString(); + } else if (childkey == "Type") { launch_uwp_ = settings.value(childkey).toString() == QString("UWP"); } @@ -216,11 +219,10 @@ void SteamTarget::launchApplication() // To use arguments, launching using explorer, we have to use a batch file... QString programPath = QDir::toNativeSeparators(QString::fromStdString(launch_app_path_)); - programPath = programPath.mid(0, programPath.lastIndexOf("\\")); const QString batchContents = - "cd /D \"" + programPath + "\"\n" - + '\"' + QDir::toNativeSeparators(QString::fromStdString(launch_app_path_)) + "cd /D \"" + programPath.mid(0, programPath.lastIndexOf("\\")) + "\"\n" + + '\"' + programPath.mid(programPath.lastIndexOf("\\")+1) + '\"' + " " + QString::fromStdString(launch_app_args_); QFile file(QString(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).at(0) + "/launchApp.bat"));