mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-28 04:46:54 -08:00
Stop using deprecated methods from QtAlgorithms.
This commit is contained in:
1 parent
a408b01111
commit
5de0ec94e0
4 files changed
+28
-6
No files matched your search
@@ -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++;
|
||||
|
||||
Reference in new issue
Block a user