diff options
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(); |