Commit 9da7edf9 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removed launcher

parent 7ffa96e0
......@@ -95,7 +95,6 @@ IF (UNIX)
ENDIF (UNIX)
SUBDIRS(ts)
SUBDIRS(launcher)
SUBDIRS(src)
# Copy stuff to doc subdirectory
......
#!/bin/sh
BIN="bin/launcher"
BIN="bin/vlmc"
if [ -f $BIN ]; then
exec $BIN "$@"
else
......
/*****************************************************************************
* Launcher.cpp : Will launch VLMC and watch for events
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtDebug>
#include <QCoreApplication>
#include "Launcher.h"
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];
m_process->setReadChannelMode( QProcess::ForwardedChannels );
}
void Launcher::start()
{
//If you put "vlmc" here, it will probably result in a fork bomb :)
m_process->start( "bin/vlmc", m_argv );
}
void Launcher::stopped( int exitCode, QProcess::ExitStatus )
{
switch ( exitCode )
{
case Launcher::cleanExit:
case Launcher::crashExit:
QCoreApplication::exit( exitCode );
break ;
case Launcher::crashWithRestart:
m_process->start( "bin/vlmc", m_argv );
return ;
}
}
/*****************************************************************************
* Launcher.h: Will launch vlmc and watch for events.
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef LAUNCHER_H
#define LAUNCHER_H
#include <QProcess>
#include <QStringList>
class Launcher : public QObject
{
Q_OBJECT
public:
static const int cleanExit = 0;
static const int crashExit = 1;
static const int crashWithRestart = 2;
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
/*****************************************************************************
* main.cpp: Creates the launcher
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtCore/QCoreApplication>
#include "Launcher.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
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