mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Add non-const version of Group::groupsRecursive().
This commit is contained in:
parent
835c411d12
commit
33650c4a04
@ -434,6 +434,20 @@ QList<const Group*> Group::groupsRecursive(bool includeSelf) const
|
||||
groupList.append(this);
|
||||
}
|
||||
|
||||
Q_FOREACH (const Group* group, m_children) {
|
||||
groupList.append(group->groupsRecursive(true));
|
||||
}
|
||||
|
||||
return groupList;
|
||||
}
|
||||
|
||||
QList<Group*> Group::groupsRecursive(bool includeSelf)
|
||||
{
|
||||
QList<Group*> groupList;
|
||||
if (includeSelf) {
|
||||
groupList.append(this);
|
||||
}
|
||||
|
||||
Q_FOREACH (Group* group, m_children) {
|
||||
groupList.append(group->groupsRecursive(true));
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ public:
|
||||
const QList<Entry*>& entries() const;
|
||||
QList<Entry*> entriesRecursive(bool includeHistoryItems = false) const;
|
||||
QList<const Group*> groupsRecursive(bool includeSelf) const;
|
||||
QList<Group*> groupsRecursive(bool includeSelf);
|
||||
QSet<Uuid> customIconsRecursive() const;
|
||||
/**
|
||||
* Creates a duplicate of this group including all child entries and groups.
|
||||
|
@ -168,7 +168,7 @@ void EditWidgetIcons::removeCustomIcon()
|
||||
}
|
||||
}
|
||||
|
||||
QList<const Group*> allGroups = m_database->rootGroup()->groupsRecursive(true);
|
||||
QList<Group*> allGroups = m_database->rootGroup()->groupsRecursive(true);
|
||||
Q_FOREACH (const Group* group, allGroups) {
|
||||
if (iconUuid == group->iconUuid() && m_currentUuid != group->uuid()) {
|
||||
iconUsedCount++;
|
||||
|
@ -85,7 +85,10 @@ void EntryModel::setEntryList(const QList<Entry*>& entries)
|
||||
|
||||
Q_FOREACH (Database* db, databases) {
|
||||
Q_ASSERT(db);
|
||||
m_allGroups.append(db->rootGroup()->groupsRecursive(true));
|
||||
Q_FOREACH (const Group* group, db->rootGroup()->groupsRecursive(true)) {
|
||||
m_allGroups.append(group);
|
||||
}
|
||||
|
||||
if (db->metadata()->recycleBin()) {
|
||||
m_allGroups.removeOne(db->metadata()->recycleBin());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user