4#ifndef __KISSUPPORTERBUNDLESFETCHER_H_
5#define __KISSUPPORTERBUNDLESFETCHER_H_
45 static constexpr char BASE_URL[] =
"https://cdn.kde.org/krita/.android-supporters-extra/supporterbundles/";
52 void fetchIndexDb(
unsigned int expectedVersion,
const QString &expectedHash);
54 void handleIndexDbFetched(QNetworkReply *reply,
unsigned int expectedVersion,
const QString &expectedHash);
58 QNetworkReply *
fetch(
const QString &path);
64 bool doWithIndexDb(QString &outErrorMessage,
const std::function<
bool(QSqlDatabase &, QString &)> &block);
Network Access Manager for use with Krita.
void emitIndexDbFetchFailed(const QString &errorMessage)
KisNetworkAccessManager * m_nam
void emitFailure(const QString &errorMessage)
QNetworkReply * fetch(const QString &path)
bool doWithIndexDb(QString &outErrorMessage, const std::function< bool(QSqlDatabase &, QString &)> &block)
bool checkExistingIndexDb(unsigned int expectedVersion, const QString &expectedHash)
QNetworkReply * fetchBundle(const KisSupporterBundle &bundle)
void emitCheckTxtFetchFailed(const QString &errorMessage)
static constexpr char BASE_URL[]
void handleCheckTxtFetched(QNetworkReply *reply)
void handleIndexDbFetched(QNetworkReply *reply, unsigned int expectedVersion, const QString &expectedHash)
static bool hasNetworkReplyError(QNetworkReply *reply, QString &outErrorMessage)
QVector< KisSupporterBundle > m_bundles
void fetchIndexDone(bool success, const QString &errorMessage)
KisSupporterBundlesFetcher(QObject *parent=nullptr)
void readIndexDbBundles()
void fetchIndexDb(unsigned int expectedVersion, const QString &expectedHash)
const QVector< KisSupporterBundle > & bundles() const
static bool readSqliteUserVersion(const QByteArray &bytes, unsigned int &outVersion)
bool handleCheckTxtPredefinedFailure(const QString &content)