[vlmc-devel] ConsoleRenderer: Take the output file name as a constructor argument

Yikai Lu git at videolan.org
Fri Jun 9 14:07:28 CEST 2017


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Fri Jun  9 20:56:07 2017 +0900| [4d9a72c542dc4f5f131c3e01886c915122ef33e8] | committer: Yikai Lu

ConsoleRenderer: Take the output file name as a constructor argument

> https://code.videolan.org/videolan/vlmc/commit/4d9a72c542dc4f5f131c3e01886c915122ef33e8
---

 src/Main/main.cpp                | 2 +-
 src/Renderer/ConsoleRenderer.cpp | 7 +++----
 src/Renderer/ConsoleRenderer.h   | 3 ++-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Main/main.cpp b/src/Main/main.cpp
index 17bdf8c6..c6b2c73b 100644
--- a/src/Main/main.cpp
+++ b/src/Main/main.cpp
@@ -204,7 +204,7 @@ VLMCCoremain( int argc, char **argv )
     }
 
 
-    ConsoleRenderer renderer;
+    ConsoleRenderer renderer( app.arguments()[2] );
     Project  *p = Core::instance()->project();
 
     QCoreApplication::connect( p, &Project::projectLoaded, &renderer, &ConsoleRenderer::startRender );
diff --git a/src/Renderer/ConsoleRenderer.cpp b/src/Renderer/ConsoleRenderer.cpp
index 5a2199e7..ad21cbc8 100644
--- a/src/Renderer/ConsoleRenderer.cpp
+++ b/src/Renderer/ConsoleRenderer.cpp
@@ -31,12 +31,11 @@
 #include "Workflow/MainWorkflow.h"
 
 #include <QCoreApplication>
-#include <QStringList>
 
-ConsoleRenderer::ConsoleRenderer(QObject *parent) :
-    QObject(parent)
+ConsoleRenderer::ConsoleRenderer( const QString& outputFileName, QObject *parent )
+    : QObject( parent )
+    , m_outputFileName( outputFileName )
 {
-    m_outputFileName = qApp->arguments()[2];
     connect( Core::instance()->workflow(), &MainWorkflow::frameChanged,
              this, &ConsoleRenderer::frameChanged, Qt::DirectConnection );
     connect( Core::instance()->workflow(), &MainWorkflow::mainWorkflowEndReached, qApp, &QCoreApplication::quit );
diff --git a/src/Renderer/ConsoleRenderer.h b/src/Renderer/ConsoleRenderer.h
index 25bb14f3..57350ee2 100644
--- a/src/Renderer/ConsoleRenderer.h
+++ b/src/Renderer/ConsoleRenderer.h
@@ -28,9 +28,10 @@
 
 class ConsoleRenderer : public QObject
 {
+    Q_OBJECT
 
 public:
-    explicit ConsoleRenderer( QObject *parent = 0 );
+    explicit ConsoleRenderer( const QString& outputFileName, QObject *parent = 0 );
 
     void        startRender();
 



More information about the Vlmc-devel mailing list