mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 05:34:27 +00:00
BASE: Add function EngineManager::generateUniqueDomain
This commit is contained in:
parent
bc7b67555a
commit
e2b0259d29
@ -757,6 +757,15 @@ void addStringToConf(const Common::String &key, const Common::String &value, con
|
||||
|
||||
} // 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) {
|
||||
// The auto detector or the user made a choice.
|
||||
// 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. */
|
||||
void upgradeTargetIfNecessary(const Common::String &target) const;
|
||||
|
||||
/** Generate valid, non-repeated domainName for game*/
|
||||
Common::String generateUniqueDomain(const Common::String gameId);
|
||||
|
||||
private:
|
||||
/** Find a game across all loaded plugins. */
|
||||
QualifiedGameList findGameInLoadedPlugins(const Common::String &gameId) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user