Commit 9943844b authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Passing argv though the launcher.

parent 5319e7d9
......@@ -25,11 +25,13 @@
#include "Launcher.h"
Launcher::Launcher( QObject* parent ) : QObject( parent )
Launcher::Launcher( int argc, char** argv, QObject* parent ) : QObject( parent )
{
m_process = new QProcess;
connect( m_process, SIGNAL( finished( int, QProcess::ExitStatus ) ),
this, SLOT( stopped( int, QProcess::ExitStatus ) ) );
for ( int i = 1; i < argc; ++i )
m_argv << argv[i];
}
void Launcher::start()
......@@ -47,7 +49,7 @@ void Launcher::stopped( int exitCode, QProcess::ExitStatus )
QCoreApplication::exit( exitCode );
break ;
case Launcher::crashWithRestart:
m_process->start( "bin/vlmc" );
m_process->start( "bin/vlmc", m_argv );
return ;
}
}
......@@ -24,6 +24,7 @@
#define LAUNCHER_H
#include <QProcess>
#include <QStringList>
class Launcher : public QObject
{
......@@ -34,12 +35,13 @@ class Launcher : public QObject
static const int crashExit = 1;
static const int crashWithRestart = 2;
Launcher( QObject* parent = NULL );
Launcher( int argc, char** argv, QObject* parent = NULL );
void start();
public slots:
void stopped( int retCode, QProcess::ExitStatus exitType );
private:
QProcess* m_process;
QStringList m_argv;
};
#endif // LAUNCHER_H
......@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Launcher l;
Launcher l(argc, argv);
l.start();
return a.exec();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment