Only load instance list twice.
This commit is contained in:
parent
583786757a
commit
9022042360
@ -60,10 +60,15 @@ bool cmpVersions(BaseVersionPtr first, BaseVersionPtr second)
|
|||||||
return left->timestamp > right->timestamp;
|
return left->timestamp > right->timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MinecraftVersionList::sortInternal()
|
||||||
|
{
|
||||||
|
qSort(m_vlist.begin(), m_vlist.end(), cmpVersions);
|
||||||
|
}
|
||||||
|
|
||||||
void MinecraftVersionList::sort()
|
void MinecraftVersionList::sort()
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
qSort(m_vlist.begin(), m_vlist.end(), cmpVersions);
|
sortInternal();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,9 +90,8 @@ void MinecraftVersionList::updateListData(QList<BaseVersionPtr> versions)
|
|||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_vlist = versions;
|
m_vlist = versions;
|
||||||
m_loaded = true;
|
m_loaded = true;
|
||||||
|
sortInternal();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
// NOW SORT!!
|
|
||||||
sort();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QDomElement getDomElementByTagName(QDomElement parent, QString tagname)
|
inline QDomElement getDomElementByTagName(QDomElement parent, QString tagname)
|
||||||
|
@ -29,6 +29,8 @@ class QNetworkReply;
|
|||||||
class MinecraftVersionList : public BaseVersionList
|
class MinecraftVersionList : public BaseVersionList
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
void sortInternal();
|
||||||
public:
|
public:
|
||||||
friend class MCVListLoadTask;
|
friend class MCVListLoadTask;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user