mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-07 00:56:45 -04:00
Stop using deprecated methods from QtAlgorithms.
This commit is contained in:
parent
a408b01111
commit
5de0ec94e0
4 changed files with 28 additions and 6 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue