From c142838122c49811a3b77c6909705aab7121c6ff Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 25 Sep 2016 08:45:42 +0200 Subject: BASE: Change the command line interface to use engine-qualified game names Qualified game names have the following form: engineId:gameId. Unqualified game names are still supported as long as they are not ambiguous. However they are considered deprecated and are no longer displayed by the --list-games command. --- gui/EventRecorder.cpp | 2 +- gui/editgamedialog.cpp | 14 +++++--------- gui/launcher.cpp | 2 +- gui/recorderdialog.cpp | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) (limited to 'gui') diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp index a7f6e1be65..92fbf65d35 100644 --- a/gui/EventRecorder.cpp +++ b/gui/EventRecorder.cpp @@ -599,7 +599,7 @@ void EventRecorder::setFileHeader() { return; } TimeDate t; - PlainGameDescriptor desc = EngineMan.findTarget(ConfMan.getActiveDomainName()); + QualifiedGameDescriptor desc = EngineMan.findTarget(ConfMan.getActiveDomainName()); g_system->getTimeAndDate(t); if (_author.empty()) { setAuthor("Unknown Author"); diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp index 4f3c1647a1..1b34a4753d 100644 --- a/gui/editgamedialog.cpp +++ b/gui/editgamedialog.cpp @@ -103,15 +103,11 @@ EditGameDialog::EditGameDialog(const String &domain) EngineMan.upgradeTargetIfNecessary(domain); // Retrieve all game specific options. - const Plugin *plugin = nullptr; - // To allow for game domains without a gameid. - // TODO: Is it intentional that this is still supported? - String gameId(ConfMan.get("gameid", domain)); - if (gameId.empty()) - gameId = domain; + // Retrieve the plugin, since we need to access the engine's MetaEngine // implementation. - PlainGameDescriptor pgd = EngineMan.findGame(gameId, &plugin); + const Plugin *plugin = nullptr; + QualifiedGameDescriptor qgd = EngineMan.findTarget(domain, &plugin); if (plugin) { _engineOptions = plugin->get().getExtraGuiOptions(domain); } else { @@ -125,8 +121,8 @@ EditGameDialog::EditGameDialog(const String &domain) // GAME: Determine the description string String description(ConfMan.get("description", domain)); - if (description.empty() && pgd.description) { - description = pgd.description; + if (description.empty() && qgd.description) { + description = qgd.description; } // GUI: Add tab widget diff --git a/gui/launcher.cpp b/gui/launcher.cpp index a3151a0455..84512ea018 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -271,7 +271,7 @@ void LauncherDialog::updateListing() { gameid = iter->_key; if (description.empty()) { - PlainGameDescriptor g = EngineMan.findTarget(iter->_key); + QualifiedGameDescriptor g = EngineMan.findTarget(iter->_key); if (g.description) description = g.description; } diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp index ced5bcbc5b..cbe90c93b8 100644 --- a/gui/recorderdialog.cpp +++ b/gui/recorderdialog.cpp @@ -166,7 +166,7 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat break; case kRecordCmd: { TimeDate t; - PlainGameDescriptor desc = EngineMan.findTarget(_target); + QualifiedGameDescriptor desc = EngineMan.findTarget(_target); g_system->getTimeAndDate(t); EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description, ""); if (editDlg.runModal() != kOKCmd) { -- cgit v1.2.3