mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
[SettingsManager] Properly handle multithreaded access (#6747)
This commit is contained in:
parent
dd053c76df
commit
74cce5ccb2
3 changed files with 28 additions and 5 deletions
|
|
@ -11,6 +11,8 @@ CardCounterSettings::CardCounterSettings(const QString &settingsPath, QObject *p
|
|||
|
||||
void CardCounterSettings::setColor(int counterId, const QColor &color)
|
||||
{
|
||||
QSettings settings = getSettings();
|
||||
|
||||
QString key = QString("cards/counters/%1/color").arg(counterId);
|
||||
|
||||
if (settings.value(key).value<QColor>() == color)
|
||||
|
|
@ -36,7 +38,7 @@ QColor CardCounterSettings::color(int counterId) const
|
|||
defaultColor = QColor::fromHsv(h, s, v);
|
||||
}
|
||||
|
||||
return settings.value(QString("cards/counters/%1/color").arg(counterId), defaultColor).value<QColor>();
|
||||
return getSettings().value(QString("cards/counters/%1/color").arg(counterId), defaultColor).value<QColor>();
|
||||
}
|
||||
|
||||
QString CardCounterSettings::displayName(int counterId) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue