enh(cpn): Cloudbuild support - phase 1 (#4856)
This commit is contained in:
@@ -21,12 +21,17 @@
|
||||
|
||||
#include "repo.h"
|
||||
|
||||
Repo::Repo(QObject * parent, UpdateStatus * status, UpdateNetwork * network) :
|
||||
Repo::Repo(QObject * parent, UpdateStatus * status, UpdateNetwork * network,
|
||||
const QString & path, const QString & nightly, const int resultsPerPage) :
|
||||
QObject(parent),
|
||||
m_status(status),
|
||||
m_network(network),
|
||||
m_releases(new RepoReleases(this, status, network)),
|
||||
m_assets(new RepoAssets(this, status, network))
|
||||
m_assets(new RepoAssets(this, status, network)),
|
||||
m_path(path),
|
||||
m_nightly(nightly),
|
||||
m_resultsPerPage(resultsPerPage),
|
||||
m_config(nullptr)
|
||||
{
|
||||
connect(m_releases, &RepoReleases::idChanged, [=](const int id) {
|
||||
m_assets->onReleaseIdChanged(id);
|
||||
@@ -37,11 +42,13 @@ Repo::~Repo()
|
||||
{
|
||||
delete m_assets;
|
||||
delete m_releases;
|
||||
if (m_config)
|
||||
delete m_config;
|
||||
}
|
||||
|
||||
bool Repo::getJson(const QString filename, QJsonDocument * json)
|
||||
{
|
||||
m_network->downloadJsonContent(m_releases->urlContent(filename), json);
|
||||
m_network->downloadJsonContent(urlContent(filename), json);
|
||||
|
||||
if (!m_network->isSuccess()) {
|
||||
m_status->reportProgress("Unable to download json data", QtDebugMsg);
|
||||
@@ -51,9 +58,10 @@ bool Repo::getJson(const QString filename, QJsonDocument * json)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Repo::init(const QString & repoPath, const QString & nightly, const int resultsPerPage)
|
||||
void Repo::setConfig(const QJsonObject & config)
|
||||
{
|
||||
m_path = repoPath;
|
||||
m_releases->init(repoPath, nightly, resultsPerPage);
|
||||
m_assets->init(repoPath, QString(), resultsPerPage);
|
||||
if (m_config)
|
||||
delete m_config;
|
||||
|
||||
m_config = new QJsonObject(config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user