[vlmc-devel] ProjectManager: Drop dependency on application settings

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 31 17:59:20 CEST 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 31 00:27:14 2014 +0300| [a13ef88e3cf573f8f3fa1e8ed33fcad5b9ed17db] | committer: Hugo Beauzée-Luyssen

ProjectManager: Drop dependency on application settings

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

 src/Main/Project.cpp           |    2 +-
 src/Project/ProjectManager.cpp |    5 ++---
 src/Project/ProjectManager.h   |    3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/Main/Project.cpp b/src/Main/Project.cpp
index eff61c2..631372f 100644
--- a/src/Main/Project.cpp
+++ b/src/Main/Project.cpp
@@ -33,7 +33,7 @@
 Project::Project()
 {
     m_settings = new Settings( QString() );
-    m_projectManager = new ProjectManager( m_settings, Core::getInstance()->settings() );
+    m_projectManager = new ProjectManager( m_settings );
     m_undoStack = new QUndoStack;
     m_workflow = new MainWorkflow();
     m_workspace = new Workspace( m_settings );
diff --git a/src/Project/ProjectManager.cpp b/src/Project/ProjectManager.cpp
index fa1a79b..2500be6 100644
--- a/src/Project/ProjectManager.cpp
+++ b/src/Project/ProjectManager.cpp
@@ -46,12 +46,11 @@
 const QString   ProjectManager::unNamedProject = ProjectManager::tr( "Untitled Project" );
 const QString   ProjectManager::backupSuffix = "~";
 
-ProjectManager::ProjectManager( Settings* projectSettings, Settings* vlmcSettings )
+ProjectManager::ProjectManager( Settings* projectSettings )
     : m_projectFile( NULL )
     , m_isClean( true )
     , m_libraryCleanState( true )
     , m_projectSettings( projectSettings )
-    , m_vlmcSettings( vlmcSettings )
 {
     SettingValue    *fps = projectSettings->createVar( SettingValue::Double, "video/VLMCOutputFPS", 29.97,
                                 QT_TRANSLATE_NOOP( "PreferenceWidget", "Output video FPS" ),
@@ -217,7 +216,7 @@ ProjectManager::saveAs()
 bool
 ProjectManager::loadEmergencyBackup()
 {
-    const QString lastProject = m_vlmcSettings->value( SETTINGS_BACKUP )->get().toString();
+    const QString lastProject = Core::getInstance()->settings()->value( SETTINGS_BACKUP )->get().toString();
     if ( QFile::exists( lastProject ) == true )
     {
         loadProject(  lastProject );
diff --git a/src/Project/ProjectManager.h b/src/Project/ProjectManager.h
index fb5864d..fd773fb 100644
--- a/src/Project/ProjectManager.h
+++ b/src/Project/ProjectManager.h
@@ -87,7 +87,7 @@ public:
 
 
 
-    ProjectManager( Settings *projectSettings , Settings *vlmcSettings );
+    ProjectManager( Settings *projectSettings );
     ~ProjectManager();
 
     void            setProjectManagerUi( IProjectManagerUiCb* projectManagerUi );
@@ -144,7 +144,6 @@ protected:
     bool                    m_libraryCleanState;
     IProjectManagerUiCb*    m_projectManagerUi;
     Settings*               m_projectSettings;
-    Settings*               m_vlmcSettings;
 
 public slots:
     void            cleanChanged( bool val );



More information about the Vlmc-devel mailing list