-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithubapi.h
More file actions
35 lines (27 loc) · 746 Bytes
/
githubapi.h
File metadata and controls
35 lines (27 loc) · 746 Bytes
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
#ifndef GITHUBAPI_H
#define GITHUBAPI_H
#include <QObject>
#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QString>
class GitHubApi : public QObject
{
Q_OBJECT
public:
GitHubApi(const QString& owner, const QString& repo, QObject* parent = nullptr);
void fetchLatestReleaseTag(QWidget* parent = nullptr);
QString returnReleaseTag();
private slots:
void onRequestFinished(QNetworkReply* reply);
void extractReleaseTag(const QJsonObject& jsonObject);
private:
QString owner_;
QString repo_;
QNetworkAccessManager networkManager_;
QWidget* parent_; // Store the parent widget
QString releaseTag;
signals:
void requestFinished();
};
#endif // GITHUBAPI_H