Cockatrice 2026-01-14-Development-2.11.0-beta.46
A cross-platform 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 <QProcess>
14
15inline Q_LOGGING_CATEGORY(SpoilerBackgroundUpdaterLog, "spoiler_background_updater");
16
17class SpoilerBackgroundUpdater : public QObject
18{
19 Q_OBJECT
20public:
21 explicit SpoilerBackgroundUpdater(QObject *apParent = nullptr);
22 inline QString getCardUpdaterBinaryName()
23 {
24 return "oracle";
25 }
26 QByteArray getHash(const QString fileName);
27 QByteArray getHash(QByteArray data);
28 static bool deleteSpoilerFile();
29
30private slots:
33
34private:
37 QByteArray spoilerData;
38 void startSpoilerDownloadProcess(QString url, bool saveResults);
39 void downloadFromURL(QUrl url, bool saveResults);
40 bool saveDownloadedFile(QByteArray data);
41
42signals:
45};
46
47#endif // COCKATRICE_SPOILER_DOWNLOADER_H
static bool deleteSpoilerFile()
Definition spoiler_background_updater.cpp:76
bool isSpoilerDownloadEnabled
Definition spoiler_background_updater.h:35
bool saveDownloadedFile(QByteArray data)
Definition spoiler_background_updater.cpp:127
void downloadFromURL(QUrl url, bool saveResults)
Definition spoiler_background_updater.cpp:40
QString getCardUpdaterBinaryName()
Definition spoiler_background_updater.h:22
void startSpoilerDownloadProcess(QString url, bool saveResults)
Definition spoiler_background_updater.cpp:34
QByteArray getHash(const QString fileName)
Definition spoiler_background_updater.cpp:195
QByteArray spoilerData
Definition spoiler_background_updater.h:37
void actDownloadFinishedSpoilersFile()
Definition spoiler_background_updater.cpp:56
SpoilerBackgroundUpdater(QObject *apParent=nullptr)
Definition spoiler_background_updater.cpp:22
void actCheckIfSpoilerSeasonEnabled()
Definition spoiler_background_updater.cpp:93
QProcess * cardUpdateProcess
Definition spoiler_background_updater.h:36
Q_LOGGING_CATEGORY(SpoilerBackgroundUpdaterLog, "spoiler_background_updater")