summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/legacy/LwjglVersionList.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-11-27 01:43:20 +0100
committerPetr Mrázek <peterix@gmail.com>2016-11-27 01:45:55 +0100
commit4ca6878743119647213ae02d9a9bb1a410768110 (patch)
tree8452b9327fdad1107534b5f09b55f147a2f61f7f /api/logic/minecraft/legacy/LwjglVersionList.h
parentef73a2bd322c7df43922cd4b4ed4f49440b1b92f (diff)
downloadMultiMC-4ca6878743119647213ae02d9a9bb1a410768110.tar
MultiMC-4ca6878743119647213ae02d9a9bb1a410768110.tar.gz
MultiMC-4ca6878743119647213ae02d9a9bb1a410768110.tar.lz
MultiMC-4ca6878743119647213ae02d9a9bb1a410768110.tar.xz
MultiMC-4ca6878743119647213ae02d9a9bb1a410768110.zip
GH-1670 Fix LWJGL list loading
Now it uses the standard Download class that supports redirects and SSL.
Diffstat (limited to 'api/logic/minecraft/legacy/LwjglVersionList.h')
-rw-r--r--api/logic/minecraft/legacy/LwjglVersionList.h58
1 files changed, 9 insertions, 49 deletions
diff --git a/api/logic/minecraft/legacy/LwjglVersionList.h b/api/logic/minecraft/legacy/LwjglVersionList.h
index f043f6e2..784e0b2e 100644
--- a/api/logic/minecraft/legacy/LwjglVersionList.h
+++ b/api/logic/minecraft/legacy/LwjglVersionList.h
@@ -25,6 +25,7 @@
#include "BaseVersionList.h"
#include "multimc_logic_export.h"
+#include <net/NetJob.h>
class LWJGLVersion;
typedef std::shared_ptr<LWJGLVersion> PtrLWJGLVersion;
@@ -99,58 +100,17 @@ public:
}
virtual int columnCount(const QModelIndex &parent) const override;
- virtual bool isLoading() const;
- virtual bool errored() const
- {
- return m_errored;
- }
-
- virtual QString lastErrorMsg() const
- {
- return m_lastErrorMsg;
- }
-
-public
-slots:
- /*!
- * Loads the version list.
- * This is done asynchronously. On success, the loadListFinished() signal will
- * be emitted. The list model will be reset as well, resulting in the modelReset()
- * signal being emitted. Note that the model will be reset before loadListFinished() is
- * emitted.
- * If loading the list failed, the loadListFailed(QString msg),
- * signal will be emitted.
- */
+public slots:
virtual void loadList();
-signals:
- /*!
- * Emitted when the list either starts or finishes loading.
- * \param loading Whether or not the list is loading.
- */
- void loadingStateUpdated(bool loading);
-
- void loadListFinished();
-
- void loadListFailed(QString msg);
+private slots:
+ void rssFailed(const QString & reason);
+ void rssSucceeded();
private:
QList<PtrLWJGLVersion> m_vlist;
-
- QNetworkReply *m_netReply;
- QNetworkReply *reply;
-
- bool m_loading;
- bool m_errored;
- QString m_lastErrorMsg;
-
- void failed(QString msg);
-
- void finished();
-
- void setLoading(bool loading);
-
-private
-slots:
- virtual void netRequestComplete();
+ Net::Download::Ptr m_rssDL;
+ NetJobPtr m_rssDLJob;
+ QByteArray m_rssData;
+ bool m_loading = false;
};