summaryrefslogtreecommitdiffstats
path: root/logic/GoUpdate.h
blob: 756a71cff7a6a3d325c90095812d13633c50d5d8 (plain)
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
#pragma once
#include "net/NetJob.h"

class GoUpdate : public QObject
{
	Q_OBJECT

public:
	struct version_channel
	{
		QString id;
		QString name;
		int latestVersion;
	};

	struct version_summary
	{
		int id;
		QString name;
	};

signals:
	void updateAvailable();

private slots:
	void updateCheckFinished();
	void updateCheckFailed();

public:
	GoUpdate();
	void checkForUpdate();
private:
	NetJobPtr index_job;
	NetJobPtr fromto_job;

	QString repoUrlBase;
	QString builderName;
	int currentBuildIndex;
	int newBuildIndex = -1;

	QList<version_summary> versions;
	QList<version_channel> channels;
};