[vlmc-devel] Core: Fix projectLoaded semantic. Turn it into projectLoading

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 31 22:42:31 CEST 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 31 22:10:40 2014 +0300| [90970a4d417f2c065db993b2d48ce8823061c88c] | committer: Hugo Beauzée-Luyssen

Core: Fix projectLoaded semantic. Turn it into projectLoading

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

 src/Gui/MainWindow.cpp |    6 +++---
 src/Gui/MainWindow.h   |    2 +-
 src/Main/Core.cpp      |    2 +-
 src/Main/Core.h        |   10 +++++++++-
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index dd39408..4efd23a 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -81,8 +81,8 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent )
     m_ui.setupUi( this );
 
     Core::getInstance()->logger()->setup();
-    connect( Core::getInstance(), SIGNAL( projectLoaded( Project* ) ),
-             this, SLOT( onProjectLoaded( Project* ) ) );
+    connect( Core::getInstance(), SIGNAL( projectLoading( Project* ) ),
+             this, SLOT( onProjectLoading( Project* ) ), Qt::DirectConnection );
     //Preferences
     initVlmcPreferences();
     //All preferences have been created: restore them:
@@ -833,7 +833,7 @@ MainWindow::canRedoChanged( bool canRedo )
 }
 
 void
-MainWindow::onProjectLoaded(Project* project)
+MainWindow::onProjectLoading(Project* project)
 {
     createProjectPreferences();
     connect( project, SIGNAL( projectUpdated( const QString&, bool ) ), this, SLOT( projectUpdated( const QString&, bool ) ) );
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index 47ad5e4..4795b76 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -159,7 +159,7 @@ private slots:
     void                    cleanStateChanged( bool isClean );
     void                    canUndoChanged( bool canUndo );
     void                    canRedoChanged( bool canRedo );
-    void                    onProjectLoaded( Project* project );
+    void                    onProjectLoading( Project* project );
 
 signals:
     void                    toolChanged( ToolButtons );
diff --git a/src/Main/Core.cpp b/src/Main/Core.cpp
index a0934bd..122dc7a 100644
--- a/src/Main/Core.cpp
+++ b/src/Main/Core.cpp
@@ -101,7 +101,7 @@ Core::onProjectLoaded( Project* project )
     m_automaticBackup->setProject( project );
     m_recentProjects->setProject( project );
 
-    emit projectLoaded( project );
+    emit projectLoading( project );
 }
 
 Settings*
diff --git a/src/Main/Core.h b/src/Main/Core.h
index 673682f..7aca3b3 100644
--- a/src/Main/Core.h
+++ b/src/Main/Core.h
@@ -55,7 +55,15 @@ class Core : public QObject, public Singleton<Core>
         void                    onProjectLoaded( Project* project );
 
     signals:
-        void                    projectLoaded( Project* project );
+        /**
+         * @brief projectLoaded Will be emited right before a project starts loading.
+         *
+         * When this is emited, all Project related instances are created. The project itself
+         * however won't be loaded (no settings, no media, ...)
+         * This should be used with Qt::DirectConnection in order not to miss any media/clip
+         * loading events.
+         */
+        void                    projectLoading( Project* project );
 
     private:
         Core();



More information about the Vlmc-devel mailing list