mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
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.
This commit is contained in:
parent
ffc3d8d345
commit
213b6e316c
1 changed files with 3 additions and 1 deletions
|
@ -79,8 +79,10 @@ SettingsStorage *SettingsStorage::instance()
|
|||
|
||||
bool SettingsStorage::save()
|
||||
{
|
||||
// return `true` only when settings is different AND is saved successfully
|
||||
|
||||
const QWriteLocker locker(&m_lock); // guard for `m_dirty` too
|
||||
if (!m_dirty) return true;
|
||||
if (!m_dirty) return false;
|
||||
|
||||
if (!writeNativeSettings())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue