[vlmc-devel] Use Core class to relay project loaded events to potential consumers

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


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 31 21:16:17 2014 +0300| [7c57a78c6f5205c4677b93e5a12f0148d52a43f5] | committer: Hugo Beauzée-Luyssen

Use Core class to relay project loaded events to potential consumers

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

 src/Main/Core.cpp |    2 ++
 src/Main/Core.h   |   11 +++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/Main/Core.cpp b/src/Main/Core.cpp
index f7f619f..a0934bd 100644
--- a/src/Main/Core.cpp
+++ b/src/Main/Core.cpp
@@ -100,6 +100,8 @@ Core::onProjectLoaded( Project* project )
 {
     m_automaticBackup->setProject( project );
     m_recentProjects->setProject( project );
+
+    emit projectLoaded( project );
 }
 
 Settings*
diff --git a/src/Main/Core.h b/src/Main/Core.h
index 0708e82..673682f 100644
--- a/src/Main/Core.h
+++ b/src/Main/Core.h
@@ -36,10 +36,14 @@ namespace Backend
     class IBackend;
 }
 
+#include <QObject>
+
 #include <Tools/Singleton.hpp>
 
-class Core : public Singleton<Core>
+class Core : public QObject, public Singleton<Core>
 {
+    Q_OBJECT
+
     public:
         Backend::IBackend*      backend();
         EffectsEngine*          effectsEngine();
@@ -50,9 +54,12 @@ class Core : public Singleton<Core>
 
         void                    onProjectLoaded( Project* project );
 
+    signals:
+        void                    projectLoaded( Project* project );
+
     private:
         Core();
-        ~Core();
+        virtual ~Core();
         Backend::IBackend*      m_backend;
         EffectsEngine*          m_effectsEngine;
         Settings*               m_settings;



More information about the Vlmc-devel mailing list