Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix settings changes not taking effect immediately.
  • Loading branch information
adenexter committed Jan 19, 2017
1 parent 1d135e2 commit c0a798f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nemo-devicelock/private/settingswatcher.cpp
Expand Up @@ -152,6 +152,10 @@ static void read(
void SettingsWatcher::reloadSettings()
{
QSettings settings(m_settingsPath, QSettings::IniFormat);
// QSettings appears to be caching queried data between instances and that cache isn't
// being invalidated when the file is replaced but not deleted. Forcing a sync makes it
// read the new file.
settings.sync();

read(settings, this, automaticLockingKey, 10, &SettingsWatcher::automaticLocking, &SettingsWatcher::automaticLockingChanged);
read(settings, this, minimumLengthKey, 5, &SettingsWatcher::minimumLength, &SettingsWatcher::minimumLengthChanged);
Expand Down

0 comments on commit c0a798f

Please sign in to comment.