┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2013-02-27 13:35:20 +0100
committerEmmanuel Pescosta <[email protected]>2013-02-27 13:35:20 +0100
commitf2d70693db58f0b912e29330017298928b0ddc0d (patch)
tree72b485e58dac4bc2085051c3cfe314bd047091c4 /src/tests
parent6b91e4e6b80f23f2123eb7b85b4a2bf1e348fe84 (diff)
Big Thanks to Frank Reininghaus, who helped me a lot with these
changes! :) * Fixed the "Network browser" and "timeline" issues, by using the KDirLister's itemsAdded(KUrl,KFileItemList) signal -> Use the given Url to define the parent-child relationship. * Changed the name of the slot "slotNewItems" to "slotItemsAdded" for consistency with the signal. * Use a QHash<KFileItem, ItemData*> instead of a QSet<KFileItem> to store the filtered data (needed to keep the O(1) lookup for filtered KFileItems in slotItemsDeleted + needed to fix bug 311912 "After erasing a filter, some thumbnails randomly disappear") * Made the determination of the "expandedParentsCount" slightly simpler - just adding 1 to the parent's level (Also needed to fix the "Network browser" and "timeline" issues) FIXED-IN: 4.11.0 REVIEW: 109180 BUG: 304565 BUG: 311912 BUG: 312890 BUG: 315593
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/kfileitemmodelbenchmark.cpp12
-rw-r--r--src/tests/kfileitemmodeltest.cpp2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/tests/kfileitemmodelbenchmark.cpp b/src/tests/kfileitemmodelbenchmark.cpp
index b1e777c06..f72e43ede 100644
--- a/src/tests/kfileitemmodelbenchmark.cpp
+++ b/src/tests/kfileitemmodelbenchmark.cpp
@@ -174,18 +174,18 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems()
QBENCHMARK {
model.slotClear();
- model.slotNewItems(initialItems);
+ model.slotItemsAdded(model.directory(), initialItems);
model.slotCompleted();
QCOMPARE(model.count(), initialItems.count());
if (!newItems.isEmpty()) {
- model.slotNewItems(newItems);
+ model.slotItemsAdded(model.directory(), newItems);
model.slotCompleted();
}
QCOMPARE(model.count(), initialItems.count() + newItems.count());
if (!removedItems.isEmpty()) {
- model.removeItems(removedItems);
+ model.removeItems(removedItems, KFileItemModel::DeleteItemData);
}
QCOMPARE(model.count(), initialItems.count() + newItems.count() - removedItems.count());
}
@@ -211,6 +211,11 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems()
void KFileItemModelBenchmark::insertManyChildItems()
{
+ // TODO: this function needs to be adjusted to the changes in KFileItemModel
+ // (replacement of slotNewItems(KFileItemList) by slotItemsAdded(KUrl,KFileItemList))
+ // Currently, this function tries to insert child items of multiple
+ // directories by invoking the slot only once.
+#if 0
qInstallMsgHandler(myMessageOutput);
KFileItemModel model;
@@ -307,6 +312,7 @@ void KFileItemModelBenchmark::insertManyChildItems()
QCOMPARE(model.count(), numberOfFolders);
QVERIFY(model.isConsistent());
}
+#endif
}
KFileItemList KFileItemModelBenchmark::createFileItemList(const QStringList& fileNames, const QString& prefix)
diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp
index 483c5b245..1145e1535 100644
--- a/src/tests/kfileitemmodeltest.cpp
+++ b/src/tests/kfileitemmodeltest.cpp
@@ -850,7 +850,7 @@ void KFileItemModelTest::testEmptyPath()
KFileItemList items;
items << KFileItem(emptyUrl, QString(), KFileItem::Unknown) << KFileItem(url, QString(), KFileItem::Unknown);
- m_model->slotNewItems(items);
+ m_model->slotItemsAdded(emptyUrl, items);
m_model->slotCompleted();
}