NOISSUE remove unused 'INetworkValidator'
This commit is contained in:
parent
f56983e5ca
commit
ff8f495d44
@ -15,15 +15,6 @@ static void readString(const QJsonObject &root, const QString &key, QString &var
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString readStringRet(const QJsonObject &root, const QString &key)
|
|
||||||
{
|
|
||||||
if (root.contains(key))
|
|
||||||
{
|
|
||||||
return requireString(root.value(key));
|
|
||||||
}
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
LibraryPtr OneSixVersionFormat::libraryFromJson(const QJsonObject &libObj, const QString &filename)
|
LibraryPtr OneSixVersionFormat::libraryFromJson(const QJsonObject &libObj, const QString &filename)
|
||||||
{
|
{
|
||||||
LibraryPtr out = MojangVersionFormat::libraryFromJson(libObj, filename);
|
LibraryPtr out = MojangVersionFormat::libraryFromJson(libObj, filename);
|
||||||
|
@ -22,30 +22,6 @@
|
|||||||
|
|
||||||
#include "multimc_logic_export.h"
|
#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;
|
typedef std::shared_ptr<class CacheDownload> CacheDownloadPtr;
|
||||||
class MULTIMC_LOGIC_EXPORT CacheDownload : public NetAction
|
class MULTIMC_LOGIC_EXPORT CacheDownload : public NetAction
|
||||||
{
|
{
|
||||||
@ -54,13 +30,13 @@ private:
|
|||||||
MetaEntryPtr m_entry;
|
MetaEntryPtr m_entry;
|
||||||
/// if saving to file, use the one specified in this string
|
/// if saving to file, use the one specified in this string
|
||||||
QString m_target_path;
|
QString m_target_path;
|
||||||
|
|
||||||
/// this is the output file, if any
|
/// this is the output file, if any
|
||||||
std::shared_ptr<QSaveFile> m_output_file;
|
std::shared_ptr<QSaveFile> m_output_file;
|
||||||
|
|
||||||
/// the hash-as-you-download
|
/// the hash-as-you-download
|
||||||
QCryptographicHash md5sum;
|
QCryptographicHash md5sum;
|
||||||
|
|
||||||
INetworkValidator *m_validator = nullptr;
|
|
||||||
|
|
||||||
bool wroteAnyData = false;
|
bool wroteAnyData = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -74,10 +50,6 @@ public:
|
|||||||
{
|
{
|
||||||
return m_target_path;
|
return m_target_path;
|
||||||
}
|
}
|
||||||
void setValidator(INetworkValidator *validator)
|
|
||||||
{
|
|
||||||
m_validator = validator;
|
|
||||||
}
|
|
||||||
protected
|
protected
|
||||||
slots:
|
slots:
|
||||||
virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||||
|
Loading…
Reference in New Issue
Block a user