-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkgquery.h
46 lines (33 loc) · 883 Bytes
/
pkgquery.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
#ifndef PKGQUERY_H
#define PKGQUERY_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
// Json
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QJsonParseError>
#include <QEventLoop>
#include <QDateTime>
#include <QDebug>
#include "pkginfo.h"
class PkgQuery : public QObject
{
Q_OBJECT
public:
explicit PkgQuery(const QString& pkgname, QObject *parent = nullptr);
PkgInfo queryPkg();
PkgInfo queryPkgInOfficial();
PkgInfo queryPkgInAUR();
private:
const QString urlPathPrefix = "https://aur.archlinux.org";
const QString aurPrefix_tuna = "https://aur.tuna.tsinghua.edu.cn";
const QString aurPrefix = "https://aur.archlinux.org/packages/";
QString m_pkgname;
QNetworkAccessManager manager;
signals:
};
#endif // PKGQUERY_H