mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-09-19 20:34:46 -04:00
Place the 'Recycle Bin' at the bottom of the list when groups are sorted. (#7004)
Co-authored-by: Gaurav Pruthi <gaurav.pruthi@oracle.com>
This commit is contained in:
parent
2514c1d5c5
commit
6c18b10979
1 changed files with 12 additions and 7 deletions
|
@ -1155,13 +1155,18 @@ void Group::applyGroupIconToChildEntries()
|
||||||
|
|
||||||
void Group::sortChildrenRecursively(bool reverse)
|
void Group::sortChildrenRecursively(bool reverse)
|
||||||
{
|
{
|
||||||
std::sort(
|
Group* recycleBin = nullptr;
|
||||||
m_children.begin(), m_children.end(), [reverse](const Group* childGroup1, const Group* childGroup2) -> bool {
|
if (database()) {
|
||||||
QString name1 = childGroup1->name();
|
recycleBin = database()->metadata()->recycleBin();
|
||||||
QString name2 = childGroup2->name();
|
}
|
||||||
return reverse ? name1.compare(name2, Qt::CaseInsensitive) > 0
|
std::sort(m_children.begin(), m_children.end(), [=](const Group* childGroup1, const Group* childGroup2) -> bool {
|
||||||
: name1.compare(name2, Qt::CaseInsensitive) < 0;
|
if (childGroup1 == recycleBin) {
|
||||||
});
|
return false;
|
||||||
|
}
|
||||||
|
QString name1 = childGroup1->name();
|
||||||
|
QString name2 = childGroup2->name();
|
||||||
|
return reverse ? name1.compare(name2, Qt::CaseInsensitive) > 0 : name1.compare(name2, Qt::CaseInsensitive) < 0;
|
||||||
|
});
|
||||||
|
|
||||||
for (auto child : m_children) {
|
for (auto child : m_children) {
|
||||||
child->sortChildrenRecursively(reverse);
|
child->sortChildrenRecursively(reverse);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue