1
0
Fork 0
mirror of https://github.com/eliboa/TegraRcmGUI.git synced 2024-11-24 19:22:04 +00:00
TegraRcmGUI/update_manager/github_api.h

35 lines
675 B
C
Raw Permalink Normal View History

2020-12-11 11:46:53 +00:00
#ifndef GITH_API_H
#define GITH_API_H
#include <QtNetwork>
#include <QtCore>
#define GITH_API_URL "https://api.github.com"
class GitHubAPI: public QObject
{
Q_OBJECT
public:
explicit GitHubAPI(QObject *parent = nullptr);
bool GET_sync(const QString &endpoint);
bool getLatestRelease(const QString &owner, const QString &repo, QString *latest_release);
private:
QNetworkAccessManager manager;
bool waitForConnect(int nTimeOutms);
protected:
QNetworkReply *m_pReply;
QNetworkReply::NetworkError m_NetworkError;
bool m_bReadTimeOut = false;
private slots:
void slotWaitTimeout();
signals:
void signalReadTimeout();
};
#endif