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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 16 06:59:00 CEST 2006


Revision: 21943
Author:   fingolfin
Date:     2006-04-16 06:58:11 -0700 (Sun, 16 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21943&view=rev

Log Message:
-----------
Fixed some breakage in the 'Add Game' code I recently introduced; added a FIXME comment regarding the 'description' config file key

Modified Paths:
--------------
    scummvm/trunk/common/config-manager.cpp
    scummvm/trunk/common/config-manager.h
    scummvm/trunk/gui/launcher.cpp
Modified: scummvm/trunk/common/config-manager.cpp
===================================================================
--- scummvm/trunk/common/config-manager.cpp	2006-04-16 13:37:48 UTC (rev 21942)
+++ scummvm/trunk/common/config-manager.cpp	2006-04-16 13:58:11 UTC (rev 21943)
@@ -553,6 +553,16 @@
 	_activeDomainName = domName;
 }
 
+void ConfigManager::addGameDomain(const String &domName) {
+	assert(!domName.empty());
+	assert(isValidDomainName(domName));
+
+	// TODO: Do we want to generate an error/warning if a domain with
+	// the given name already exists?
+
+	_gameDomains[domName];
+}
+
 void ConfigManager::removeGameDomain(const String &domName) {
 	assert(!domName.empty());
 	assert(isValidDomainName(domName));

Modified: scummvm/trunk/common/config-manager.h
===================================================================
--- scummvm/trunk/common/config-manager.h	2006-04-16 13:37:48 UTC (rev 21942)
+++ scummvm/trunk/common/config-manager.h	2006-04-16 13:58:11 UTC (rev 21943)
@@ -146,7 +146,7 @@
 	const Domain *		getActiveDomain() const { return _activeDomain; }
 	const String &		getActiveDomainName() const { return _activeDomainName; }
 
-//	void				addDomain(const String &domName);
+	void				addGameDomain(const String &domName);
 	void				removeGameDomain(const String &domName);
 	void				renameGameDomain(const String &oldName, const String &newName);
 	bool				hasGameDomain(const String &domName) const;

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2006-04-16 13:37:48 UTC (rev 21942)
+++ scummvm/trunk/gui/launcher.cpp	2006-04-16 13:58:11 UTC (rev 21943)
@@ -616,8 +616,22 @@
 					suffix++;
 					domain += suffix;
 				}
-				ConfMan.set("description", result.description, domain);
 			}
+
+			// Add the name domain
+			ConfMan.addGameDomain(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
+			// a value when the user edits the description string. 
+			// However, at this point, that's impractical. Once we have a method
+			// to query all backends for the proper & full description of a given
+			// 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.).
+			ConfMan.set("description", result.description, domain);
+
 			ConfMan.set("gameid", result.gameid, domain);
 			ConfMan.set("path", dir.path(), 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