[vlmc-devel] Reenable project loading through an ugly workaround

Hugo Beauzée-Luyssen git at videolan.org
Fri Mar 4 17:14:20 CET 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Mar  4 15:42:00 2016 +0100| [1b87e247fac467e363136f133ee27fddce54a295] | committer: Hugo Beauzée-Luyssen

Reenable project loading through an ugly workaround

This makes no sense from an architectural point of view

> https://code.videolan.org/videolan/vlmc/commit/1b87e247fac467e363136f133ee27fddce54a295
---

 src/Library/Library.h           | 2 +-
 src/Main/Core.h                 | 1 +
 src/Project/Project.cpp         | 3 +++
 src/Project/Project.h           | 3 +++
 src/Renderer/WorkflowRenderer.h | 3 +--
 src/Workflow/MainWorkflow.h     | 3 +--
 6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/Library/Library.h b/src/Library/Library.h
index 096233f..8eff4c7 100644
--- a/src/Library/Library.h
+++ b/src/Library/Library.h
@@ -63,10 +63,10 @@ public:
     //FIXME: Ugly workaround
 public:
     bool            save( QXmlStreamWriter& project );
+    virtual bool    load( const QDomDocument& project );
 
 private:
     void            setCleanState( bool newState );
-    virtual bool    load( const QDomDocument& project );
 
 private:
     QAtomicInt  m_nbMediaToLoad;
diff --git a/src/Main/Core.h b/src/Main/Core.h
index 5fd9c2d..2979791 100644
--- a/src/Main/Core.h
+++ b/src/Main/Core.h
@@ -72,6 +72,7 @@ class Core : public QObject
         virtual ~Core();
 
         void                    createSettings();
+        void                    connectComponents();
 
     private:
         Backend::IBackend*      m_backend;
diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index 372488f..1ac8a10 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -119,6 +119,9 @@ Project::load( const QString& path )
 
     m_settings->load( doc );
     emit projectLoading( m_projectName );
+    Core::getInstance()->library()->load( doc );
+    Core::getInstance()->workflow()->load( doc );
+    Core::getInstance()->workflowRenderer()->load( doc );
     m_isClean = autoBackupFound == false;
     emit cleanStateChanged( m_isClean );
     if ( autoBackupFound == false )
diff --git a/src/Project/Project.h b/src/Project/Project.h
index 5d20779..389d410 100644
--- a/src/Project/Project.h
+++ b/src/Project/Project.h
@@ -113,6 +113,9 @@ class Project : public QObject
         void                projectClosed();
         void                outdatedBackupFileFound( const QString& path );
 
+private:
+        bool                loadWorkflow( const QDomDocument& root );
+
     private:
         QFile*              m_projectFile;
         QString             m_projectName;
diff --git a/src/Renderer/WorkflowRenderer.h b/src/Renderer/WorkflowRenderer.h
index c2d883c..710bf28 100644
--- a/src/Renderer/WorkflowRenderer.h
+++ b/src/Renderer/WorkflowRenderer.h
@@ -143,8 +143,6 @@ class   WorkflowRenderer : public GenericRenderer, public ILoadSave
          */
         virtual void        startPreview();
 
-        virtual bool        load( const QDomDocument& project );
-
     protected:
         /**
          *  \brief          Will return a pointer to the function/static method to use
@@ -253,6 +251,7 @@ class   WorkflowRenderer : public GenericRenderer, public ILoadSave
     //FIXME: Ugly workaround
     public:
         bool                save( QXmlStreamWriter &project );
+        bool                load( const QDomDocument& project );
 
     protected:
         MainWorkflow*       m_mainWorkflow;
diff --git a/src/Workflow/MainWorkflow.h b/src/Workflow/MainWorkflow.h
index c7ac7de..babf2f1 100644
--- a/src/Workflow/MainWorkflow.h
+++ b/src/Workflow/MainWorkflow.h
@@ -264,6 +264,7 @@ class   MainWorkflow : public QObject, public ILoadSave
 
         //FIXME: Ugly workaround
         bool                    save( QXmlStreamWriter& project );
+        bool                    load( const QDomDocument& project );
 
     private:
         /**
@@ -284,8 +285,6 @@ class   MainWorkflow : public QObject, public ILoadSave
         ClipHelper*             getClipHelper( const QUuid& uuid, unsigned int trackId,
                                                Workflow::TrackType trackType );
 
-        bool                    load( const QDomDocument& project );
-
     private:
         /// Pre-filled buffer used when there's nothing to render
         Workflow::Frame         *m_blackOutput;



More information about the Vlmc-devel mailing list