Warning, file /plasma-mobile/mycroft-plasmoid-mobile/plugin/msmapp.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  *   Copyright (C) 2016 by Aditya Mehra <aix.m@outlook.com>                      *
0003  *   This program is free software; you can redistribute it and/or modify
0004  *   it under the terms of the GNU Library General Public License as
0005  *   published by the Free Software Foundation; either version 2, or
0006  *   (at your option) any later version.
0007  *
0008  *   This program is distributed in the hope that it will be useful,
0009  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0010  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0011  *   GNU General Public License for more details
0012  *
0013  *   You should have received a copy of the GNU Library General Public
0014  *   License along with this program; if not, write to the
0015  *   Free Software Foundation, Inc.,
0016  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0017  */
0018 
0019 #include "msmapp.h"
0020 
0021 #include <QProcess>
0022 
0023 MsmApp::MsmApp(QObject *parent) : 
0024     QObject(parent),
0025     m_process(new QProcess(this))
0026 {
0027 }
0028 
0029 QString MsmApp::msmapp(const QString &program)
0030 {
0031     m_process->start(program);
0032     m_process->waitForFinished(-1);
0033     QByteArray bytes = m_process->readAllStandardOutput();
0034     QString output = QString::fromLocal8Bit(bytes);
0035     return output;
0036 }
0037