|
23 | 23 | #include "model/gaming/Collection.h" |
24 | 24 | #include "model/gaming/Game.h" |
25 | 25 | #include "model/gaming/GameFile.h" |
26 | | -#include "providers/ProviderUtils.h" |
27 | 26 | #include "providers/SearchContext.h" |
28 | 27 | #include "providers/launchbox/LaunchBoxXml.h" |
29 | 28 | #include "utils/PathTools.h" |
@@ -66,10 +65,9 @@ enum class AppField : unsigned char { |
66 | 65 | void apply_game_fields( |
67 | 66 | const HashMap<GameField, QString>& fields, |
68 | 67 | model::Game& game, |
69 | | - const HashMap<QString, Emulator>& emulators) |
| 68 | + const HashMap<QString, Emulator>& emulators, |
| 69 | + const QString& steam_call) |
70 | 70 | { |
71 | | - const QString steam_call(providers::find_steam_call()); |
72 | | - |
73 | 71 | QString emu_id; |
74 | 72 | QString emu_params; |
75 | 73 | QString emu_platform_name; |
@@ -145,7 +143,7 @@ void apply_game_fields( |
145 | 143 |
|
146 | 144 | if (emu_id.isEmpty()) { |
147 | 145 | if (source == QLatin1String("Steam")) { |
148 | | - game.setLaunchCmd(steam_call % path); |
| 146 | + game.setLaunchCmd(steam_call % QChar(' ') % path); |
149 | 147 | } else { |
150 | 148 | game.setLaunchCmd(QStringLiteral("{file.path}")); |
151 | 149 | game.setLaunchWorkdir(::clean_abs_dir(QFileInfo(path))); |
@@ -368,6 +366,7 @@ HashMap<AppField, QString> GamelistXml::read_app_node(QXmlStreamReader& xml) con |
368 | 366 | std::vector<model::Game*> GamelistXml::find_games_for( |
369 | 367 | const Platform& platform, |
370 | 368 | const HashMap<QString, Emulator>& emulators, |
| 369 | + const QString& steam_call, |
371 | 370 | SearchContext& sctx) const |
372 | 371 | { |
373 | 372 | const QString xml_rel_path = QStringLiteral("Data/Platforms/%1.xml").arg(platform.name); // TODO: Qt 5.14+ QLatin1String |
@@ -441,7 +440,7 @@ std::vector<model::Game*> GamelistXml::find_games_for( |
441 | 440 | } |
442 | 441 |
|
443 | 442 | Q_ASSERT(game_ptr); |
444 | | - apply_game_fields(fields, *game_ptr, emulators); |
| 443 | + apply_game_fields(fields, *game_ptr, emulators, steam_call); |
445 | 444 | gameid_map.emplace(fields.at(GameField::ID), game_ptr); |
446 | 445 | sctx.game_add_to(*game_ptr, collection); |
447 | 446 | continue; |
|
0 commit comments