Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
spoiler_background_updater.h
Go to the documentation of this file.
1
6
7#ifndef COCKATRICE_SPOILER_DOWNLOADER_H
8#define COCKATRICE_SPOILER_DOWNLOADER_H
9
10#include <QByteArray>
11#include <QLoggingCategory>
12#include <QObject>
13#include <QString>
14#include <qtmetamacros.h>
15
16class QProcess;
17class QUrl;
18
19inline Q_LOGGING_CATEGORY(SpoilerBackgroundUpdaterLog, "spoiler_background_updater");
20
21class SpoilerBackgroundUpdater : public QObject
22{
23 Q_OBJECT
24public:
25 explicit SpoilerBackgroundUpdater(QObject *apParent = nullptr);
26 inline QString getCardUpdaterBinaryName()
27 {
28 return "oracle";
29 }
30 QByteArray getHash(const QString fileName);
31 QByteArray getHash(QByteArray data);
32 static bool deleteSpoilerFile();
33
34private slots:
37
38private:
41 QByteArray spoilerData;
42 void startSpoilerDownloadProcess(QString url, bool saveResults);
43 void downloadFromURL(QUrl url, bool saveResults);
44 bool saveDownloadedFile(QByteArray data);
45
46signals:
49};
50
51#endif // COCKATRICE_SPOILER_DOWNLOADER_H
static bool deleteSpoilerFile()
Definition spoiler_background_updater.cpp:93
bool isSpoilerDownloadEnabled
Definition spoiler_background_updater.h:39
bool saveDownloadedFile(QByteArray data)
Definition spoiler_background_updater.cpp:144
void downloadFromURL(QUrl url, bool saveResults)
Definition spoiler_background_updater.cpp:57
QString getCardUpdaterBinaryName()
Definition spoiler_background_updater.h:26
void startSpoilerDownloadProcess(QString url, bool saveResults)
Definition spoiler_background_updater.cpp:51
QByteArray getHash(const QString fileName)
Definition spoiler_background_updater.cpp:220
QByteArray spoilerData
Definition spoiler_background_updater.h:41
void actDownloadFinishedSpoilersFile()
Definition spoiler_background_updater.cpp:73
SpoilerBackgroundUpdater(QObject *apParent=nullptr)
Definition spoiler_background_updater.cpp:39
void actCheckIfSpoilerSeasonEnabled()
Definition spoiler_background_updater.cpp:110
QProcess * cardUpdateProcess
Definition spoiler_background_updater.h:40
Q_LOGGING_CATEGORY(CrashReportLog, "crash_report")