mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-04 17:05:23 -05:00
Pass entryFlags to clone() when recursing into sub-groups.
Based on https://github.com/keepassx/keepassx/pull/178 by Mois Moshev <mois@monomon.me> Closes #525
This commit is contained in:
parent
595b1011dd
commit
1635a5211f
@ -504,7 +504,7 @@ Group* Group::clone(Entry::CloneFlags entryFlags) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Q_FOREACH (Group* groupChild, children()) {
|
Q_FOREACH (Group* groupChild, children()) {
|
||||||
Group* clonedGroupChild = groupChild->clone();
|
Group* clonedGroupChild = groupChild->clone(entryFlags);
|
||||||
clonedGroupChild->setParent(clonedGroup);
|
clonedGroupChild->setParent(clonedGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,12 @@ void TestGroup::testClone()
|
|||||||
QVERIFY(clonedSubGroupEntry->uuid() != subGroupEntry->uuid());
|
QVERIFY(clonedSubGroupEntry->uuid() != subGroupEntry->uuid());
|
||||||
QCOMPARE(clonedSubGroupEntry->title(), QString("SubGroupEntry"));
|
QCOMPARE(clonedSubGroupEntry->title(), QString("SubGroupEntry"));
|
||||||
|
|
||||||
|
Group* clonedGroupKeepUuid = originalGroup->clone(Entry::CloneNoFlags);
|
||||||
|
QCOMPARE(clonedGroupKeepUuid->entries().at(0)->uuid(), originalGroupEntry->uuid());
|
||||||
|
QCOMPARE(clonedGroupKeepUuid->children().at(0)->entries().at(0)->uuid(), subGroupEntry->uuid());
|
||||||
|
|
||||||
delete clonedGroup;
|
delete clonedGroup;
|
||||||
|
delete clonedGroupKeepUuid;
|
||||||
delete db;
|
delete db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user