aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2007-06-11 08:38:23 +0000
committerEugene Sandulenko2007-06-11 08:38:23 +0000
commitadd3243e5e564bb730ac57af2fd9ce15e6d54309 (patch)
treecbbc61a7e6a8582b6bc3168c9243fb9c641b91d2
parente63041fcb747ec92083cd59567e525fc99380e24 (diff)
downloadscummvm-rg350-add3243e5e564bb730ac57af2fd9ce15e6d54309.tar.gz
scummvm-rg350-add3243e5e564bb730ac57af2fd9ce15e6d54309.tar.bz2
scummvm-rg350-add3243e5e564bb730ac57af2fd9ce15e6d54309.zip
Fix for bug #1719463: "DETECTOR: Launching undefined target adds launcher entry"
svn-id: r27352
-rw-r--r--base/commandLine.cpp16
-rw-r--r--common/advancedDetector.cpp7
2 files changed, 22 insertions, 1 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index b273e50f81..985ef8b3cb 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -642,7 +642,23 @@ bool processSettings(Common::String &command, Common::StringMap &settings) {
if (!command.empty()) {
GameDescriptor gd = Base::findGame(command);
if (ConfMan.hasGameDomain(command) || !gd.gameid().empty()) {
+ bool idCameFromCommandLine = false;
+
+ // WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching
+ // undefined target adds launcher entry"
+ //
+ // We designate gameids which come strictly from command line
+ // so AdvancedDetector will not save config file with invalid
+ // gameid in case target autoupgrade was performed
+ if (!ConfMan.hasGameDomain(command)) {
+ idCameFromCommandLine = true;
+ }
+
ConfMan.setActiveDomain(command);
+
+ if (idCameFromCommandLine)
+ ConfMan.set("id_came_from_command_line", "1");
+
} else {
usage("Unrecognized game target '%s'", command.c_str());
}
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index da65c30411..f0f77ee26e 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -212,7 +212,12 @@ PluginError detectGameForEngineCreation(
ConfMan.set("platform", Common::getPlatformCode(o->platform));
warning("Target upgraded from %s to %s", o->from, o->to);
- ConfMan.flushToDisk();
+
+ if (ConfMan.hasKey("id_came_from_command_line")) {
+ warning("Target came from command line. Skipping save");
+ } else {
+ ConfMan.flushToDisk();
+ }
break;
}
}