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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 28 11:38:24 CET 2007


Revision: 25243
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25243&view=rev
Author:   fingolfin
Date:     2007-01-28 02:38:23 -0800 (Sun, 28 Jan 2007)

Log Message:
-----------
Pass objects by (const) ref instead of value; only set game description in the config file if one has been specified

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

Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp	2007-01-28 10:29:22 UTC (rev 25242)
+++ scummvm/trunk/gui/launcher.cpp	2007-01-28 10:38:23 UTC (rev 25243)
@@ -690,11 +690,12 @@
 }
 
 
-void LauncherDialog::addGameToConf(FilesystemNode dir, GameDescriptor result, bool suppressEditDialog) {
+void LauncherDialog::addGameToConf(const FilesystemNode &dir, const GameDescriptor &result, bool suppressEditDialog) {
 	// The auto detector or the user made a choice.
 	// Pick a domain name which does not yet exist (after all, we
 	// are *adding* a game to the config, not replacing).
 	String domain(result.gameid());
+	assert(!domain.empty());
 	if (ConfMan.hasGameDomain(domain)) {
 		int suffixN = 1;
 		char suffix[16];
@@ -718,7 +719,8 @@
 	// 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);
+	if (!result.description().empty())
+		ConfMan.set("description", result.description(), domain);
 
 	ConfMan.set("gameid", result.gameid(), domain);
 	ConfMan.set("path", dir.path(), domain);

Modified: scummvm/trunk/gui/launcher.h
===================================================================
--- scummvm/trunk/gui/launcher.h	2007-01-28 10:29:22 UTC (rev 25242)
+++ scummvm/trunk/gui/launcher.h	2007-01-28 10:38:23 UTC (rev 25243)
@@ -68,7 +68,7 @@
 
 	void selectGame(const String &name);
 	
-	void addGameToConf(FilesystemNode dir, GameDescriptor result, bool suppressEditDialog);
+	void addGameToConf(const FilesystemNode &dir, const GameDescriptor &result, bool suppressEditDialog);
 	void addGameRecursive(FilesystemNode dir);
 };
 


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