-
Notifications
You must be signed in to change notification settings - Fork 13
/
apkextractiontask.h
99 lines (73 loc) · 2.41 KB
/
apkextractiontask.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef APKEXTRACTIONTASK_H
#define APKEXTRACTIONTASK_H
#include <QThread>
#include <QMutex>
#include <QTemporaryDir>
class VersionManager;
class ApkExtractionTask : public QThread {
Q_OBJECT
Q_PROPERTY(VersionManager* versionManager READ versionManager WRITE setVersionManager)
Q_PROPERTY(QStringList sources READ sources WRITE setSources)
Q_PROPERTY(bool active READ active NOTIFY activeChanged)
Q_PROPERTY(bool allowIncompatible READ allowIncompatible WRITE SetAllowIncompatible)
Q_PROPERTY(QString versionName READ versionName WRITE setVersionName)
Q_PROPERTY(QStringList allowedPackages READ allowedPackages WRITE setAllowedPackages)
QMutex mutex;
QStringList m_sources;
VersionManager* m_versionManager;
bool m_allowIncompatible;
QString m_versionName;
QStringList m_allowedPackages;
void run() override;
void emitActiveChanged() {
emit activeChanged();
}
private slots:
void onVersionInformationObtained(QString const& directory, QString const& versionName, int versionCode);
public:
explicit ApkExtractionTask(QObject *parent = nullptr);
bool active() const { return isRunning(); }
QStringList sources() {
QMutexLocker locker(&mutex);
return m_sources;
}
void setSources(QStringList const& value) {
QMutexLocker locker(&mutex);
m_sources = value;
}
VersionManager* versionManager() {
QMutexLocker locker(&mutex);
return m_versionManager;
}
bool allowIncompatible() {
return m_allowIncompatible;
}
void setVersionManager(VersionManager* value) {
QMutexLocker locker(&mutex);
m_versionManager = value;
}
QString versionName() {
return m_versionName;
}
void setVersionName(QString versionName) {
m_versionName = versionName;
}
QStringList allowedPackages() {
return m_allowedPackages;
}
void setAllowedPackages(QStringList const& value) {
m_allowedPackages = value;
}
public slots:
bool setSourceUrls(QList<QUrl> const& urls);
void SetAllowIncompatible(bool c) {
m_allowIncompatible = c;
}
signals:
void progress(qreal progress);
void versionInformationObtained(QString const& directory, QString const& versionName, int versionCode);
void finished();
void error(QString const& err);
void activeChanged();
};
#endif // APKEXTRACTIONTASK_H