diff --git a/src/heroicimporter.cpp b/src/heroicimporter.cpp index e9df6c7..94212ff 100644 --- a/src/heroicimporter.cpp +++ b/src/heroicimporter.cpp @@ -61,13 +61,14 @@ QString HeroicImporter::findLegendaryConfigPath() const QString HeroicImporter::launchCommandForApp(const QString &appName) const { + const QString safe = QString(appName).replace(QLatin1Char('"'), QLatin1String("\\\"")); if (!findExecutable(QStringLiteral("heroic")).isEmpty()) { - return QStringLiteral("heroic --launch %1").arg(appName); + return QStringLiteral("heroic --launch \"%1\"").arg(safe); } if (!findExecutable(QStringLiteral("flatpak")).isEmpty()) { - return QStringLiteral("flatpak run com.heroicgameslauncher.hgl --launch %1").arg(appName); + return QStringLiteral("flatpak run com.heroicgameslauncher.hgl --launch \"%1\"").arg(safe); } - return QStringLiteral("heroic --launch %1").arg(appName); + return QStringLiteral("heroic --launch \"%1\"").arg(safe); } QUrl HeroicImporter::extractCoverUrl(const QJsonObject &gameObj) const