Commit a60c5455 authored by Christoph Cullmann's avatar Christoph Cullmann

avoid deprecated sort algo + use stable sorting

parent 64dc0037
......@@ -31,6 +31,7 @@
#include <QIcon>
#include <QUrl>
#include <algorithm>
#define RETURN_CACHED_ICON(name) \
{ \
......@@ -263,7 +264,7 @@ public:
qCInfo(LSPCLIENT) << "adding completions " << compl.size();
for (const auto & item : compl)
m_matches.push_back(item);
qSort(m_matches.begin(), m_matches.end(), compare_match);
std::stable_sort(m_matches.begin(), m_matches.end(), compare_match);
setRowCount(m_matches.size());
endResetModel();
};
......@@ -283,7 +284,7 @@ public:
m_matches.push_back({item, active, QString(QStringLiteral("%1").arg(sortIndex, 3, 10))});
++index;
}
qSort(m_matches.begin(), m_matches.end(), compare_match);
std::stable_sort(m_matches.begin(), m_matches.end(), compare_match);
setRowCount(m_matches.size());
endResetModel();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment