mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-29 09:22:18 -07:00
[Settings] Camel case everything
This commit is contained in:
parent
e37cb5dadf
commit
8a3ffac8e2
15 changed files with 481 additions and 352 deletions
|
|
@ -35,61 +35,85 @@ static void migrateSoundSettings(const QString &settingsPath, QSettings &globalI
|
|||
QSettings soundIni(settingsPath + "sound.ini", QSettings::IniFormat);
|
||||
soundIni.setValue("sound/enabled", globalIni.value("sound/enabled", false));
|
||||
soundIni.setValue("sound/theme", globalIni.value("sound/theme"));
|
||||
soundIni.setValue("sound/mastervolume", globalIni.value("sound/mastervolume", 100));
|
||||
soundIni.setValue("sound/masterVolume", globalIni.value("sound/mastervolume", 100));
|
||||
}
|
||||
|
||||
static void migrateGameSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
bool hasGameKeys = false;
|
||||
globalIni.beginGroup("game");
|
||||
if (!globalIni.childKeys().isEmpty()) {
|
||||
hasGameKeys = true;
|
||||
}
|
||||
QStringList gameKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
const QMap<QString, QString> gameKeyMap = {
|
||||
{"game/maxplayers", "game/maxPlayers"},
|
||||
{"game/gamedescription", "game/gameDescription"},
|
||||
{"game/gametypes", "game/gameTypes"},
|
||||
{"game/onlybuddies", "game/onlyBuddies"},
|
||||
{"game/onlyregistered", "game/onlyRegistered"},
|
||||
{"game/spectatorsallowed", "game/spectatorsAllowed"},
|
||||
{"game/spectatorsneedpassword", "game/spectatorsNeedPassword"},
|
||||
{"game/spectatorscantalk", "game/spectatorsCanTalk"},
|
||||
{"game/spectatorscanseeeverything", "game/spectatorsCanSeeEverything"},
|
||||
{"game/creategameasspectator", "game/createGameAsSpectator"},
|
||||
{"game/defaultstartinglifetotal", "game/defaultStartingLifeTotal"},
|
||||
{"game/sharedecklistsonload", "game/shareDecklistsOnLoad"},
|
||||
{"game/remembergamesettings", "game/rememberGameSettings"},
|
||||
{"localgameoptions/maxplayers", "localgameoptions/maxPlayers"},
|
||||
{"localgameoptions/startinglifetotal", "localgameoptions/startingLifeTotal"},
|
||||
{"localgameoptions/remembersettings", "localgameoptions/rememberSettings"},
|
||||
};
|
||||
|
||||
globalIni.beginGroup("localgameoptions");
|
||||
if (!globalIni.childKeys().isEmpty()) {
|
||||
hasGameKeys = true;
|
||||
bool hasAny = false;
|
||||
for (auto it = gameKeyMap.constBegin(); it != gameKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
QStringList localGameKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
|
||||
if (!hasGameKeys) {
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings gameIni(settingsPath + "game.ini", QSettings::IniFormat);
|
||||
for (const auto &key : gameKeys) {
|
||||
if (key == "maxfontsize") {
|
||||
continue;
|
||||
for (auto it = gameKeyMap.constBegin(); it != gameKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
gameIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
gameIni.setValue("game/" + key, globalIni.value("game/" + key));
|
||||
}
|
||||
for (const auto &key : localGameKeys) {
|
||||
gameIni.setValue("localgameoptions/" + key, globalIni.value("localgameoptions/" + key));
|
||||
}
|
||||
}
|
||||
|
||||
static void migrateChatSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
globalIni.beginGroup("chat");
|
||||
QStringList chatKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
|
||||
// Legacy highlight words lived under [personal], but the chat settings
|
||||
// class reads them from [chat]
|
||||
bool hasHighlightWords = globalIni.contains("personal/highlightWords");
|
||||
if (chatKeys.isEmpty() && !hasHighlightWords) {
|
||||
const QMap<QString, QString> chatKeyMap = {
|
||||
{"chat/mention", "chat/mention"},
|
||||
{"chat/mentioncompleter", "chat/mentionCompleter"},
|
||||
{"chat/mentioncolor", "chat/mentionColor"},
|
||||
{"chat/highlightcolor", "chat/highlightColor"},
|
||||
{"chat/mentionforeground", "chat/mentionForeground"},
|
||||
{"chat/highlightforeground", "chat/highlightForeground"},
|
||||
{"chat/ignore_unregistered", "chat/ignoreUnregistered"},
|
||||
{"chat/ignore_unregistered_messages", "chat/ignoreUnregisteredMessages"},
|
||||
{"chat/ignore_nonbuddy_messages", "chat/ignoreNonBuddyMessages"},
|
||||
{"chat/showmessagepopups", "chat/showMessagePopups"},
|
||||
{"chat/showmentionpopups", "chat/showMentionPopups"},
|
||||
{"chat/roomhistory", "chat/roomHistory"},
|
||||
{"chat/highlightwords", "chat/highlightWords"},
|
||||
// Legacy highlight words lived under [personal], but the chat settings
|
||||
// class reads them from [chat]
|
||||
{"personal/highlightWords", "chat/highlightWords"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = chatKeyMap.constBegin(); it != chatKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings chatIni(settingsPath + "chat.ini", QSettings::IniFormat);
|
||||
for (const auto &key : chatKeys) {
|
||||
chatIni.setValue("chat/" + key, globalIni.value("chat/" + key));
|
||||
}
|
||||
if (hasHighlightWords) {
|
||||
chatIni.setValue("chat/highlightwords", globalIni.value("personal/highlightWords"));
|
||||
for (auto it = chatKeyMap.constBegin(); it != chatKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
chatIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -130,9 +154,9 @@ static void migrateUpdatesSettings(const QString &settingsPath, QSettings &globa
|
|||
{"personal/cardUpdateCheckInterval", "updates/cardUpdateCheckInterval"},
|
||||
{"personal/lastCardUpdateCheck", "updates/lastCardUpdateCheck"},
|
||||
{"personal/alwaysEnableNewSets", "updates/alwaysEnableNewSets"},
|
||||
{"personal/updatenotification", "updates/updatenotification"},
|
||||
{"personal/newversionnotification", "updates/newversionnotification"},
|
||||
{"personal/updatereleasechannel", "updates/updatereleasechannel"},
|
||||
{"personal/updatenotification", "updates/updateNotification"},
|
||||
{"personal/newversionnotification", "updates/newVersionNotification"},
|
||||
{"personal/updatereleasechannel", "updates/updateReleaseChannel"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = updateKeyMap.constBegin(); it != updateKeyMap.constEnd(); ++it) {
|
||||
|
|
@ -188,19 +212,17 @@ static void migratePersonalSettings(const QString &settingsPath, QSettings &glob
|
|||
|
||||
static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList cardsRootKeys = {
|
||||
"cards/displaycardnames",
|
||||
"cards/roundcardcorners",
|
||||
"cards/overrideallcardartwithpersonalpreference",
|
||||
"cards/bumpsetswithcardsindecktotop",
|
||||
"cards/includerebalancedcards",
|
||||
"cards/tapanimation",
|
||||
"cards/autorotatesidewayslayoutcards",
|
||||
"cards/scaleCards",
|
||||
"cards/verticalCardOverlapPercent",
|
||||
"cards/cardinfoviewmode",
|
||||
};
|
||||
const QMap<QString, QString> cardsKeyMap = {
|
||||
{"cards/displaycardnames", "cards/displayCardNames"},
|
||||
{"cards/roundcardcorners", "cards/roundCardCorners"},
|
||||
{"cards/overrideallcardartwithpersonalpreference", "cards/overrideAllCardArtWithPersonalPreference"},
|
||||
{"cards/bumpsetswithcardsindecktotop", "cards/bumpSetsWithCardsInDeckToTop"},
|
||||
{"cards/includerebalancedcards", "cards/includerebalancedcards"},
|
||||
{"cards/tapanimation", "cards/tapAnimation"},
|
||||
{"cards/autorotatesidewayslayoutcards", "cards/autoRotateSidewaysLayoutCards"},
|
||||
{"cards/scaleCards", "cards/scaleCards"},
|
||||
{"cards/verticalCardOverlapPercent", "cards/verticalCardOverlapPercent"},
|
||||
{"cards/cardinfoviewmode", "cards/cardInfoViewMode"},
|
||||
{"cards/printingselectorsortorder", "cards/printingSelector/sortOrder"},
|
||||
{"cards/printingselectornavigationbuttonsvisible", "cards/printingSelector/navigationButtonsVisible"},
|
||||
{"cards/printingselectorcardsize", "cards/cardSize/printingSelector"},
|
||||
|
|
@ -213,14 +235,10 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
};
|
||||
|
||||
bool hasAny = false;
|
||||
for (const auto &key : cardsRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (auto it = cardsKeyMap.constBegin(); it != cardsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
|
|
@ -228,11 +246,6 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
}
|
||||
|
||||
QSettings cardsIni(settingsPath + "cards_display.ini", QSettings::IniFormat);
|
||||
for (const auto &key : cardsRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
cardsIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (auto it = cardsKeyMap.constBegin(); it != cardsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
cardsIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
|
|
@ -242,29 +255,31 @@ static void migrateCardsDisplaySettings(const QString &settingsPath, QSettings &
|
|||
|
||||
static void migrateInterfaceSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QStringList interfaceRootKeys = {
|
||||
"interface/usetearoffmenus",
|
||||
"interface/cardViewInitialRowsMax",
|
||||
"interface/cardViewExpandedRowsMax",
|
||||
"interface/closeEmptyCardView",
|
||||
"interface/focusCardViewSearchBar",
|
||||
"interface/keepGameChatFocus",
|
||||
"interface/doubleclicktoplay",
|
||||
"interface/clickPlaysAllSelected",
|
||||
"interface/playtostack",
|
||||
"interface/doNotDeleteArrowsInSubPhases",
|
||||
"interface/startinghandsize",
|
||||
"interface/annotatetokens",
|
||||
"interface/showlassoselectioncount",
|
||||
"interface/showpersistentselectioncount",
|
||||
"interface/tallyType",
|
||||
"interface/leftjustified",
|
||||
"interface/min_players_multicolumn",
|
||||
};
|
||||
const QStringList interfaceSubKeys = {
|
||||
"hand/horizontal", "table/invert_vertical", "replay/rewindBufferingMs", "replay/fastForwardSpeed",
|
||||
"zoneview/groupby", "zoneview/sortby", "zoneview/pileview"};
|
||||
const QMap<QString, QString> interfaceKeyMap = {
|
||||
{"interface/usetearoffmenus", "interface/useTearOffMenus"},
|
||||
{"interface/cardViewInitialRowsMax", "interface/cardViewInitialRowsMax"},
|
||||
{"interface/cardViewExpandedRowsMax", "interface/cardViewExpandedRowsMax"},
|
||||
{"interface/closeEmptyCardView", "interface/closeEmptyCardView"},
|
||||
{"interface/focusCardViewSearchBar", "interface/focusCardViewSearchBar"},
|
||||
{"interface/keepGameChatFocus", "interface/keepGameChatFocus"},
|
||||
{"interface/doubleclicktoplay", "interface/doubleClickToPlay"},
|
||||
{"interface/clickPlaysAllSelected", "interface/clickPlaysAllSelected"},
|
||||
{"interface/playtostack", "interface/playToStack"},
|
||||
{"interface/doNotDeleteArrowsInSubPhases", "interface/doNotDeleteArrowsInSubPhases"},
|
||||
{"interface/startinghandsize", "interface/startingHandSize"},
|
||||
{"interface/annotatetokens", "interface/annotateTokens"},
|
||||
{"interface/showlassoselectioncount", "interface/showLassoSelectionCount"},
|
||||
{"interface/showpersistentselectioncount", "interface/showPersistentSelectionCount"},
|
||||
{"interface/tallyType", "interface/tallyType"},
|
||||
{"interface/leftjustified", "interface/leftJustified"},
|
||||
{"interface/min_players_multicolumn", "interface/minPlayersMulticolumn"},
|
||||
{"hand/horizontal", "hand/horizontal"},
|
||||
{"table/invert_vertical", "table/invertVertical"},
|
||||
{"replay/rewindBufferingMs", "replay/rewindBufferingMs"},
|
||||
{"replay/fastForwardSpeed", "replay/fastForwardSpeed"},
|
||||
{"zoneview/groupby", "zoneview/groupBy"},
|
||||
{"zoneview/sortby", "zoneview/sortBy"},
|
||||
{"zoneview/pileview", "zoneview/pileView"},
|
||||
{"personal/showStatusBar", "interface/showStatusBar"},
|
||||
{"menu/showshortcuts", "interface/showShortcuts"},
|
||||
{"menu/showgameselectorfiltertoolbar", "interface/showGameSelectorFilterToolbar"},
|
||||
|
|
@ -273,19 +288,10 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
{"interface/buddyconnectnotificationsenabled", "interface/notifications/buddyConnectEnabled"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (const auto &key : interfaceRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (const auto &key : interfaceSubKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
hasAny = true;
|
||||
}
|
||||
}
|
||||
for (auto it = interfaceKeyMap.constBegin(); it != interfaceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
|
|
@ -293,16 +299,6 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
}
|
||||
|
||||
QSettings interfaceIni(settingsPath + "interface.ini", QSettings::IniFormat);
|
||||
for (const auto &key : interfaceRootKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
interfaceIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (const auto &key : interfaceSubKeys) {
|
||||
if (globalIni.contains(key)) {
|
||||
interfaceIni.setValue(key, globalIni.value(key));
|
||||
}
|
||||
}
|
||||
for (auto it = interfaceKeyMap.constBegin(); it != interfaceKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
interfaceIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
|
|
@ -313,8 +309,8 @@ static void migrateInterfaceSettings(const QString &settingsPath, QSettings &glo
|
|||
static void migrateDownloadSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QMap<QString, QString> downloadKeyMap = {
|
||||
{"personal/picturedownload", "downloads/picturedownload"},
|
||||
{"personal/downloadspoilers", "downloads/downloadspoilers"},
|
||||
{"personal/picturedownload", "downloads/pictureDownload"},
|
||||
{"personal/downloadspoilers", "downloads/downloadSpoilers"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = downloadKeyMap.constBegin(); it != downloadKeyMap.constEnd(); ++it) {
|
||||
|
|
@ -367,11 +363,11 @@ static void migrateAppearanceSettings(const QString &settingsPath, QSettings &gl
|
|||
static void migrateNetworkSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
const QMap<QString, QString> networkKeyMap = {
|
||||
{"personal/clientid", "network/clientid"},
|
||||
{"personal/clientversion", "network/clientversion"},
|
||||
{"personal/keepalive", "network/keepalive"},
|
||||
{"personal/clientid", "network/clientId"},
|
||||
{"personal/clientversion", "network/clientVersion"},
|
||||
{"personal/keepalive", "network/keepAlive"},
|
||||
{"personal/timeout", "network/timeout"},
|
||||
{"interface/knownmissingfeatures", "network/knownmissingfeatures"},
|
||||
{"interface/knownmissingfeatures", "network/knownMissingFeatures"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = networkKeyMap.constBegin(); it != networkKeyMap.constEnd(); ++it) {
|
||||
|
|
@ -394,16 +390,35 @@ static void migrateNetworkSettings(const QString &settingsPath, QSettings &globa
|
|||
|
||||
static void migratePathsSettings(const QString &settingsPath, QSettings &globalIni)
|
||||
{
|
||||
globalIni.beginGroup("paths");
|
||||
QStringList pathsKeys = globalIni.childKeys();
|
||||
globalIni.endGroup();
|
||||
if (pathsKeys.isEmpty()) {
|
||||
const QMap<QString, QString> pathsKeyMap = {
|
||||
{"paths/decks", "paths/decks"},
|
||||
{"paths/filters", "paths/filters"},
|
||||
{"paths/replays", "paths/replays"},
|
||||
{"paths/pics", "paths/pics"},
|
||||
{"paths/custompics", "paths/customPics"},
|
||||
{"paths/themes", "paths/themes"},
|
||||
{"paths/carddatabase", "paths/cardDatabase"},
|
||||
{"paths/customsets", "paths/customSets"},
|
||||
{"paths/tokendatabase", "paths/tokenDatabase"},
|
||||
{"paths/spoilerdatabase", "paths/spoilerDatabase"},
|
||||
{"paths/redirects", "paths/redirects"},
|
||||
};
|
||||
bool hasAny = false;
|
||||
for (auto it = pathsKeyMap.constBegin(); it != pathsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
hasAny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasAny) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings pathsIni(settingsPath + "paths.ini", QSettings::IniFormat);
|
||||
for (const auto &key : pathsKeys) {
|
||||
pathsIni.setValue("paths/" + key, globalIni.value("paths/" + key));
|
||||
for (auto it = pathsKeyMap.constBegin(); it != pathsKeyMap.constEnd(); ++it) {
|
||||
if (globalIni.contains(it.key())) {
|
||||
pathsIni.setValue(it.value(), globalIni.value(it.key()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -490,9 +505,9 @@ static void migrateLegacySets(const QString &settingsPath)
|
|||
QSettings cardDbIni(settingsPath + "cardDatabase.ini", QSettings::IniFormat);
|
||||
for (const auto &shortName : groups) {
|
||||
legacySetting.beginGroup(shortName);
|
||||
cardDbIni.setValue("sets/" + shortName + "/sortkey", legacySetting.value("sortkey"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/sortKey", legacySetting.value("sortkey"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/enabled", legacySetting.value("enabled"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/isknown", legacySetting.value("isknown"));
|
||||
cardDbIni.setValue("sets/" + shortName + "/isKnown", legacySetting.value("isknown"));
|
||||
legacySetting.endGroup();
|
||||
}
|
||||
legacySetting.endGroup();
|
||||
|
|
@ -508,13 +523,30 @@ static void migrateLegacyServers(const QString &settingsPath)
|
|||
return;
|
||||
}
|
||||
|
||||
const QMap<QString, QString> serverKeyMap = {
|
||||
{"previoushostlogin", "previousHostLogin"},
|
||||
{"previoushosts", "previousHosts"},
|
||||
{"previoushostName", "previousHostName"},
|
||||
{"auto_connect", "autoConnect"},
|
||||
{"fphostname", "fpHostName"},
|
||||
{"fpport", "fpPort"},
|
||||
{"fpplayername", "fpPlayerName"},
|
||||
{"save_debug_log", "saveDebugLog"},
|
||||
};
|
||||
|
||||
QSettings serversIni(settingsPath + "servers.ini", QSettings::IniFormat);
|
||||
serversIni.setValue("server/previoushostlogin", legacySetting.value("previoushostlogin"));
|
||||
serversIni.setValue("server/previoushosts", legacySetting.value("previoushosts"));
|
||||
serversIni.setValue("server/auto_connect", legacySetting.value("auto_connect"));
|
||||
serversIni.setValue("server/fphostname", legacySetting.value("fphostname"));
|
||||
serversIni.setValue("server/fpport", legacySetting.value("fpport"));
|
||||
serversIni.setValue("server/fpplayername", legacySetting.value("fpplayername"));
|
||||
for (auto it = serverKeyMap.constBegin(); it != serverKeyMap.constEnd(); ++it) {
|
||||
if (legacySetting.contains(it.key())) {
|
||||
serversIni.setValue("server/" + it.value(), legacySetting.value(it.key()));
|
||||
}
|
||||
}
|
||||
|
||||
legacySetting.beginGroup("server_details");
|
||||
const QStringList detailsKeys = legacySetting.allKeys();
|
||||
for (const auto &key : detailsKeys) {
|
||||
serversIni.setValue("server/server_details/" + key, legacySetting.value(key));
|
||||
}
|
||||
legacySetting.endGroup();
|
||||
legacySetting.endGroup();
|
||||
}
|
||||
|
||||
|
|
@ -549,9 +581,36 @@ static void migrateLegacyGameFilters(const QString &settingsPath)
|
|||
return;
|
||||
}
|
||||
|
||||
const QMap<QString, QString> filterKeyMap = {
|
||||
{"hide_buddies_only_games", "hideBuddiesOnlyGames"},
|
||||
{"hide_full_games", "hideFullGames"},
|
||||
{"hide_games_that_started", "hideGamesThatStarted"},
|
||||
{"hide_password_protected_games", "hidePasswordProtectedGames"},
|
||||
{"hide_ignored_user_games", "hideIgnoredUserGames"},
|
||||
{"hide_not_buddy_created_games", "hideNotBuddyCreatedGames"},
|
||||
{"hide_open_decklist_games", "hideOpenDecklistGames"},
|
||||
{"game_name_filter", "gameNameFilter"},
|
||||
{"creator_name_filter", "creatorNameFilter"},
|
||||
{"min_players", "minPlayers"},
|
||||
{"max_players", "maxPlayers"},
|
||||
{"max_game_age_time", "maxGameAgeTime"},
|
||||
{"show_only_if_spectators_can_watch", "showOnlyIfSpectatorsCanWatch"},
|
||||
{"show_spectator_password_protected", "showSpectatorPasswordProtected"},
|
||||
{"show_only_if_spectators_can_chat", "showOnlyIfSpectatorsCanChat"},
|
||||
{"show_only_if_spectators_can_see_hands", "showOnlyIfSpectatorsCanSeeHands"},
|
||||
};
|
||||
|
||||
QSettings filtersIni(settingsPath + "gamefilters.ini", QSettings::IniFormat);
|
||||
for (auto it = filterKeyMap.constBegin(); it != filterKeyMap.constEnd(); ++it) {
|
||||
if (legacySetting.contains(it.key())) {
|
||||
filtersIni.setValue("filter_games/" + it.value(), legacySetting.value(it.key()));
|
||||
}
|
||||
}
|
||||
const QString gameTypePrefix = "game_type/";
|
||||
for (const auto &key : keys) {
|
||||
filtersIni.setValue("filter_games/" + key, legacySetting.value(key));
|
||||
if (key.startsWith(gameTypePrefix)) {
|
||||
filtersIni.setValue("filter_games/gameType/" + key.mid(gameTypePrefix.size()), legacySetting.value(key));
|
||||
}
|
||||
}
|
||||
legacySetting.endGroup();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue