summaryrefslogtreecommitdiffstats
path: root/logic/net/CacheDownload.h
diff options
context:
space:
mode:
Diffstat (limited to 'logic/net/CacheDownload.h')
-rw-r--r--logic/net/CacheDownload.h32
1 files changed, 2 insertions, 30 deletions
diff --git a/logic/net/CacheDownload.h b/logic/net/CacheDownload.h
index f640b740..8eea66f9 100644
--- a/logic/net/CacheDownload.h
+++ b/logic/net/CacheDownload.h
@@ -22,30 +22,6 @@
#include "multimc_logic_export.h"
-/* FIXME: move to its own file(s) */
-class MULTIMC_LOGIC_EXPORT INetworkValidator
-{
-public:
- virtual ~INetworkValidator() {}
-
- virtual void validate(const QByteArray &data) = 0;
-};
-class MULTIMC_LOGIC_EXPORT JsonValidator : public INetworkValidator
-{
-public:
- void validate(const QByteArray &data) override;
-};
-class MULTIMC_LOGIC_EXPORT MD5HashValidator : public INetworkValidator
-{
-public:
- explicit MD5HashValidator(const QByteArray &expected)
- : m_expected(expected) {}
- void validate(const QByteArray &data) override;
-
-private:
- QByteArray m_expected;
-};
-
typedef std::shared_ptr<class CacheDownload> CacheDownloadPtr;
class MULTIMC_LOGIC_EXPORT CacheDownload : public NetAction
{
@@ -54,13 +30,13 @@ private:
MetaEntryPtr m_entry;
/// if saving to file, use the one specified in this string
QString m_target_path;
+
/// this is the output file, if any
std::shared_ptr<QSaveFile> m_output_file;
+
/// the hash-as-you-download
QCryptographicHash md5sum;
- INetworkValidator *m_validator = nullptr;
-
bool wroteAnyData = false;
public:
@@ -74,10 +50,6 @@ public:
{
return m_target_path;
}
- void setValidator(INetworkValidator *validator)
- {
- m_validator = validator;
- }
protected
slots:
virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);