Commit 09c2e5af authored by Clement CHAVANCE's avatar Clement CHAVANCE

Added a commit features in SettingsManager

parent decf0941
......@@ -29,6 +29,7 @@ void ProjectSettingsDefault::load( const QString& part )
ProjectSettingsDefault::loadAudioDefaults( part );
ProjectSettingsDefault::loadVideoDefaults( part );
ProjectSettingsDefault::loadProjectDefaults( part );
SettingsManager::getInstance()->commit();
return ;
}
......
......@@ -59,6 +59,8 @@ class SettingsManager : public QObject, public QSingleton<SettingsManager>
void saveSettings( const QString& part, QDomDocument& xmlfile, QDomElement& root );
void loadSettings( const QString& part, const QDomElement& settings );
void addNewSettingsPart( const QString& name );
void commit();
void flush();
static void loadDefaultsSettings();
static SettingsManager* getInstance();
......@@ -67,6 +69,7 @@ class SettingsManager : public QObject, public QSingleton<SettingsManager>
~SettingsManager();
QHash<QString, SettingsPart*> m_data;
QHash<QString, SettingsPart*> m_tempData;
mutable QReadWriteLock m_globalLock;
static bool m_defaultLoaded;
......
......@@ -30,6 +30,7 @@ void VLMCSettingsDefault::load( const QString& part )
SettingsManager::getInstance()->addNewSettingsPart( part );
VLMCSettingsDefault::loadVLMCDefaults( part );
VLMCSettingsDefault::loadlanguageDefaults( part );
SettingsManager::getInstance()->commit();
return ;
}
......
......@@ -182,6 +182,7 @@ void Settings::buttonClicked( QAbstractButton* button )
foreach( widg, m_pWidgets )
widg->save();
SettingsManager::getInstance()->commit();
}
if ( hide == true )
setVisible( false );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment