[Scummvm-cvs-logs] SF.net SVN: scummvm: [27355] scummvm/branches/branch-0-10-0

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Jun 11 10:41:27 CEST 2007


Revision: 27355
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27355&view=rev
Author:   sev
Date:     2007-06-11 01:41:26 -0700 (Mon, 11 Jun 2007)

Log Message:
-----------
Backport fix for bug #1719463

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/base/commandLine.cpp
    scummvm/branches/branch-0-10-0/common/advancedDetector.cpp

Modified: scummvm/branches/branch-0-10-0/base/commandLine.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/base/commandLine.cpp	2007-06-11 08:38:56 UTC (rev 27354)
+++ scummvm/branches/branch-0-10-0/base/commandLine.cpp	2007-06-11 08:41:26 UTC (rev 27355)
@@ -642,7 +642,23 @@
 	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());
 		}

Modified: scummvm/branches/branch-0-10-0/common/advancedDetector.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/common/advancedDetector.cpp	2007-06-11 08:38:56 UTC (rev 27354)
+++ scummvm/branches/branch-0-10-0/common/advancedDetector.cpp	2007-06-11 08:41:26 UTC (rev 27355)
@@ -87,7 +87,12 @@
 				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;
 		}
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list