mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-19 20:24:38 -04:00
Fix entry sorting by title
This commit is contained in:
parent
b16447b13d
commit
e825b55a99
1 changed files with 3 additions and 1 deletions
|
@ -543,7 +543,9 @@ QList<Entry*> BrowserService::sortEntries(QList<Entry*>& pwEntries, const QStrin
|
||||||
// Sort same priority entries by Title or UserName
|
// Sort same priority entries by Title or UserName
|
||||||
auto entries = priorities.values(i);
|
auto entries = priorities.values(i);
|
||||||
std::sort(entries.begin(), entries.end(), [&priorities, &field](Entry* left, Entry* right) {
|
std::sort(entries.begin(), entries.end(), [&priorities, &field](Entry* left, Entry* right) {
|
||||||
return QString::localeAwareCompare(left->attributes()->value(field), right->attributes()->value(field)) < 0;
|
return (QString::localeAwareCompare(left->attributes()->value(field), right->attributes()->value(field)) < 0) ||
|
||||||
|
((QString::localeAwareCompare(left->attributes()->value(field), right->attributes()->value(field)) == 0) &&
|
||||||
|
(QString::localeAwareCompare(left->attributes()->value("UserName"), right->attributes()->value("UserName")) < 0));
|
||||||
});
|
});
|
||||||
results << entries;
|
results << entries;
|
||||||
if (BrowserSettings::bestMatchOnly() && !pwEntries.isEmpty()) {
|
if (BrowserSettings::bestMatchOnly() && !pwEntries.isEmpty()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue