b58e33b2a4
resolves #36
18 lines
561 B
C++
18 lines
561 B
C++
#include "processlauncher.h"
|
|
|
|
#define LOG(x) qDebug() << "[ProcessLauncher]" << x
|
|
|
|
ProcessLauncher::ProcessLauncher(QObject *parent) : QObject(parent)
|
|
{
|
|
|
|
}
|
|
bool ProcessLauncher::launchProgram(const QString &program, const QStringList &arguments)
|
|
{
|
|
QString executablePath = QStandardPaths::findExecutable(program);
|
|
if(executablePath == "") {
|
|
LOG("[ProcessLauncher] Program " + program + "not found");
|
|
return false;
|
|
}
|
|
QProcess *externalProcess = new QProcess(this);
|
|
return externalProcess->startDetached(program, arguments);
|
|
}
|