diff options
| author | Frank Reininghaus <[email protected]> | 2013-09-09 21:21:43 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-09-09 21:27:22 +0200 |
| commit | 258f0f60feb76876c846294c23121d41997ddc34 (patch) | |
| tree | 7f5ad16a1e10a4418bf6dc936cadd85849b98ff7 /src/tests/kfileitemmodeltest.cpp | |
| parent | 7e30467679a403f953e2547894febb51e8a3d78b (diff) | |
| parent | 2d8872c3accbf4a6f07e3ce4d220c9f87057545a (diff) | |
Merge remote-tracking branch 'origin/KDE/4.11'
The most recent commit from the KDE/4.11 branch (new unit test) had to
be modified slightly due to the changed signal emission when resorting
the model changes only the groups, and not the order of the items
(groupsChaged instead of itemsMoved).
Diffstat (limited to 'src/tests/kfileitemmodeltest.cpp')
| -rw-r--r-- | src/tests/kfileitemmodeltest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index 1d9646b3e..797920246 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -1286,6 +1286,24 @@ void KFileItemModelTest::testNameRoleGroups() expectedGroups << QPair<int, QVariant>(2, QLatin1String("D")); expectedGroups << QPair<int, QVariant>(3, QLatin1String("E")); QCOMPARE(m_model->groups(), expectedGroups); + + // Change d.txt back to c.txt, but this time using the dir lister's refreshItems() signal. + const KFileItem fileItemD = m_model->fileItem(2); + KFileItem fileItemC = fileItemD; + KUrl urlC = fileItemC.url(); + urlC.setFileName("c.txt"); + fileItemC.setUrl(urlC); + + m_model->slotRefreshItems(QList<QPair<KFileItem, KFileItem> >() << qMakePair(fileItemD, fileItemC)); + QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(groupsChanged()), DefaultTimeout)); + QCOMPARE(itemsInModel(), QStringList() << "a.txt" << "b.txt" << "c.txt" << "e.txt"); + + expectedGroups.clear(); + expectedGroups << QPair<int, QVariant>(0, QLatin1String("A")); + expectedGroups << QPair<int, QVariant>(1, QLatin1String("B")); + expectedGroups << QPair<int, QVariant>(2, QLatin1String("C")); + expectedGroups << QPair<int, QVariant>(3, QLatin1String("E")); + QCOMPARE(m_model->groups(), expectedGroups); } QStringList KFileItemModelTest::itemsInModel() const |
