aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorBastien Bouclet2018-05-06 15:51:03 +0200
committerBastien Bouclet2018-05-10 09:04:23 +0200
commit90b78c544657bf0fc41d6b86276a0873060345b5 (patch)
treea9187f2a6d924360f6b0960fd08a7cf7cddbc8ba /gui
parentfaa2534f46611a47913004b55aa0e5ed5b7e4b7a (diff)
downloadscummvm-rg350-90b78c544657bf0fc41d6b86276a0873060345b5.tar.gz
scummvm-rg350-90b78c544657bf0fc41d6b86276a0873060345b5.tar.bz2
scummvm-rg350-90b78c544657bf0fc41d6b86276a0873060345b5.zip
ENGINES: Merge GameDescriptor and DetectedGame
Diffstat (limited to 'gui')
-rw-r--r--gui/editgamedialog.h2
-rw-r--r--gui/launcher.cpp4
-rw-r--r--gui/massadd.cpp9
-rw-r--r--gui/massadd.h2
4 files changed, 8 insertions, 9 deletions
diff --git a/gui/editgamedialog.h b/gui/editgamedialog.h
index 06a8514dd5..7c6a08eb3c 100644
--- a/gui/editgamedialog.h
+++ b/gui/editgamedialog.h
@@ -40,8 +40,6 @@ class StaticTextWidget;
class EditTextWidget;
class SaveLoadChooser;
-Common::String addGameToConf(const GameDescriptor &result);
-
/*
* A dialog that allows the user to edit a config game entry.
* TODO: add widgets for some/all of the following
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 67a62ad61e..7a37a7d3be 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -562,14 +562,14 @@ bool LauncherDialog::doGameDetection(const Common::String &path) {
// Display the candidates to the user and let her/him pick one
StringArray list;
for (idx = 0; idx < (int)candidates.size(); idx++)
- list.push_back(candidates[idx].matchedGame.description);
+ list.push_back(candidates[idx].description);
ChooserDialog dialog(_("Pick the game:"));
dialog.setList(list);
idx = dialog.runModal();
}
if (0 <= idx && idx < (int)candidates.size()) {
- const GameDescriptor &result = candidates[idx].matchedGame;
+ const DetectedGame &result = candidates[idx];
Common::String domain = EngineMan.createTargetForGame(result);
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 56b15ecfd7..8bc5a10720 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -117,13 +117,13 @@ MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
}
struct GameTargetLess {
- bool operator()(const GameDescriptor &x, const GameDescriptor &y) const {
+ bool operator()(const DetectedGame &x, const DetectedGame &y) const {
return x.preferredTarget.compareToIgnoreCase(y.preferredTarget) < 0;
}
};
struct GameDescLess {
- bool operator()(const GameDescriptor &x, const GameDescriptor &y) const {
+ bool operator()(const DetectedGame &x, const DetectedGame &y) const {
return x.description.compareToIgnoreCase(y.description) < 0;
}
};
@@ -142,7 +142,7 @@ void MassAddDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
// people who want to edit their config file by hand after a mass add.
Common::sort(_games.begin(), _games.end(), GameTargetLess());
// Add all the detected games to the config
- for (GameList::iterator iter = _games.begin(); iter != _games.end(); ++iter) {
+ for (DetectedGames::iterator iter = _games.begin(); iter != _games.end(); ++iter) {
debug(1, " Added gameid '%s', desc '%s'\n",
iter->gameId.c_str(),
iter->description.c_str());
@@ -199,7 +199,8 @@ void MassAddDialog::handleTickle() {
// However, we only add games which are not already in the config file.
DetectedGames candidates = detectionResults.listRecognizedGames();
for (DetectedGames::const_iterator cand = candidates.begin(); cand != candidates.end(); ++cand) {
- const GameDescriptor &result = cand->matchedGame;
+ const DetectedGame &result = *cand;
+
Common::String path = dir.getPath();
// Remove trailing slashes
diff --git a/gui/massadd.h b/gui/massadd.h
index b954c87161..b81a6046e2 100644
--- a/gui/massadd.h
+++ b/gui/massadd.h
@@ -51,7 +51,7 @@ public:
private:
Common::Stack<Common::FSNode> _scanStack;
- GameList _games;
+ DetectedGames _games;
/**
* Map each path occuring in the config file to the target(s) using that path.