┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/kfileitemmodelbenchmark.cpp
AgeCommit message (Collapse)Author
2023-09-10Replace qAsConst with std::as_constMéven Car
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2021-03-13Enable test mode in all testElvis Angelaccio
2021-02-09Build with QT_NO_KEYWORDSNicolas Fella
2020-10-23Compile without foreachAlexander Lohnau
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2019-11-09Remove unnecessary semicolons after Q_UNUSEDElvis Angelaccio
GIT_SILENT
2018-03-03Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-02-03Port QSignalSpy to new signal syntaxElvis Angelaccio
More compile-time safety. Tests still pass. This also fixes a krazy warning about "normalised signal/slot signatures".
2015-05-07Simplify the KFileItemModel benchmarkFrank Reininghaus
The benchmark inserted KFileItemLists of different sizes in the model. The intention was to verify that an O(N^2) complexity issue was fixed. However, now that this original problem does not exist any more, the benchmark results are much easier to read, and regressions are much easier to spot at first sight, if only a single list size is used.
2015-04-24Remove obsolete benchmark for inserting many child itemsFrank Reininghaus
I added this benchmark quite a long time ago in order to check that the changes in dc6322dc090bcaec40d75522debad1edfb25b27a do not make inserting many child items into the model slower. The test tries to insert child items of different subfolders at the same time, which cannot happen during normal usage because KDirLister only tells us about one subfolder at a time. The code was commented out a long time ago because it is no longer compatible with the (greatly improved) new internal structure of KFileItemModel. I think that it's not worth porting the benchmark because it fulfilled its intended purpose a long time ago. Even if someone decides to make a simplified working new benchmark out of it at some point, it does not make much sense to keep this commented-out code around for years. It can still be found in the git history - after all, that's what version control systems are for.
2015-02-26Port away from KDELibs4Support (we only use KDELibs4Support when baloo isn't ↵Emmanuel Pescosta
present, because KFileMetaDataWidget is in KDELibs4Support) Reviewed-By: Vishesh Handa
2014-12-18Ported tests away from KRandomSequence, QTest::kWaitForSignal and KTempDir.Emmanuel Pescosta
All tests passed!
2014-11-10make use of initializer listsEmmanuel Pescosta
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-18Port test to qt5Montel Laurent
2013-10-07Make the code that removes items from KFileItemModel more robustFrank Reininghaus
When we remove items from the model, we called the function KFileItemModel::removeItems(const KFileItemList&, RemoveItemsBehavior). This function then looked up the indexes of the items using the hash m_items. This is wasteful in the situations when the indexes of the removed items are known in advance (like when an expanded folder is collapsed in Details View), and it can cause trouble if one item is contained in the model multiple times (can happen when searching, and a file both matches the search and is a child of a folder that matches the search). Even if expanding folders in the search results list might not be particularly useful most of the time, it makes sense to make the model more robust to prevent crashes and other unexpected behavior in such situations. This patch makes the following changes to achieve that goal: * Change the argument of removeItems() from KFileItemList to KItemRangeList. To make this work, the "look the indexes up in m_items" code is moved from that function to slotItemsDeleted(). In the other places where removeItems() is called, the indexes are calculated directly (which is not more difficult than determining the removed items as a KFileItemList, if one considers that we needed the function childItems(KFileItem) for that, which is not needed any more with this patch). * Also removeFilteredChildren() takes a KItemRangeList now. Rather than putting the parent KFileItems into a QSet for O(1) lookup (which prevents O(N^2) worst case behavior for the entire function), it uses a QSet<ItemData*> now, which should even be more efficient (hashing a pointer is cheaper than hashing a KFileItem/KUrl). BUG: 324371 BUG: 325359 FIXED-IN: 4.12.0 REVIEW: 113070
2013-02-27Big Thanks to Frank Reininghaus, who helped me a lot with theseEmmanuel Pescosta
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
2013-02-10Add benchmark for adding many child items in a tree structureFrank Reininghaus
2013-02-03Remove unneeded #includeFrank Reininghaus
2013-01-27Move the consistency check for KFileItemModel from the test to the classFrank Reininghaus
This makes it possible to check the model's consistency also in other places, e.g., in KFileItemModel's benchmark.
2013-01-27Add some benchmarks for KFileItemModelFrank Reininghaus
The benchmark executable must be run manually. It is not run automatically with the other unit tests to prevent waste of CPU cycles in the not-so-uncommon situation that only test failures attract attention.