diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 371f3e4d17..cae53dbc50 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -504,7 +504,7 @@ Group* Group::clone(Entry::CloneFlags entryFlags) const } Q_FOREACH (Group* groupChild, children()) { - Group* clonedGroupChild = groupChild->clone(); + Group* clonedGroupChild = groupChild->clone(entryFlags); clonedGroupChild->setParent(clonedGroup); } diff --git a/tests/TestGroup.cpp b/tests/TestGroup.cpp index 507cf155d5..514ef6dd9b 100644 --- a/tests/TestGroup.cpp +++ b/tests/TestGroup.cpp @@ -386,7 +386,12 @@ void TestGroup::testClone() QVERIFY(clonedSubGroupEntry->uuid() != subGroupEntry->uuid()); 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 clonedGroupKeepUuid; delete db; }