diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-06-22 23:34:33 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-06-22 23:34:33 +0200 |
commit | 929698ff15bdd44a5bd8d8b5c1e13be9c55a1cac (patch) | |
tree | 0539b50931ef14776ac1fea44d7d5e8d5a8f5dee /libmultimc/include/lwjglversionlist.h | |
parent | 3b38e5f92496cb932d14c9a4492292b057d2f431 (diff) | |
download | MultiMC-929698ff15bdd44a5bd8d8b5c1e13be9c55a1cac.tar MultiMC-929698ff15bdd44a5bd8d8b5c1e13be9c55a1cac.tar.gz MultiMC-929698ff15bdd44a5bd8d8b5c1e13be9c55a1cac.tar.lz MultiMC-929698ff15bdd44a5bd8d8b5c1e13be9c55a1cac.tar.xz MultiMC-929698ff15bdd44a5bd8d8b5c1e13be9c55a1cac.zip |
Use shared pointers to fix incompatibility with new Qt
Diffstat (limited to 'libmultimc/include/lwjglversionlist.h')
-rw-r--r-- | libmultimc/include/lwjglversionlist.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libmultimc/include/lwjglversionlist.h b/libmultimc/include/lwjglversionlist.h index 700c93d4..25b5c4c3 100644 --- a/libmultimc/include/lwjglversionlist.h +++ b/libmultimc/include/lwjglversionlist.h @@ -18,7 +18,7 @@ #include <QObject> #include <QAbstractListModel> - +#include <QSharedPointer> #include <QUrl> #include <QNetworkAccessManager> @@ -26,6 +26,9 @@ #include "libmmc_config.h" +class LWJGLVersion; +typedef QSharedPointer<LWJGLVersion> PtrLWJGLVersion; + class LIBMULTIMC_EXPORT LWJGLVersion : public QObject { Q_OBJECT @@ -39,12 +42,15 @@ class LIBMULTIMC_EXPORT LWJGLVersion : public QObject * The URL for this version of LWJGL. */ Q_PROPERTY(QUrl url READ url) -public: + LWJGLVersion(const QString &name, const QUrl &url, QObject *parent = 0) : QObject(parent), m_name(name), m_url(url) { } +public: - LWJGLVersion(const LWJGLVersion &other) : - QObject(other.parent()), m_name(other.name()), m_url(other.url()) { } + static PtrLWJGLVersion Create(const QString &name, const QUrl &url, QObject *parent = 0) + { + return PtrLWJGLVersion(new LWJGLVersion(name, url, parent)); + }; QString name() const { return m_name; } @@ -65,9 +71,9 @@ public: bool isLoaded() { return m_vlist.length() > 0; } - const LWJGLVersion *getVersion(const QString &versionName); - LWJGLVersion &at(int index) { return m_vlist[index]; } - const LWJGLVersion &at(int index) const { return m_vlist[index]; } + const PtrLWJGLVersion getVersion(const QString &versionName); + PtrLWJGLVersion at(int index) { return m_vlist[index]; } + const PtrLWJGLVersion at(int index) const { return m_vlist[index]; } int count() const { return m_vlist.length(); } @@ -104,7 +110,7 @@ signals: void loadListFailed(QString msg); private: - QList<LWJGLVersion> m_vlist; + QList<PtrLWJGLVersion> m_vlist; QNetworkReply *m_netReply; |