[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.81,1.82

Max Horn fingolfin at users.sourceforge.net
Sun Dec 21 07:30:04 CET 2003


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv13605/gui

Modified Files:
	launcher.cpp 
Log Message:
Make it possible for game detection functions to detect language/platform (not yet done by any detector, but will come with the MD5 detection code)

Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- launcher.cpp	13 Dec 2003 00:20:00 -0000	1.81
+++ launcher.cpp	21 Dec 2003 15:29:51 -0000	1.82
@@ -403,15 +403,7 @@
 
 		// ...so let's determine a list of candidates, games that
 		// could be contained in the specified directory.
-		GameList candidates;
-	
-		// Iterate over all known games and for each check if it might be
-		// the game in the presented directory.
-		const PluginList &plugins = PluginManager::instance().getPlugins();
-		PluginList::ConstIterator iter = plugins.begin();
-		for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
-			candidates.push_back((*iter)->detectGames(*files));
-		}
+		DetectedGameList candidates(PluginManager::instance().detectGames(*files));
 
 		int idx;
 		if (candidates.isEmpty()) {
@@ -433,7 +425,7 @@
 			idx = dialog.runModal();
 		}
 		if (0 <= idx && idx < candidates.size()) {
-			GameSettings result = candidates[idx];
+			DetectedGame result = candidates[idx];
 
 			// The auto detector or the user made a choice.
 			// Pick a domain name which does not yet exist (after all, we
@@ -453,6 +445,14 @@
 			}
 			ConfMan.set("path", dir->path(), domain);
 
+			// Set language if specified
+			if (result.language != Common::UNK_LANG)
+				ConfMan.set("language", Common::getLanguageString(result.language), domain);
+
+			// Set platform if specified
+			if (result.platform != Common::kPlatformUnknown)
+				ConfMan.set("platform", Common::getPlatformString(result.platform), domain);
+
 			// Display edit dialog for the new entry
 			EditGameDialog editDialog(domain, result);
 			if (editDialog.runModal()) {
@@ -460,7 +460,7 @@
 
 				// Write config to disk
 				ConfMan.flushToDisk();
-				
+
 				// Update the ListWidget and force a redraw
 				updateListing();
 				draw();





More information about the Scummvm-git-logs mailing list