-
Notifications
You must be signed in to change notification settings - Fork 13
/
troubleshooter.h
52 lines (40 loc) · 1.2 KB
/
troubleshooter.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
#ifndef TROUBLESHOOTER_H
#define TROUBLESHOOTER_H
#include <QObject>
class TroubleshooterIssue : public QObject {
Q_OBJECT
Q_PROPERTY(QString shortDesc MEMBER shortDesc CONSTANT)
Q_PROPERTY(QString longDesc MEMBER longDesc CONSTANT)
Q_PROPERTY(QString wikiUrl MEMBER wikiUrl CONSTANT)
public:
enum Type {
TYPE_LAUNCHER_NOT_FOUND,
TYPE_LAUNCHER_VERSION_QUERY_FAILED,
TYPE_LAUNCHER_SOFTWARE_RENDERER,
TYPE_LAUNCHER_MSA_NOT_FOUND,
TYPE_LAUNCHER_ZENITY_NOT_FOUND
};
Q_ENUM(Type)
private:
Type type;
QString shortDesc;
QString longDesc;
QString wikiUrl;
public:
explicit TroubleshooterIssue(Type type, QString shortDesc, QString longDesc, QObject *parent = nullptr) :
QObject(parent), type(type), shortDesc(shortDesc), longDesc(longDesc) {}
TroubleshooterIssue* addWikiUrl(QString wikiUrl) {
this->wikiUrl = std::move(wikiUrl);
return this;
}
};
class Troubleshooter : public QObject {
Q_OBJECT
public:
explicit Troubleshooter(QObject *parent = nullptr);
public slots:
QList<QObject*> findIssues();
private:
void findLauncherIssues(QList<QObject*>& ret);
};
#endif // TROUBLESHOOTER_H