-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetchingtimeoutmanager.h
54 lines (43 loc) · 1.15 KB
/
fetchingtimeoutmanager.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
53
54
#ifndef FETCHINGTIMEOUTMANAGER_H
#define FETCHINGTIMEOUTMANAGER_H
#include <QObject>
#include <QTimer>
namespace JenkinsCI
{
namespace Internal
{
/*!
* \brief The FetchingTimeoutManager class schedules views and job fetching process. It syncronize
* all avaliable Jenkins fetchers.
* Typical flow is to fetch avaliable views and then, if user selected view is present is fetched
* ones, fetch avaliable jobs for selected view. It use timer for continious fetch triggering.
*/
class FetchingTimeoutManager : public QObject
{
Q_OBJECT
public:
enum class FetchType
{
NormalJobFetching,
ForcedJobFetching
};
explicit FetchingTimeoutManager(QObject *parent = 0);
bool isViewsFetched() const;
void setIsViewsFetched(bool isViewsFetched);
void triggerFetching(FetchType fetchType);
signals:
void viewUpdateRequested();
void jobDataUpdateRequested();
void jobForcedUpdateRequested();
public slots:
void startTimer();
private slots:
void processTimeout();
private:
QTimer *_timer;
bool _isViewsFetched{false};
bool _forcedJobUpdateRequested{false};
};
}
}
#endif // FETCHINGTIMEOUTMANAGER_H