mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-03 18:34:28 +00: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
@ -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…
x
Reference in New Issue
Block a user