diff options
| author | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
|---|---|---|
| committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
| commit | 795889d934e8f4ebe89be1a49a3417fd98e89be1 (patch) | |
| tree | c5b0d30d425003c4b88e84a2908e63eb5ed797b9 | |
| parent | 160b5033a79e6b5ee9f3e2a001b96c677f41ddcb (diff) | |
| parent | 8e58d61150b0bdbe9eb91065d36342f3004fe97b (diff) | |
| download | PrismLauncher-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.gz PrismLauncher-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.bz2 PrismLauncher-795889d934e8f4ebe89be1a49a3417fd98e89be1.zip | |
Merge branch 'feature/meta' into develop
115 files changed, 1850 insertions, 6356 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d3dcac78..86f8e20a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,4 +109,3 @@ add_subdirectory(api/logic) add_subdirectory(api/gui) add_subdirectory(application) -add_subdirectory(wonkoclient) diff --git a/api/logic/BaseInstance.cpp b/api/logic/BaseInstance.cpp index 6d719c32..ee9e919d 100644 --- a/api/logic/BaseInstance.cpp +++ b/api/logic/BaseInstance.cpp @@ -23,7 +23,6 @@ #include "settings/Setting.h" #include "settings/OverrideSetting.h" -#include "minecraft/MinecraftVersionList.h" #include "FileSystem.h" #include "Commandline.h" diff --git a/api/logic/BaseVersionList.cpp b/api/logic/BaseVersionList.cpp index 5ad4df3c..8b424c11 100644 --- a/api/logic/BaseVersionList.cpp +++ b/api/logic/BaseVersionList.cpp @@ -30,7 +30,7 @@ BaseVersionPtr BaseVersionList::findVersion(const QString &descriptor) return BaseVersionPtr(); } -BaseVersionPtr BaseVersionList::getLatestStable() const +BaseVersionPtr BaseVersionList::getRecommended() const { if (count() <= 0) return BaseVersionPtr(); @@ -38,11 +38,6 @@ BaseVersionPtr BaseVersionList::getLatestStable() const return at(0); } -BaseVersionPtr BaseVersionList::getRecommended() const -{ - return getLatestStable(); -} - QVariant BaseVersionList::data(const QModelIndex &index, int role) const { if (!index.isValid()) @@ -93,7 +88,7 @@ QHash<int, QByteArray> BaseVersionList::roleNames() const QHash<int, QByteArray> roles = QAbstractListModel::roleNames(); roles.insert(VersionRole, "version"); roles.insert(VersionIdRole, "versionId"); - roles.insert(ParentGameVersionRole, "parentGameVersion"); + roles.insert(ParentVersionRole, "parentGameVersion"); roles.insert(RecommendedRole, "recommended"); roles.insert(LatestRole, "latest"); roles.insert(TypeRole, "type"); diff --git a/api/logic/BaseVersionList.h b/api/logic/BaseVersionList.h index eadc6933..655bbd43 100644 --- a/api/logic/BaseVersionList.h +++ b/api/logic/BaseVersionList.h @@ -22,6 +22,7 @@ #include "BaseVersion.h" #include "tasks/Task.h" #include "multimc_logic_export.h" +#include "QObjectPtr.h" /*! * \brief Class that each instance type's version list derives from. @@ -44,7 +45,7 @@ public: VersionPointerRole = Qt::UserRole, VersionRole, VersionIdRole, - ParentGameVersionRole, + ParentVersionRole, RecommendedRole, LatestRole, TypeRole, @@ -63,7 +64,7 @@ public: * The task returned by this function should reset the model when it's done. * \return A pointer to a task that reloads the version list. */ - virtual Task *getLoadTask() = 0; + virtual shared_qobject_ptr<Task> getLoadTask() = 0; //! Checks whether or not the list is loaded. If this returns false, the list should be //loaded. @@ -76,28 +77,23 @@ public: virtual int count() const = 0; //////// List Model Functions //////// - virtual QVariant data(const QModelIndex &index, int role) const; - virtual int rowCount(const QModelIndex &parent) const; - virtual int columnCount(const QModelIndex &parent) const; - virtual QHash<int, QByteArray> roleNames() const override; + QVariant data(const QModelIndex &index, int role) const override; + int rowCount(const QModelIndex &parent) const override; + int columnCount(const QModelIndex &parent) const override; + virtual QHash<int, QByteArray> roleNames() const; //! which roles are provided by this version list? virtual RoleList providesRoles() const; /*! * \brief Finds a version by its descriptor. - * \param The descriptor of the version to find. + * \param descriptor The descriptor of the version to find. * \return A const pointer to the version with the given descriptor. NULL if * one doesn't exist. */ virtual BaseVersionPtr findVersion(const QString &descriptor); < |
