Commit 1ebb755d authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

SettingManager: Removing commit() method.

Fixes #56
parent 4effae74
......@@ -94,11 +94,7 @@ void ProjectWizard::showHelp()
void ProjectWizard::accept()
{
if ( currentId() == Page_Video )
{
GUIProjectManager::getInstance()->newProject( field( "projectName" ).toString() );
SettingsManager::getInstance()->commit( SettingsManager::Project );
SettingsManager::getInstance()->commit( SettingsManager::Vlmc );
}
QDialog::accept();
}
......
......@@ -23,6 +23,8 @@
#include "VideoPage.h"
#include "SettingsManager.h"
#include <QtDebug>
VideoPage::VideoPage( QWidget *parent ) :
QWizardPage( parent )
{
......@@ -98,7 +100,6 @@ bool VideoPage::validatePage()
sManager->setValue( "video/VLMCOutputFPS", projectFps, SettingsManager::Project );
sManager->setValue( "video/VideoProjectHeight", projectHeight, SettingsManager::Project );
sManager->setValue( "video/VideoProjectWidth", projectWidth, SettingsManager::Project );
sManager->commit( SettingsManager::Project );
return true;
}
......
......@@ -217,41 +217,6 @@ SettingsManager::load( const QDomElement &root )
return true;
}
void
SettingsManager::commit( SettingsManager::Type type )
{
{
QWriteLocker wlock( &m_rwLock );
if ( type == Project )
{
SettingHash::iterator it;
SettingHash::iterator ed = m_tmpXmlSettings.end();
for ( it = m_tmpXmlSettings.begin() ; it != ed; ++it )
{
if ( m_xmlSettings.contains( it.key() ) )
m_xmlSettings[it.key()]->set( it.value()->get() );
else
m_xmlSettings.insert( it.key(), it.value() );
}
}
else if ( type == Vlmc )
{
QSettings sett;
SettingHash::iterator it;
SettingHash::iterator ed = m_classicSettings.end();
for ( it = m_classicSettings.begin(); it != ed; ++it )
{
sett.setValue( it.key(), it.value()->get() );
if ( m_classicSettings.contains( it.key() ) )
m_classicSettings[it.key()]->set( it.value()->get() );
else
m_classicSettings.insert( it.key(), it.value() );
}
}
}
flush();
}
void
SettingsManager::createVar( SettingValue::Type type, const QString &key,
const QVariant &defaultValue, const char *name,
......
......@@ -117,7 +117,6 @@ class SettingsManager : public QObject, public Singleton<SettingsManager>
void save( QXmlStreamWriter& project ) const;
bool load( const QDomElement &element );
void commit( SettingsManager::Type type );
void flush();
private:
......
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