[vlmc-devel] commit: SettingManager: Removing commit() method. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sun Jun 20 17:47:44 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Jun 20 17:47:25 2010 +0200| [1ebb755d0af0b4d13d649e13f2df6da71e216eb8] | committer: Hugo Beauzée-Luyssen 

SettingManager: Removing commit() method.

Fixes #56

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

 src/Gui/wizard/ProjectWizard.cpp |    4 ----
 src/Gui/wizard/VideoPage.cpp     |    3 ++-
 src/Settings/SettingsManager.cpp |   35 -----------------------------------
 src/Settings/SettingsManager.h   |    1 -
 4 files changed, 2 insertions(+), 41 deletions(-)

diff --git a/src/Gui/wizard/ProjectWizard.cpp b/src/Gui/wizard/ProjectWizard.cpp
index e229338..b8b9d66 100644
--- a/src/Gui/wizard/ProjectWizard.cpp
+++ b/src/Gui/wizard/ProjectWizard.cpp
@@ -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();
 }
 
diff --git a/src/Gui/wizard/VideoPage.cpp b/src/Gui/wizard/VideoPage.cpp
index b829644..e2c9fd2 100644
--- a/src/Gui/wizard/VideoPage.cpp
+++ b/src/Gui/wizard/VideoPage.cpp
@@ -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;
 }
diff --git a/src/Settings/SettingsManager.cpp b/src/Settings/SettingsManager.cpp
index e140d2b..fc795b4 100644
--- a/src/Settings/SettingsManager.cpp
+++ b/src/Settings/SettingsManager.cpp
@@ -218,41 +218,6 @@ SettingsManager::load( const QDomElement &root )
 }
 
 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,
                             const char *desc, SettingsManager::Type varType /*= Vlmc*/ )
diff --git a/src/Settings/SettingsManager.h b/src/Settings/SettingsManager.h
index 602b336..ee8791e 100644
--- a/src/Settings/SettingsManager.h
+++ b/src/Settings/SettingsManager.h
@@ -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:



More information about the Vlmc-devel mailing list