mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-05 18:15:47 +00:00
intermediate commit
This commit is contained in:
8
sources/3rdparty/task/taskadds.cpp
vendored
8
sources/3rdparty/task/taskadds.cpp
vendored
@ -19,19 +19,19 @@
|
||||
#include "taskadds.h"
|
||||
|
||||
|
||||
TaskResult runTask(const QString cmd, const bool sudo)
|
||||
TaskResult runTask(const QString cmd, const bool useSuid)
|
||||
{
|
||||
return Task::await<TaskResult>( [ & ]() {
|
||||
TaskResult r;
|
||||
if (sudo) {
|
||||
QProcess command;
|
||||
if (useSuid) {
|
||||
RootProcess command;
|
||||
command.start(cmd);
|
||||
command.waitForFinished(-1);
|
||||
r.exitCode = command.exitCode();
|
||||
r.output = command.readAllStandardOutput();
|
||||
}
|
||||
else {
|
||||
RootProcess command;
|
||||
QProcess command;
|
||||
command.start(cmd);
|
||||
command.waitForFinished(-1);
|
||||
r.exitCode = command.exitCode();
|
||||
|
2
sources/3rdparty/task/taskadds.h
vendored
2
sources/3rdparty/task/taskadds.h
vendored
@ -40,7 +40,7 @@ struct TaskResult
|
||||
int exitCode;
|
||||
QByteArray output;
|
||||
};
|
||||
TaskResult runTask(const QString cmd, const bool sudo = false);
|
||||
TaskResult runTask(const QString cmd, const bool useSuid = true);
|
||||
|
||||
|
||||
#endif /* TASKADDS_H */
|
||||
|
Reference in New Issue
Block a user