[vlmc-devel] SettingsManager: Do not save private settings to the preference file

Hugo Beauzée-Luyssen git at videolan.org
Sun Feb 9 02:08:15 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Feb  9 02:20:59 2014 +0200| [93675a6cbcfd095a215e384bd6b30301305a9846] | committer: Hugo Beauzée-Luyssen

SettingsManager: Do not save private settings to the preference file

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=93675a6cbcfd095a215e384bd6b30301305a9846
---

 src/Settings/SettingsManager.cpp |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Settings/SettingsManager.cpp b/src/Settings/SettingsManager.cpp
index 6cd6ab4..9541e9c 100644
--- a/src/Settings/SettingsManager.cpp
+++ b/src/Settings/SettingsManager.cpp
@@ -80,10 +80,17 @@ SettingsManager::setValue( const QString &key,
         SettingList::iterator   it = getPair( m_classicSettings, key );
         if ( it != m_classicSettings.end() )
         {
+            SettingValue* v = (*it).value;
+
+            // We don't want private values in our QSettings, that would be
+            // saved in the preference files, and they're called private for a reason
+            v->set( value );
+            if ( v->flags().testFlag( SettingValue::Private ) )
+                return;
+
             QSettings    sett;
             sett.setValue( key, value );
             sett.sync();
-            (*it).value->set( value );
             return ;
         }
     }



More information about the Vlmc-devel mailing list