mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -07:00
[SettingsManager] Properly handle multithreaded access again (#6844)
* [SettingsManager] Properly handle multithreaded access again * Add comment * Add batch write function --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
7c9fbe2be0
commit
19dbb17fb9
10 changed files with 88 additions and 12 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