summaryrefslogtreecommitdiffstats
path: root/logic/lists/MinecraftVersionList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/lists/MinecraftVersionList.cpp')
-rw-r--r--logic/lists/MinecraftVersionList.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/logic/lists/MinecraftVersionList.cpp b/logic/lists/MinecraftVersionList.cpp
index 91f86df0..ece31e3d 100644
--- a/logic/lists/MinecraftVersionList.cpp
+++ b/logic/lists/MinecraftVersionList.cpp
@@ -60,10 +60,15 @@ bool cmpVersions(BaseVersionPtr first, BaseVersionPtr second)
return left->timestamp > right->timestamp;
}
+void MinecraftVersionList::sortInternal()
+{
+ qSort(m_vlist.begin(), m_vlist.end(), cmpVersions);
+}
+
void MinecraftVersionList::sort()
{
beginResetModel();
- qSort(m_vlist.begin(), m_vlist.end(), cmpVersions);
+ sortInternal();
endResetModel();
}
@@ -85,9 +90,8 @@ void MinecraftVersionList::updateListData(QList<BaseVersionPtr> versions)
beginResetModel();
m_vlist = versions;
m_loaded = true;
+ sortInternal();
endResetModel();
- // NOW SORT!!
- sort();
}
inline QDomElement getDomElementByTagName(QDomElement parent, QString tagname)