summaryrefslogtreecommitdiffstats
path: root/libmultimc/include/gameupdatetask.h
diff options
context:
space:
mode:
authorTakSuyu <taksuyu@gmail.com>2013-07-27 12:55:51 -0700
committerTakSuyu <taksuyu@gmail.com>2013-07-27 12:55:51 -0700
commitdc39d093396c9a0ed4f03d81f95fcc8fa5705b65 (patch)
treeb88bf5fa692de82ce3418bdf5c55e9cd9eff37bc /libmultimc/include/gameupdatetask.h
parent44498f98945b7501486da35c5fdc32f94a2be080 (diff)
parenta7a84d4dbb58565f108cb0886da6cb786e34d10d (diff)
downloadMultiMC-dc39d093396c9a0ed4f03d81f95fcc8fa5705b65.tar
MultiMC-dc39d093396c9a0ed4f03d81f95fcc8fa5705b65.tar.gz
MultiMC-dc39d093396c9a0ed4f03d81f95fcc8fa5705b65.tar.lz
MultiMC-dc39d093396c9a0ed4f03d81f95fcc8fa5705b65.tar.xz
MultiMC-dc39d093396c9a0ed4f03d81f95fcc8fa5705b65.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: gui/mainwindow.cpp
Diffstat (limited to 'libmultimc/include/gameupdatetask.h')
-rw-r--r--libmultimc/include/gameupdatetask.h75
1 files changed, 22 insertions, 53 deletions
diff --git a/libmultimc/include/gameupdatetask.h b/libmultimc/include/gameupdatetask.h
index c3f84356..b56c448b 100644
--- a/libmultimc/include/gameupdatetask.h
+++ b/libmultimc/include/gameupdatetask.h
@@ -22,47 +22,15 @@
#include <QNetworkAccessManager>
#include <QUrl>
+#include "dlqueue.h"
#include "task.h"
#include "loginresponse.h"
#include "instance.h"
#include "libmmc_config.h"
-class FileToDownload;
-typedef QSharedPointer<FileToDownload> FileToDownloadPtr;
-
-class FileToDownload : public QObject
-{
- Q_OBJECT
-
- /*!
- * The URL to download the file from.
- */
- Q_PROPERTY(QUrl url READ url WRITE setURL)
-
- /*!
- * The path to download to.
- * This path is relative to the instance's root directory.
- */
- Q_PROPERTY(QString path READ path WRITE setPath)
-
-private:
- FileToDownload(const QUrl &url, const QString &path, QObject *parent = 0);
-public:
- static FileToDownloadPtr Create(const QUrl &url, const QString &path, QObject *parent = 0);
-
- virtual QUrl url() const { return m_dlURL; }
- virtual void setURL(const QUrl &url) { m_dlURL = url; }
-
- virtual QString path() const { return m_dlPath; }
- virtual void setPath(const QString &path) { m_dlPath = path; }
-
-private:
- QUrl m_dlURL;
- QString m_dlPath;
-};
-
+class MinecraftVersion;
/*!
* The game update task is the task that handles downloading instances' files.
@@ -92,9 +60,6 @@ public:
virtual void executeTask();
- virtual bool downloadFile(const FileToDownloadPtr file);
-
-
//////////////////////
// STATE AND STATUS //
//////////////////////
@@ -110,6 +75,10 @@ public:
*/
virtual QString getStateMessage(int state);
+private:
+ void getLegacyJar();
+ void determineNewVersion();
+
public slots:
/*!
@@ -122,7 +91,15 @@ public slots:
private slots:
- virtual void updateDownloadProgress(qint64 current, qint64 total);
+ void updateDownloadProgress(qint64 current, qint64 total);
+ void legacyJarFinished();
+ void legacyJarFailed();
+
+ void versionFileFinished();
+ void versionFileFailed();
+
+ void jarlibFinished();
+ void jarlibFailed();
signals:
/*!
@@ -143,23 +120,8 @@ private:
///////////
Instance *m_inst;
-
LoginResponse m_response;
- QNetworkAccessManager *netMgr;
-
-
-
- ////////////////////////
- // FILE DOWNLOAD LIST //
- ////////////////////////
-
- // List of URLs that the game updater will need to download.
- QList<FileToDownloadPtr> m_downloadList;
- int m_currentDownload;
-
-
-
////////////////////////////
// STATE AND STATUS STUFF //
////////////////////////////
@@ -184,6 +146,13 @@ private:
// Finished
StateFinished
};
+ JobListPtr legacyDownloadJob;
+ JobListPtr specificVersionDownloadJob;
+ JobListPtr jarlibDownloadJob;
+ JobListQueue download_queue;
+
+ // target version, determined during this task
+ MinecraftVersion *targetVersion;
};