Minor changes to Group API to make it more explicit

* Include check for group as recycle bin directly into the Group::isRecycled() function

* Return the original root group from Database::setRootGroup(...) to force memory management transfer
This commit is contained in:
Jonathan White 2023-08-28 07:19:12 -04:00
parent b4ff1fa36c
commit a02bceabd2
14 changed files with 45 additions and 69 deletions

View file

@ -1456,8 +1456,8 @@ Database* TestMerge::createTestDatabase()
Database* TestMerge::createTestDatabaseStructureClone(Database* source, int entryFlags, int groupFlags)
{
auto db = new Database();
// the old root group is deleted by QObject::parent relationship
db->setRootGroup(source->rootGroup()->clone(static_cast<Entry::CloneFlag>(entryFlags),
static_cast<Group::CloneFlag>(groupFlags)));
auto oldGroup = db->setRootGroup(source->rootGroup()->clone(static_cast<Entry::CloneFlag>(entryFlags),
static_cast<Group::CloneFlag>(groupFlags)));
delete oldGroup;
return db;
}