diff options
author | Max Horn | 2006-04-16 13:58:11 +0000 |
---|---|---|
committer | Max Horn | 2006-04-16 13:58:11 +0000 |
commit | 555a568e596b3d4dfe992689e8bc805d5feebfb2 (patch) | |
tree | 6f64eee60762662ce27ae3d39c26558d2e5da6f4 | |
parent | 1a20a9ae0998c4cd890962630d3806dc01cf85a5 (diff) | |
download | scummvm-rg350-555a568e596b3d4dfe992689e8bc805d5feebfb2.tar.gz scummvm-rg350-555a568e596b3d4dfe992689e8bc805d5feebfb2.tar.bz2 scummvm-rg350-555a568e596b3d4dfe992689e8bc805d5feebfb2.zip |
Fixed some breakage in the 'Add Game' code I recently introduced; added a FIXME comment regarding the 'description' config file key
svn-id: r21943
-rw-r--r-- | common/config-manager.cpp | 10 | ||||
-rw-r--r-- | common/config-manager.h | 2 | ||||
-rw-r--r-- | gui/launcher.cpp | 16 |
3 files changed, 26 insertions, 2 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index b0de2d5ee6..3f601a0236 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -553,6 +553,16 @@ void ConfigManager::setActiveDomain(const String &domName) { _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)); diff --git a/common/config-manager.h b/common/config-manager.h index d2336a289f..26b1efbf23 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -146,7 +146,7 @@ public: 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; diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 0c3cfad17d..de47a1946a 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -616,8 +616,22 @@ void LauncherDialog::addGame() { 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); |