diff options
| author | Frank Reininghaus <[email protected]> | 2013-09-09 21:38:47 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-09-09 21:38:47 +0200 |
| commit | 4416377eae06e70f5f841e94347f2d0b31113524 (patch) | |
| tree | 510999152b11983477b10c5d52472581c551d88b /src/tests/kfileitemmodeltest.cpp | |
| parent | 2d8872c3accbf4a6f07e3ce4d220c9f87057545a (diff) | |
Always sort items correctly when the refreshItems() signal is received
When sorting by, e.g., "Size", and the name is used as a fallback
because there are multiple files with the same size, the refreshItems
signal that is received when a file's name is changed either with the
dialog or outside the current view did not cause the view to be resorted
after commit d70a4811807776966c3241a72121242f4d1eaee8. This patch fixes
it.
BUG: 324713
FIXED-IN: 4.11.2
REVIEW: 112561
Diffstat (limited to 'src/tests/kfileitemmodeltest.cpp')
| -rw-r--r-- | src/tests/kfileitemmodeltest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index b0a27cd01..391fe5be5 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -391,6 +391,18 @@ void KFileItemModelTest::testResortAfterChangingName() QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)), DefaultTimeout)); QCOMPARE(itemsInModel(), QStringList() << "b.txt" << "c.txt" << "d.txt"); + + // We rename d.txt back to a.txt using the dir lister's refreshItems() signal. + const KFileItem fileItemD = m_model->fileItem(2); + KFileItem fileItemA = fileItemD; + KUrl urlA = fileItemA.url(); + urlA.setFileName("a.txt"); + fileItemA.setUrl(urlA); + + m_model->slotRefreshItems(QList<QPair<KFileItem, KFileItem> >() << qMakePair(fileItemD, fileItemA)); + + QVERIFY(QTest::kWaitForSignal(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)), DefaultTimeout)); + QCOMPARE(itemsInModel(), QStringList() << "a.txt" << "b.txt" << "c.txt"); } void KFileItemModelTest::testModelConsistencyWhenInsertingItems() |
