mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
Invert "Show" games, so all games are visible by default (#5521)
This commit is contained in:
parent
b48fe8b99c
commit
f6c31bf901
8 changed files with 113 additions and 173 deletions
|
|
@ -104,11 +104,7 @@ void SettingsCache::translateLegacySettings()
|
|||
|
||||
// Game filters
|
||||
legacySetting.beginGroup("filter_games");
|
||||
gameFilters().setShowFullGames(legacySetting.value("unavailable_games_visible").toBool());
|
||||
gameFilters().setShowGamesThatStarted(legacySetting.value("unavailable_games_visible").toBool());
|
||||
gameFilters().setShowPasswordProtectedGames(legacySetting.value("show_password_protected_games").toBool());
|
||||
gameFilters().setGameNameFilter(legacySetting.value("game_name_filter").toString());
|
||||
gameFilters().setShowBuddiesOnlyGames(legacySetting.value("show_buddies_only_games").toBool());
|
||||
gameFilters().setHideIgnoredUserGames(legacySetting.value("hide_ignored_user_games").toBool());
|
||||
gameFilters().setMinPlayers(legacySetting.value("min_players").toInt());
|
||||
|
||||
|
|
|
|||
|
|
@ -17,48 +17,48 @@ QString GameFiltersSettings::hashGameType(const QString &gameType) const
|
|||
return QCryptographicHash::hash(gameType.toUtf8(), QCryptographicHash::Md5).toHex();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowBuddiesOnlyGames(bool show)
|
||||
void GameFiltersSettings::setHideBuddiesOnlyGames(bool hide)
|
||||
{
|
||||
setValue(show, "show_buddies_only_games", "filter_games");
|
||||
setValue(hide, "hide_buddies_only_games", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowBuddiesOnlyGames()
|
||||
bool GameFiltersSettings::isHideBuddiesOnlyGames()
|
||||
{
|
||||
QVariant previous = getValue("show_buddies_only_games", "filter_games");
|
||||
return previous == QVariant() ? true : previous.toBool();
|
||||
QVariant previous = getValue("hide_buddies_only_games", "filter_games");
|
||||
return previous == QVariant() || previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowFullGames(bool show)
|
||||
void GameFiltersSettings::setHideFullGames(bool hide)
|
||||
{
|
||||
setValue(show, "show_full_games", "filter_games");
|
||||
setValue(hide, "hide_full_games", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowFullGames()
|
||||
bool GameFiltersSettings::isHideFullGames()
|
||||
{
|
||||
QVariant previous = getValue("show_full_games", "filter_games");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
QVariant previous = getValue("hide_full_games", "filter_games");
|
||||
return !(previous == QVariant()) && previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowGamesThatStarted(bool show)
|
||||
void GameFiltersSettings::setHideGamesThatStarted(bool hide)
|
||||
{
|
||||
setValue(show, "show_games_that_started", "filter_games");
|
||||
setValue(hide, "hide_games_that_started", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowGamesThatStarted()
|
||||
bool GameFiltersSettings::isHideGamesThatStarted()
|
||||
{
|
||||
QVariant previous = getValue("show_games_that_started", "filter_games");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
QVariant previous = getValue("hide_games_that_started", "filter_games");
|
||||
return !(previous == QVariant()) && previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowPasswordProtectedGames(bool show)
|
||||
void GameFiltersSettings::setHidePasswordProtectedGames(bool hide)
|
||||
{
|
||||
setValue(show, "show_password_protected_games", "filter_games");
|
||||
setValue(hide, "hide_password_protected_games", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowPasswordProtectedGames()
|
||||
bool GameFiltersSettings::isHidePasswordProtectedGames()
|
||||
{
|
||||
QVariant previous = getValue("show_password_protected_games", "filter_games");
|
||||
return previous == QVariant() ? true : previous.toBool();
|
||||
QVariant previous = getValue("hide_password_protected_games", "filter_games");
|
||||
return previous == QVariant() || previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setHideIgnoredUserGames(bool hide)
|
||||
|
|
@ -69,7 +69,7 @@ void GameFiltersSettings::setHideIgnoredUserGames(bool hide)
|
|||
bool GameFiltersSettings::isHideIgnoredUserGames()
|
||||
{
|
||||
QVariant previous = getValue("hide_ignored_user_games", "filter_games");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
return !(previous == QVariant()) && previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameNameFilter(QString gameName)
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ class GameFiltersSettings : public SettingsManager
|
|||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
bool isShowBuddiesOnlyGames();
|
||||
bool isShowFullGames();
|
||||
bool isShowGamesThatStarted();
|
||||
bool isShowPasswordProtectedGames();
|
||||
bool isHideBuddiesOnlyGames();
|
||||
bool isHideFullGames();
|
||||
bool isHideGamesThatStarted();
|
||||
bool isHidePasswordProtectedGames();
|
||||
bool isHideIgnoredUserGames();
|
||||
QString getGameNameFilter();
|
||||
QString getCreatorNameFilter();
|
||||
|
|
@ -25,11 +25,11 @@ public:
|
|||
bool isShowOnlyIfSpectatorsCanChat();
|
||||
bool isShowOnlyIfSpectatorsCanSeeHands();
|
||||
|
||||
void setShowBuddiesOnlyGames(bool show);
|
||||
void setHideBuddiesOnlyGames(bool hide);
|
||||
void setHideIgnoredUserGames(bool hide);
|
||||
void setShowFullGames(bool show);
|
||||
void setShowGamesThatStarted(bool show);
|
||||
void setShowPasswordProtectedGames(bool show);
|
||||
void setHideFullGames(bool hide);
|
||||
void setHideGamesThatStarted(bool hide);
|
||||
void setHidePasswordProtectedGames(bool hide);
|
||||
void setGameNameFilter(QString gameName);
|
||||
void setCreatorNameFilter(QString creatorName);
|
||||
void setMinPlayers(int min);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue