diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-02 12:44:37 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-02 12:44:37 +0200 |
commit | 4fc4a172562a76091721b8c488aafbd6ed2b01ed (patch) | |
tree | 618f1f0cb5e2308289178f2398550962f9eed2cd /logic/minecraft/MinecraftVersionList.cpp | |
parent | bb01c91469e3c5cbb250ce47c2d40f00f8be0c0a (diff) | |
download | MultiMC-4fc4a172562a76091721b8c488aafbd6ed2b01ed.tar MultiMC-4fc4a172562a76091721b8c488aafbd6ed2b01ed.tar.gz MultiMC-4fc4a172562a76091721b8c488aafbd6ed2b01ed.tar.lz MultiMC-4fc4a172562a76091721b8c488aafbd6ed2b01ed.tar.xz MultiMC-4fc4a172562a76091721b8c488aafbd6ed2b01ed.zip |
NOISSUE handle recommended versions better
Moved constants to the version data file
Use recommended Minecraft instead of latest stable for new instances by default
Diffstat (limited to 'logic/minecraft/MinecraftVersionList.cpp')
-rw-r--r-- | logic/minecraft/MinecraftVersionList.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/logic/minecraft/MinecraftVersionList.cpp b/logic/minecraft/MinecraftVersionList.cpp index f57478e3..5f29bfec 100644 --- a/logic/minecraft/MinecraftVersionList.cpp +++ b/logic/minecraft/MinecraftVersionList.cpp @@ -364,7 +364,7 @@ QVariant MinecraftVersionList::data(const QModelIndex& index, int role) const return version->descriptor(); case RecommendedRole: - return version->descriptor() == "1.7.10"; + return version->descriptor() == g_VersionFilterData.recommendedMinecraftVersion; case TypeRole: return version->typeString(); @@ -386,6 +386,19 @@ BaseVersionPtr MinecraftVersionList::getLatestStable() const return BaseVersionPtr(); } +BaseVersionPtr MinecraftVersionList::getRecommended() const +{ + for(auto item: m_vlist) + { + auto version = std::dynamic_pointer_cast<MinecraftVersion>(item); + if(version->descriptor() == g_VersionFilterData.recommendedMinecraftVersion) + { + return item; + } + } + return getLatestStable(); +} + void MinecraftVersionList::updateListData(QList<BaseVersionPtr> versions) { beginResetModel(); |