[Scummvm-cvs-logs] SF.net SVN: scummvm: [25701] scummvm/trunk/gui/launcher.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Feb 18 19:39:47 CET 2007


Revision: 25701
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25701&view=rev
Author:   fingolfin
Date:     2007-02-18 10:39:46 -0800 (Sun, 18 Feb 2007)

Log Message:
-----------
Simplified addGameToConf and at the same time made it more powerful: Copy all key/value pairs returned by the detector to the new config file domain

Modified Paths:
--------------
    scummvm/trunk/gui/launcher.cpp

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2007-02-18 18:38:12 UTC (rev 25700)
+++ scummvm/trunk/gui/launcher.cpp	2007-02-18 18:39:46 UTC (rev 25701)
@@ -722,7 +722,13 @@
 
 	// Add the name domain
 	ConfMan.addGameDomain(domain);
-			
+
+	// Copy all non-empty key/value pairs into the new domain
+	for (GameDescriptor::const_iterator iter = result.begin(); iter != result.end(); ++iter) {
+		if (!iter->_value.empty() && iter->_key != "preferredtarget")
+			ConfMan.set(iter->_key, iter->_value, domain);
+	}
+
 	// TODO: Setting the description field here has the drawback
 	// that the user does never notice when we upgrade our descriptions.
 	// It might be nice ot leave this field empty, and only set it to
@@ -732,26 +738,7 @@
 	// game target, we can change this (currently, you can only query
 	// for the generic gameid description; it's not possible to obtain
 	// a description which contains extended information like language, etc.).
-	if (!result.description().empty())
-		ConfMan.set("description", result["description"], domain);
-
-	// TODO: Instead of only setting a few selected keys, we could just copy *all*
-	// non-empty key/value pairs from result (with the exception of "preferredtarget")
-	// to the config domain. This way detectors could specify many more
-	// settings w/o any further changes needed in the launcher code!
-
-	ConfMan.set("gameid", result["gameid"], domain);
 	
-	ConfMan.set("path", result["path"], domain);
-
-	// Set language if specified
-	if (result.language() != Common::UNK_LANG)
-		ConfMan.set("language", result["language"], domain);
-
-	// Set platform if specified
-	if (result.platform() != Common::kPlatformUnknown)
-		ConfMan.set("platform", result["platform"], domain);
-
 	return domain;
 }
 


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