X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f061d2a6b3421d9b087c99161323d0df3a3b443e..6a3f8086a372ca1c21ab474c7934e8f8e4b238f5:/src/tests/kfileitemmodeltest.cpp diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index e6bcb906e..9d53ea7e6 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -28,20 +28,20 @@ void myMessageOutput(QtMsgType type, const char* msg) { switch (type) { - case QtDebugMsg: - break; - case QtWarningMsg: - break; - case QtCriticalMsg: - fprintf(stderr, "Critical: %s\n", msg); - break; - case QtFatalMsg: - fprintf(stderr, "Fatal: %s\n", msg); - abort(); - default: + case QtDebugMsg: break; + case QtWarningMsg: + break; + case QtCriticalMsg: + fprintf(stderr, "Critical: %s\n", msg); + break; + case QtFatalMsg: + fprintf(stderr, "Fatal: %s\n", msg); + abort(); + default: + break; } - } +} namespace { const int DefaultTimeout = 5000; @@ -419,7 +419,7 @@ void KFileItemModelTest::testExpandItems() // Store the URLs of all folders in a set. QSet allFolders; - allFolders << KUrl(m_testDir->name() + "a") << KUrl(m_testDir->name() + "a/a") << KUrl(m_testDir->name() + "a/a-1"); + allFolders << KUrl(m_testDir->name() + 'a') << KUrl(m_testDir->name() + "a/a") << KUrl(m_testDir->name() + "a/a-1"); m_model->loadDirectory(m_testDir->url()); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout)); @@ -437,7 +437,7 @@ void KFileItemModelTest::testExpandItems() QVERIFY(m_model->isExpanded(0)); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout)); QCOMPARE(m_model->count(), 3); // 3 items: "a/", "a/a/", "a/a-1/" - QCOMPARE(m_model->expandedDirectories(), QSet() << KUrl(m_testDir->name() + "a")); + QCOMPARE(m_model->expandedDirectories(), QSet() << KUrl(m_testDir->name() + 'a')); QCOMPARE(spyInserted.count(), 1); KItemRangeList itemRangeList = spyInserted.takeFirst().at(0).value(); @@ -453,7 +453,7 @@ void KFileItemModelTest::testExpandItems() QVERIFY(m_model->isExpanded(1)); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout)); QCOMPARE(m_model->count(), 4); // 4 items: "a/", "a/a/", "a/a/1", "a/a-1/" - QCOMPARE(m_model->expandedDirectories(), QSet() << KUrl(m_testDir->name() + "a") << KUrl(m_testDir->name() + "a/a")); + QCOMPARE(m_model->expandedDirectories(), QSet() << KUrl(m_testDir->name() + 'a') << KUrl(m_testDir->name() + "a/a")); QCOMPARE(spyInserted.count(), 1); itemRangeList = spyInserted.takeFirst().at(0).value(); @@ -482,7 +482,7 @@ void KFileItemModelTest::testExpandItems() m_model->setExpanded(0, false); QVERIFY(!m_model->isExpanded(0)); QCOMPARE(m_model->count(), 1); - QVERIFY(!m_model->expandedDirectories().contains(KUrl(m_testDir->name() + "a"))); // TODO: Make sure that child URLs are also removed + QVERIFY(!m_model->expandedDirectories().contains(KUrl(m_testDir->name() + 'a'))); // TODO: Make sure that child URLs are also removed QCOMPARE(spyRemoved.count(), 1); itemRangeList = spyRemoved.takeFirst().at(0).value(); @@ -593,7 +593,7 @@ void KFileItemModelTest::testSorting() m_model->loadDirectory(m_testDir->url()); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout)); - int index = m_model->index(KUrl(m_testDir->url().url() + "c")); + int index = m_model->index(KUrl(m_testDir->url().url() + 'c')); m_model->setExpanded(index, true); QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsInserted(KItemRangeList)), DefaultTimeout));