1
/****************************************************************************
3
* Copyright © 2015, Nicolay Izoderov <nico-izo@ya.ru>.
4
* Licence: GPLv3 or later
6
****************************************************************************
8
* This library is free software; you can redistribute it and/or modify *
9
* it under the terms of the GNU General Public License as published by *
10
* the Free Software Foundation; either version 3 of the License, or *
11
* (at your option) any later version. *
13
****************************************************************************/
15
#ifndef BUILDTRACKER_H
16
#define BUILDTRACKER_H
19
#include <QNetworkAccessManager>
25
* Datetime formatted as yyyy-MM-ddTHH:mm:ss.zzzQQQ+00:00, where QQQ is microseconds
29
* \see https://launchpad.net/+apidoc/1.0.html#build
33
* Can be "Successfully built", or "Failed to build", or many others
34
* \see https://launchpad.net/+apidoc/1.0.html#build
38
QString toString() const {
39
auto dt = QString(datetime);
41
return QString("[%1] \n Статус сборки: %2 \n Ссылка: %3")
48
class BuildTracker : public QObject
53
explicit BuildTracker(QObject *parent = 0);
57
void newBuild(const QString&, const QString&);
59
QString getRepoMessage(const QString &repo);
62
void onReplyFinished(QNetworkReply*);
65
QNetworkAccessManager *netman;
66
QHash<QString, QString> repos;
68
QHash<QString, QDateTime> lastUpdated;
69
QHash<QString, QList<BuildInfo>> builds;
70
QList<BuildInfo> jsonToInfoList(const QByteArray &jsonstr);
73
#endif // BUILDTRACKER_H