Browse Source

Don't emit superfluous signal

`Preferences::apply()` might emit superfluous changed signal even when the settings hasn't
changed (e.g. not dirty), this commit fixes it.
adaptive-webui-19844
Chocobo1 1 year ago
parent
commit
213b6e316c
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 4
      src/base/settingsstorage.cpp

4
src/base/settingsstorage.cpp

@ -79,8 +79,10 @@ SettingsStorage *SettingsStorage::instance()
bool SettingsStorage::save() bool SettingsStorage::save()
{ {
// return `true` only when settings is different AND is saved successfully
const QWriteLocker locker(&m_lock); // guard for `m_dirty` too const QWriteLocker locker(&m_lock); // guard for `m_dirty` too
if (!m_dirty) return true; if (!m_dirty) return false;
if (!writeNativeSettings()) if (!writeNativeSettings())
{ {

Loading…
Cancel
Save