-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlaunch.cpp
26 lines (23 loc) · 861 Bytes
/
launch.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "launch.h"
Launch::Launch(QObject *parent) :
QObject(parent),
m_process(new QProcess(this)) {
}
QString Launch::launch(QString executable) {
QString program = QString("%1").arg(executable);
m_process->start(program);
m_process->waitForFinished(-1);
QByteArray bytes = m_process->readAllStandardOutput();
QString output = QString::fromLocal8Bit(bytes);
return output;
}
QString Launch::launch(QString executable, QString config, QString core, QString game) {
qDebug() << executable;
QString program = QString("%1 -c %2 -L %3 %4").arg(executable, config, core, game);
qDebug() << "launching:: " << program;
m_process->start(program);
m_process->waitForFinished(-1);
QByteArray bytes = m_process->readAllStandardOutput();
QString output = QString::fromLocal8Bit(bytes);
return output;
}