summaryrefslogtreecommitdiffstats
path: root/api/logic/net/Download.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-10-28 02:19:19 +0200
committerPetr Mrázek <peterix@gmail.com>2016-10-28 02:19:19 +0200
commitdd0e996081ae820a0f16b5a6854a8a6274c5edf5 (patch)
tree9d9f0ba7ff51b546d15106f71841f9de42a09f2b /api/logic/net/Download.h
parent3d94fb8d24c6012d5d1cdee61c99e62847c06ad9 (diff)
downloadMultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar.gz
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar.lz
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.tar.xz
MultiMC-dd0e996081ae820a0f16b5a6854a8a6274c5edf5.zip
GH-1697 always stale files tolerate errors if a local copy is present
This fixes the situation when liteloader snapshot site is broken and there's an older local snapshot already present.
Diffstat (limited to 'api/logic/net/Download.h')
-rw-r--r--api/logic/net/Download.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/api/logic/net/Download.h b/api/logic/net/Download.h
index fab39ffe..d417f660 100644
--- a/api/logic/net/Download.h
+++ b/api/logic/net/Download.h
@@ -28,14 +28,20 @@ class MULTIMC_LOGIC_EXPORT Download : public NetAction
public: /* types */
typedef std::shared_ptr<class Download> Ptr;
+ enum class Option
+ {
+ NoOptions = 0,
+ AcceptLocalFiles = 1
+ };
+ Q_DECLARE_FLAGS(Options, Option)
protected: /* con/des */
explicit Download();
public:
virtual ~Download(){};
- static Download::Ptr makeCached(QUrl url, MetaEntryPtr entry);
- static Download::Ptr makeByteArray(QUrl url, QByteArray *output);
- static Download::Ptr makeFile(QUrl url, QString path);
+ static Download::Ptr makeCached(QUrl url, MetaEntryPtr entry, Options options = Option::NoOptions);
+ static Download::Ptr makeByteArray(QUrl url, QByteArray *output, Options options = Option::NoOptions);
+ static Download::Ptr makeFile(QUrl url, QString path, Options options = Option::NoOptions);
public: /* methods */
QString getTargetFilepath()
@@ -62,5 +68,8 @@ private: /* data */
// FIXME: remove this, it has no business being here.
QString m_target_path;
std::unique_ptr<Sink> m_sink;
+ Options m_options;
};
-} \ No newline at end of file
+}
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(Net::Download::Options)