BASE: Add function EngineManager::generateUniqueDomain
This commit is contained in:
parent
bc7b67555a
commit
e2b0259d29
2 changed files with 12 additions and 0 deletions
|
@ -757,6 +757,15 @@ void addStringToConf(const Common::String &key, const Common::String &value, con
|
||||||
|
|
||||||
} // End of anonymous namespace
|
} // End of anonymous namespace
|
||||||
|
|
||||||
|
Common::String EngineManager::generateUniqueDomain(const Common::String gameId) {
|
||||||
|
Common::String domainName(gameId);
|
||||||
|
int suffixN = 1;
|
||||||
|
while (ConfMan.hasGameDomain(domainName)) {
|
||||||
|
domainName = gameId + Common::String::format("-%d", suffixN++);
|
||||||
|
}
|
||||||
|
return domainName;
|
||||||
|
}
|
||||||
|
|
||||||
Common::String EngineManager::createTargetForGame(const DetectedGame &game) {
|
Common::String EngineManager::createTargetForGame(const DetectedGame &game) {
|
||||||
// The auto detector or the user made a choice.
|
// The auto detector or the user made a choice.
|
||||||
// Pick a domain name which does not yet exist (after all, we
|
// Pick a domain name which does not yet exist (after all, we
|
||||||
|
|
|
@ -610,6 +610,9 @@ public:
|
||||||
/** Upgrade a target to the current configuration format. */
|
/** Upgrade a target to the current configuration format. */
|
||||||
void upgradeTargetIfNecessary(const Common::String &target) const;
|
void upgradeTargetIfNecessary(const Common::String &target) const;
|
||||||
|
|
||||||
|
/** Generate valid, non-repeated domainName for game*/
|
||||||
|
Common::String generateUniqueDomain(const Common::String gameId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Find a game across all loaded plugins. */
|
/** Find a game across all loaded plugins. */
|
||||||
QualifiedGameList findGameInLoadedPlugins(const Common::String &gameId) const;
|
QualifiedGameList findGameInLoadedPlugins(const Common::String &gameId) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue