mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-21 14:08:43 -04:00
clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
f3f1520f81
commit
7e1d980d08
32 changed files with 224 additions and 223 deletions
|
@ -310,7 +310,7 @@ void TestMerge::testResolveConflictTemplate(
|
|||
timestamps["initialTime"] = m_clock->currentDateTimeUtc();
|
||||
QScopedPointer<Database> dbDestination(createTestDatabase());
|
||||
|
||||
Entry* deletedEntry1 = new Entry();
|
||||
auto deletedEntry1 = new Entry();
|
||||
deletedEntry1->setUuid(QUuid::createUuid());
|
||||
|
||||
deletedEntry1->beginUpdate();
|
||||
|
@ -318,7 +318,7 @@ void TestMerge::testResolveConflictTemplate(
|
|||
deletedEntry1->setTitle("deletedDestination");
|
||||
deletedEntry1->endUpdate();
|
||||
|
||||
Entry* deletedEntry2 = new Entry();
|
||||
auto deletedEntry2 = new Entry();
|
||||
deletedEntry2->setUuid(QUuid::createUuid());
|
||||
|
||||
deletedEntry2->beginUpdate();
|
||||
|
@ -393,7 +393,7 @@ void TestMerge::testResolveConflictTemplate(
|
|||
|
||||
m_clock->advanceMinute(1);
|
||||
|
||||
Entry* destinationEntrySingle = new Entry();
|
||||
auto destinationEntrySingle = new Entry();
|
||||
destinationEntrySingle->setUuid(QUuid::createUuid());
|
||||
|
||||
destinationEntrySingle->beginUpdate();
|
||||
|
@ -401,7 +401,7 @@ void TestMerge::testResolveConflictTemplate(
|
|||
destinationEntrySingle->setTitle("entryDestination");
|
||||
destinationEntrySingle->endUpdate();
|
||||
|
||||
Entry* sourceEntrySingle = new Entry();
|
||||
auto sourceEntrySingle = new Entry();
|
||||
sourceEntrySingle->setUuid(QUuid::createUuid());
|
||||
|
||||
sourceEntrySingle->beginUpdate();
|
||||
|
@ -455,7 +455,7 @@ void TestMerge::testDeletionConflictTemplate(int mergeMode,
|
|||
// entry indirectly deleted in target after updated in source
|
||||
|
||||
auto createGroup = [&](const char* name, Group* parent) {
|
||||
Group* group = new Group();
|
||||
auto group = new Group();
|
||||
group->setUuid(QUuid::createUuid());
|
||||
group->setName(name);
|
||||
group->setParent(parent, 0);
|
||||
|
@ -463,7 +463,7 @@ void TestMerge::testDeletionConflictTemplate(int mergeMode,
|
|||
return group;
|
||||
};
|
||||
auto createEntry = [&](const char* title, Group* parent) {
|
||||
Entry* entry = new Entry();
|
||||
auto entry = new Entry();
|
||||
entry->setUuid(QUuid::createUuid());
|
||||
entry->setTitle(title);
|
||||
entry->setGroup(parent);
|
||||
|
@ -883,7 +883,7 @@ void TestMerge::testCreateNewGroups()
|
|||
|
||||
m_clock->advanceSecond(1);
|
||||
|
||||
Group* groupSourceCreated = new Group();
|
||||
auto groupSourceCreated = new Group();
|
||||
groupSourceCreated->setName("group3");
|
||||
groupSourceCreated->setUuid(QUuid::createUuid());
|
||||
groupSourceCreated->setParent(dbSource->rootGroup());
|
||||
|
@ -906,7 +906,7 @@ void TestMerge::testMoveEntryIntoNewGroup()
|
|||
|
||||
m_clock->advanceSecond(1);
|
||||
|
||||
Group* groupSourceCreated = new Group();
|
||||
auto groupSourceCreated = new Group();
|
||||
groupSourceCreated->setName("group3");
|
||||
groupSourceCreated->setUuid(QUuid::createUuid());
|
||||
groupSourceCreated->setParent(dbSource->rootGroup());
|
||||
|
@ -941,7 +941,7 @@ void TestMerge::testUpdateEntryDifferentLocation()
|
|||
QScopedPointer<Database> dbSource(
|
||||
createTestDatabaseStructureClone(dbDestination.data(), Entry::CloneNoFlags, Group::CloneIncludeEntries));
|
||||
|
||||
Group* groupDestinationCreated = new Group();
|
||||
auto groupDestinationCreated = new Group();
|
||||
groupDestinationCreated->setName("group3");
|
||||
groupDestinationCreated->setUuid(QUuid::createUuid());
|
||||
groupDestinationCreated->setParent(dbDestination->rootGroup());
|
||||
|
@ -1028,7 +1028,7 @@ void TestMerge::testUpdateGroup()
|
|||
void TestMerge::testUpdateGroupLocation()
|
||||
{
|
||||
QScopedPointer<Database> dbDestination(createTestDatabase());
|
||||
Group* group3DestinationCreated = new Group();
|
||||
auto group3DestinationCreated = new Group();
|
||||
QUuid group3Uuid = QUuid::createUuid();
|
||||
group3DestinationCreated->setUuid(group3Uuid);
|
||||
group3DestinationCreated->setName("group3");
|
||||
|
@ -1284,7 +1284,7 @@ void TestMerge::testDeletedGroup()
|
|||
|
||||
QPointer<Group> group2DestinationInitial = dbDestination->rootGroup()->findChildByName("group2");
|
||||
QVERIFY(group2DestinationInitial != nullptr);
|
||||
Entry* entry3DestinationCreated = new Entry();
|
||||
auto entry3DestinationCreated = new Entry();
|
||||
entry3DestinationCreated->beginUpdate();
|
||||
entry3DestinationCreated->setUuid(QUuid::createUuid());
|
||||
entry3DestinationCreated->setGroup(group2DestinationInitial);
|
||||
|
@ -1507,19 +1507,19 @@ void TestMerge::testMergeModified()
|
|||
|
||||
Database* TestMerge::createTestDatabase()
|
||||
{
|
||||
Database* db = new Database();
|
||||
auto db = new Database();
|
||||
|
||||
Group* group1 = new Group();
|
||||
auto group1 = new Group();
|
||||
group1->setName("group1");
|
||||
group1->setUuid(QUuid::createUuid());
|
||||
|
||||
Group* group2 = new Group();
|
||||
auto group2 = new Group();
|
||||
group2->setName("group2");
|
||||
group2->setUuid(QUuid::createUuid());
|
||||
|
||||
Entry* entry1 = new Entry();
|
||||
auto entry1 = new Entry();
|
||||
entry1->setUuid(QUuid::createUuid());
|
||||
Entry* entry2 = new Entry();
|
||||
auto entry2 = new Entry();
|
||||
entry2->setUuid(QUuid::createUuid());
|
||||
|
||||
m_clock->advanceYear(1);
|
||||
|
@ -1544,7 +1544,7 @@ Database* TestMerge::createTestDatabase()
|
|||
|
||||
Database* TestMerge::createTestDatabaseStructureClone(Database* source, int entryFlags, int groupFlags)
|
||||
{
|
||||
Database* db = new Database();
|
||||
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)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue