summaryrefslogtreecommitdiffstats
path: root/logic/net/ForgeXzDownload.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-17 11:44:18 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-17 11:44:18 +0100
commit210629e274a08c592d8f38f7b382c1c5a05a7ab1 (patch)
treea32ac2426cf6c45c061c05b347f95f2a68439d5a /logic/net/ForgeXzDownload.h
parent2a45302dfc8d63c627fd1164ef84f434f40bd917 (diff)
downloadMultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar.gz
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar.lz
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.tar.xz
MultiMC-210629e274a08c592d8f38f7b382c1c5a05a7ab1.zip
Use the forge mirrors for downloading forge libraries
Let's hope we never, ever see a forge download error again.
Diffstat (limited to 'logic/net/ForgeXzDownload.h')
-rw-r--r--logic/net/ForgeXzDownload.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/logic/net/ForgeXzDownload.h b/logic/net/ForgeXzDownload.h
index 9f1bb029..990f91f0 100644
--- a/logic/net/ForgeXzDownload.h
+++ b/logic/net/ForgeXzDownload.h
@@ -19,6 +19,8 @@
#include "HttpMetaCache.h"
#include <QFile>
#include <QTemporaryFile>
+#include "ForgeMirror.h"
+
typedef std::shared_ptr<class ForgeXzDownload> ForgeXzDownloadPtr;
class ForgeXzDownload : public NetAction
@@ -26,19 +28,24 @@ class ForgeXzDownload : public NetAction
Q_OBJECT
public:
MetaEntryPtr m_entry;
- /// is the saving file already open?
- bool m_opened_for_saving;
/// if saving to file, use the one specified in this string
QString m_target_path;
/// this is the output file, if any
QTemporaryFile m_pack200_xz_file;
+ /// mirror index (NOT OPTICS, I SWEAR)
+ int m_mirror_index = 0;
+ /// list of mirrors to use. Mirror has the url base
+ QList<ForgeMirror> m_mirrors;
+ /// path relative to the mirror base
+ QString m_url_path;
public:
- explicit ForgeXzDownload(QUrl url, MetaEntryPtr entry);
- static ForgeXzDownloadPtr make(QUrl url, MetaEntryPtr entry)
+ explicit ForgeXzDownload(QString relative_path, MetaEntryPtr entry);
+ static ForgeXzDownloadPtr make(QString relative_path, MetaEntryPtr entry)
{
- return ForgeXzDownloadPtr(new ForgeXzDownload(url, entry));
+ return ForgeXzDownloadPtr(new ForgeXzDownload(relative_path, entry));
}
+ void setMirrors(QList<ForgeMirror> & mirrors);
protected
slots:
@@ -53,4 +60,6 @@ slots:
private:
void decompressAndInstall();
+ void failAndTryNextMirror();
+ void updateUrl();
};