forked from bobweaver/qml-applauncher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapplication.cpp
37 lines (36 loc) · 948 Bytes
/
application.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
27
28
29
30
31
32
33
34
35
36
37
#include "application.h"
#include <QProcess>
#include <QDebug>
Application::Application(QObject *parent) :
QObject(parent),
m_process(new QProcess(this))
{
}
QString Application::appName() const
{
return m_AppName;
}
void Application::setAppName(const QString &appName)
{
m_AppName = appName;
}
QString Application::arguments() const
{
return m_Arguments;
}
void Application::setArguments(const QString &arguments)
{
m_Arguments = arguments;
}
void Application::launchScript()
{
m_process->start(m_AppName + m_Arguments);
qDebug() << "launching application" << m_AppName << "\n with the Argument of \n" + m_Arguments ;
}
QString Application::launchScriptGetSTDOUT()
{
m_process->start(m_AppName + m_Arguments);
m_process->waitForFinished();
return QString(m_process->readAllStandardOutput());
qDebug() << "launching application" << m_AppName << "\n with the Argument of \n" + m_Arguments ;
}