aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index a9f25dcf42..33b4aa17ab 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -694,15 +694,22 @@ void LauncherDialog::addGameToConf(const FilesystemNode &dir, const GameDescript
// 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());
+ String domain;
+
+ if (result.contains("preferredtarget"))
+ domain = result["preferredtarget"];
+ else
+ domain = result.gameid();
+
assert(!domain.empty());
if (ConfMan.hasGameDomain(domain)) {
int suffixN = 1;
char suffix[16];
+ String gameid(domain);
while (ConfMan.hasGameDomain(domain)) {
snprintf(suffix, 16, "-%d", suffixN);
- domain = result.gameid() + suffix;
+ domain = gameid + suffix;
suffixN++;
}
}