[Scummvm-cvs-logs] SF.net SVN: scummvm: [27352] scummvm/trunk

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Jun 11 10:38:24 CEST 2007


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

Log Message:
-----------
Fix for bug #1719463: "DETECTOR: Launching undefined target adds launcher entry"

Modified Paths:
--------------
    scummvm/trunk/base/commandLine.cpp
    scummvm/trunk/common/advancedDetector.cpp

Modified: scummvm/trunk/base/commandLine.cpp
===================================================================
--- scummvm/trunk/base/commandLine.cpp	2007-06-11 08:26:07 UTC (rev 27351)
+++ scummvm/trunk/base/commandLine.cpp	2007-06-11 08:38:23 UTC (rev 27352)
@@ -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/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp	2007-06-11 08:26:07 UTC (rev 27351)
+++ scummvm/trunk/common/advancedDetector.cpp	2007-06-11 08:38:23 UTC (rev 27352)
@@ -212,7 +212,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