-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtask.h
56 lines (43 loc) · 1.17 KB
/
runtask.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright 2017 Sinodun Internet Technologies Ltd.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef RUNTASK_H
#define RUNTASK_H
#include <Security/Authorization.h>
#include <QObject>
#include <QProcess>
class StubbyManager;
class RunTask : public QProcess
{
Q_OBJECT
public:
RunTask(const QString command, QObject *parent = 0);
virtual ~RunTask();
void start();
private:
QString m_command;
};
class RunHelperTask : public QProcess
{
Q_OBJECT
public:
RunHelperTask(const QString command, QString need_right = QString(), const QString config = QString(), QObject *parent = 0, StubbyManager *manager = 0);
virtual ~RunHelperTask();
int execute();
void start();
static const char *RIGHT_DAEMON_RUN;
static const char *RIGHT_DNS_LOCAL;
private:
QString makeCommandLine();
QString makeExternalAuth();
QString m_command;
QString m_need_right;
QString m_config;
StubbyManager *m_manager;
AuthorizationRef m_auth_ref;
};
#endif // RUNTASK_H