aboutsummaryrefslogtreecommitdiff
path: root/launcher/launch/LaunchTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/launch/LaunchTask.cpp')
-rw-r--r--launcher/launch/LaunchTask.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/launcher/launch/LaunchTask.cpp b/launcher/launch/LaunchTask.cpp
index d5442a2b..3aa95052 100644
--- a/launcher/launch/LaunchTask.cpp
+++ b/launcher/launch/LaunchTask.cpp
@@ -282,6 +282,23 @@ void LaunchTask::emitFailed(QString reason)
Task::emitFailed(reason);
}
+void LaunchTask::substituteVariables(const QStringList &args) const
+{
+ auto variables = m_instance->getVariables();
+ auto envVariables = QProcessEnvironment::systemEnvironment();
+
+ for (auto arg : args) {
+ for (auto key : variables)
+ {
+ arg.replace("$" + key, variables.value(key));
+ }
+ for (auto env : envVariables.keys())
+ {
+ arg.replace("$" + env, envVariables.value(env));
+ }
+ }
+}
+
QString LaunchTask::substituteVariables(const QString &cmd) const
{
QString out = cmd;