[vlmc-devel] Main: use common code path
Jean-Baptiste Kempf
git at videolan.org
Sun Mar 2 16:27:58 CET 2014
vlmc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar 2 15:43:44 2014 +0100| [8e991e66316f31939d19dc968ba177cdef433b30] | committer: Jean-Baptiste Kempf
Main: use common code path
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=8e991e66316f31939d19dc968ba177cdef433b30
---
src/Main/main.cpp | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/Main/main.cpp b/src/Main/main.cpp
index 08cfbe1..df2186f 100644
--- a/src/Main/main.cpp
+++ b/src/Main/main.cpp
@@ -49,6 +49,20 @@
#include <X11/Xlib.h>
#endif
+static void
+VLMCmainCommon( const QCoreApplication &app )
+{
+ app.setApplicationName( "vlmc" );
+ app.setOrganizationName( "VideoLAN" );
+ app.setOrganizationDomain( "videolan.org" );
+ app.setApplicationVersion( PROJECT_VERSION );
+
+ qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
+ qRegisterMetaType<Vlmc::FrameChangedReason>( "Vlmc::FrameChangedReason" );
+ qRegisterMetaType<QVariant>( "QVariant" );
+ qRegisterMetaType<QUuid>( "QUuid" );
+}
+
/**
* VLMC Entry point
* \brief this is the VLMC entry point
@@ -63,15 +77,7 @@ VLMCGuimain( int argc, char **argv )
XInitThreads();
#endif
QApplication app( argc, argv );
- app.setApplicationName( "vlmc" );
- app.setOrganizationName( "videolan" );
- app.setOrganizationDomain( "videolan.org" );
- app.setApplicationVersion( PROJECT_VERSION );
-
- qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
- qRegisterMetaType<Vlmc::FrameChangedReason>( "Vlmc::FrameChangedReason" );
- qRegisterMetaType<QVariant>( "QVariant" );
- qRegisterMetaType<QUuid>( "QUuid" );
+ VLMCmainCommon( app );
QSettings s;
s.setFallbacksEnabled( false );
@@ -151,21 +157,14 @@ int
VLMCCoremain( int argc, char **argv )
{
QCoreApplication app( argc, argv );
- app.setApplicationName( "VLMC" );
- app.setOrganizationName( "VideoLAN" );
- app.setOrganizationDomain( "vlmc.org" );
- app.setApplicationVersion( PROJECT_VERSION );
-
- qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
- qRegisterMetaType<Vlmc::FrameChangedReason>( "Vlmc::FrameChangedReason" );
- qRegisterMetaType<QVariant>( "QVariant" );
-
if ( app.arguments().count() < 3 )
{
vlmcCritical() << "Usage: ./vlmc project.vlmc output_file";
return 1;
}
+ VLMCmainCommon( app );
+
#ifndef WITH_GUI
ConsoleRenderer renderer;
ProjectManager *pm = ProjectManager::getInstance();
More information about the Vlmc-devel
mailing list