mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06: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:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user