[vlmc-devel] Connect ProjectManager & UndoStack from Project ctor

Hugo Beauzée-Luyssen git at videolan.org
Sat Mar 29 01:03:40 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Mar 29 01:54:06 2014 +0200| [848e5569ab8d3b060cc362960950b58ab9fa5223] | committer: Hugo Beauzée-Luyssen

Connect ProjectManager & UndoStack from Project ctor

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

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

diff --git a/src/Main/Project.cpp b/src/Main/Project.cpp
index bc9dec2..a84e539 100644
--- a/src/Main/Project.cpp
+++ b/src/Main/Project.cpp
@@ -38,6 +38,9 @@ Project::Project()
     m_workflow = new MainWorkflow( m_projectManager );
     m_workspace = new Workspace( m_settings );
     m_library = new Library( m_workspace, m_projectManager );
+
+    QObject::connect( m_undoStack, SIGNAL( cleanChanged( bool ) ), m_projectManager, SLOT( cleanChanged( bool ) ) );
+    QObject::connect( m_projectManager, SIGNAL( projectSaved() ), m_undoStack, SLOT( setClean() ) );
 }
 
 Project::~Project()
diff --git a/src/Project/ProjectManager.cpp b/src/Project/ProjectManager.cpp
index 13bd8f5..fbb0c37 100644
--- a/src/Project/ProjectManager.cpp
+++ b/src/Project/ProjectManager.cpp
@@ -103,7 +103,7 @@ ProjectManager::ProjectManager( Settings* projectSettings, Settings* vlmcSetting
     vlmcSettings->watchValue( "vlmc/AutomaticBackup", this,
                                                 SLOT( automaticSaveEnabledChanged(QVariant) ),
                                                 Qt::QueuedConnection );
-    projectSettings->createVar( SettingValue::Int, "vlmc/AutomaticBackupInterval", 5,
+    vlmcSettings->createVar( SettingValue::Int, "vlmc/AutomaticBackupInterval", 5,
                                 QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save interval" ),
                                 QT_TRANSLATE_NOOP( "PreferenceWidget", "This is the interval that VLMC will wait "
                                             "between two automatic save" ), SettingValue::Nothing );
@@ -111,12 +111,7 @@ ProjectManager::ProjectManager( Settings* projectSettings, Settings* vlmcSetting
                                                 SLOT( automaticSaveIntervalChanged(QVariant) ),
                                                 Qt::QueuedConnection );
 
-    Project::getInstance()->settings()->watchValue( "vlmc/ProjectName", this,
-                                                SLOT(projectNameChanged(QVariant) ) );
-    connect( Project::getInstance()->undoStack(), SIGNAL( cleanChanged( bool ) ),
-             this, SLOT( cleanChanged( bool ) ) );
-    connect( this, SIGNAL( projectSaved() ),
-                Project::getInstance()->undoStack(), SLOT( setClean() ) );
+    projectSettings->watchValue( "vlmc/ProjectName", this, SLOT(projectNameChanged(QVariant) ) );
 
     //We have to wait for the library to be loaded before loading the workflow
     //FIXME



More information about the Vlmc-devel mailing list