aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2007-01-28 10:38:23 +0000
committerMax Horn2007-01-28 10:38:23 +0000
commitaae330b4c16545fcadc029a432514022894c84d7 (patch)
tree3c7281677e69e81649414c3efc1fbda250d24db5 /gui
parentd32b1b1b7a64448ab0a456a8b10008c269183c0e (diff)
downloadscummvm-rg350-aae330b4c16545fcadc029a432514022894c84d7.tar.gz
scummvm-rg350-aae330b4c16545fcadc029a432514022894c84d7.tar.bz2
scummvm-rg350-aae330b4c16545fcadc029a432514022894c84d7.zip
Pass objects by (const) ref instead of value; only set game description in the config file if one has been specified
svn-id: r25243
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp6
-rw-r--r--gui/launcher.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 64323dabd9..a9f25dcf42 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -690,11 +690,12 @@ void LauncherDialog::addGame() {
}
-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 @@ void LauncherDialog::addGameToConf(FilesystemNode dir, GameDescriptor result, bo
// 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);
diff --git a/gui/launcher.h b/gui/launcher.h
index bb2bc21f45..73cf8f4186 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -68,7 +68,7 @@ protected:
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);
};