summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-03-20 15:52:19 +0100
committerPetr Mrázek <peterix@gmail.com>2016-03-26 17:05:27 +0100
commitff8f495d44bab77044363c0e10deabbb628b492c (patch)
tree836b99029e8d37c838fbf54b5010dde7a8e4a050 /logic
parentf56983e5cad9cc320bb00550ee428f7f55ef5c64 (diff)
downloadMultiMC-ff8f495d44bab77044363c0e10deabbb628b492c.tar
MultiMC-ff8f495d44bab77044363c0e10deabbb628b492c.tar.gz
MultiMC-ff8f495d44bab77044363c0e10deabbb628b492c.tar.lz
MultiMC-ff8f495d44bab77044363c0e10deabbb628b492c.tar.xz
MultiMC-ff8f495d44bab77044363c0e10deabbb628b492c.zip
NOISSUE remove unused 'INetworkValidator'
Diffstat (limited to 'logic')
-rw-r--r--logic/minecraft/onesix/OneSixVersionFormat.cpp9
-rw-r--r--logic/net/CacheDownload.h32
2 files changed, 2 insertions, 39 deletions
diff --git a/logic/minecraft/onesix/OneSixVersionFormat.cpp b/logic/minecraft/onesix/OneSixVersionFormat.cpp
index d4b372c3..b5e05b22 100644
--- a/logic/minecraft/onesix/OneSixVersionFormat.cpp
+++ b/logic/minecraft/onesix/OneSixVersionFormat.cpp
@@ -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 out = MojangVersionFormat::libraryFromJson(libObj, filename);
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);