diff --git a/src/utility/package.cpp b/src/utility/package.cpp index a8ca8e102a6ed032d65fc882afe45b301ccdc874..a79f90b6728a3eae6f841ac0ea6a8f76148935a8 100644 --- a/src/utility/package.cpp +++ b/src/utility/package.cpp @@ -9,6 +9,17 @@ namespace Utility { Package::Package(QObject *parent) : QObject(parent) {} +bool Package::process(const QString &program, const QStringList &arguments) +{ + QProcess process; + process.start(program, arguments); + if (process.waitForFinished()) { + process.waitForReadyRead(); + return true; + } + return false; +} + bool Package::installProgram(const QString &path, const QString &targetPath) { QProcess process; diff --git a/src/utility/package.h b/src/utility/package.h index b8c07010ab67c842f92ba308280bb31af8379584..6300962c27530d6cee18b9df79cbba731c53cb64 100644 --- a/src/utility/package.h +++ b/src/utility/package.h @@ -12,6 +12,7 @@ class Package : public QObject public: explicit Package(QObject *parent = 0); + static bool process(const QString &program, const QStringList &arguments); static bool installProgram(const QString &path, const QString &targetPath); static bool installFile(const QString &path, const QString &targetPath); static bool installPlasmapkg(const QString &path, const QString &type = "plasmoid");