Stop using deprecated methods from QtAlgorithms.

This commit is contained in:
Felix Geyer 2015-10-13 22:52:07 +02:00
parent a408b01111
commit 5de0ec94e0
4 changed files with 28 additions and 6 deletions

View file

@ -20,6 +20,8 @@
#include "core/Entry.h"
#include "core/Tools.h"
#include <algorithm>
EntryAttributesModel::EntryAttributesModel(QObject* parent)
: QAbstractListModel(parent)
, m_entryAttributes(nullptr)
@ -152,7 +154,7 @@ void EntryAttributesModel::attributeAboutToAdd(const QString& key)
{
QList<QString> rows = m_attributes;
rows.append(key);
qSort(rows);
std::sort(rows.begin(), rows.end());
int row = rows.indexOf(key);
beginInsertRows(QModelIndex(), row, row);
}
@ -182,7 +184,7 @@ void EntryAttributesModel::attributeAboutToRename(const QString& oldKey, const Q
QList<QString> rows = m_attributes;
rows.removeOne(oldKey);
rows.append(newKey);
qSort(rows);
std::sort(rows.begin(), rows.end());
int newRow = rows.indexOf(newKey);
if (newRow > oldRow) {
newRow++;