┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/kfileitemmodeltest.cpp
AgeCommit message (Collapse)Author
2012-05-26Use an italic font for symbolic linksFrank Reininghaus
BUG: 298218 FIXED-IN: 4.9.0
2012-04-21Prepare view-engine for non-KFileItem usecasePeter Penz
Up to now the view-engine only provided a model-implementation that supports file-items. The view-engine always had been designed to be able to work with any kind of model, so now a KStandardItemModel is available. The plan is to convert the places panel to the new view-engine. It should be no problem to fix this until the feature freeze - in the worst case the places-panel code could be reverted while still keeping the KStandardItemModel changes.
2012-04-11KFileItemModel: interface cleanupsPeter Penz
Fix some naming inconsistencies regarding the usage of 'dir' vs. 'directory' vs. 'folder'.
2012-04-11KItemViews: Internal directory restructurationPeter Penz
- Move all private headers from the kitemviews-directory into the 'private' subdirectory. - Get rid of DolphinDirLister and just use a directory-lister internally in KFileItemModel. - Minor interface-cleanups for signals
2012-03-20Fix sorting-issue when "Sort folders first" is disabledPeter Penz
The comparison of expanded trees may not assume that directories are always sorted first and must respect the "Sort folders first" setting. The sorting-unittest has been extended by a sub-tree and the usecase of bug 296437. The already deactivated test for KFileItemModel::expandedParentsCountCompare() has been completely removed as it has been replaced by testSorting(). BUG: 296437 FIXED-IN: 4.8.2
2012-03-20KFileItemModel: Remove minimum-update timerPeter Penz
The timer became unnecessary after introducing the behavior to collect all new items until KDirLister emits a completed()-signal.
2012-02-23Whitespace cleanups and documentation fixesPeter Penz
2012-02-14Details view: Fix indicator-branchesPeter Penz
Up to now no indicator-branches have been drawn when showing a tree. The patch fixes this so that that the style-dependent branches are drawn. The main part of the patch is the implementation of KItemListView::updateSiblingsInformation(). Most of the other changes are related due to an internal renaming of the expansionsLevel-role to expandedParentsCount and some related cleanups. BUG: 290276 FIXED-IN: 4.8.1
2012-02-05Replace setExpanded(const QSet<KUrl>&) by expandParentItems(const KUrl&)Frank Reininghaus
The use case of this function (Folders Panel) requires the expansion of the parent items of a single URL, so it's not needed to handle a full set of URLs in this function. Moreover, the issue that not only the parents, but also the URLs themselves were expanded is fixed by this commit. (cherry picked from commit 89082ca391807abdc26d8985efe6b4c27183a9b1)
2012-01-05Temporary skip 2 unit-tests in KFileItemModelPeter Penz
KFileItemModel::resortAllItems() always emits a itemsMoved() signal since some time. Before blindly adjusting the tests lets discuss first whether resortAllItems() should be used in this context.
2011-12-23Introduce "isExpandable" rolePeter Penz
The role is used to determine whether a directory can be expanded at all. This is e.g. not the case if a directory has 0 items or the target-URL is different from the item-URL. The expansion toggle will get hidden if a directory is not expandable. CCBUG: 288521
2011-12-14Improve private method KFileItemModel::expansionLevelsCompare()Peter Penz
Get rid of the hack to access the m_itemData member for getting the parent of an item during sorting. ItemData has been extended by a parent-member which allows a fast and save way to do this. Sadly this makes the unit-test for expansionLevelsCompare() more complex and it has been temporary deactivated. I'll take care to fix this during the next week.
2011-12-04Fix crash #1 when filtering itemsPeter Penz
When filtering items it was possible that the current index got an invalid value which resulted in accessing the URL of a null-KFileItem. There is still one (general) open issue in KFileItemModelRolesUpdater (crash #2) where a KFileItem that is already null gets read. It is not really related to filtering but can be triggered quite easy when filtering huge directories with enabled previews. CCBUG: 287642
2011-11-30Reimplement name-filteringPeter Penz
The filtering of items has not been implemented yet in the KFileItemModel of the new view-engine. The patch brings back this functionality again, but some minor issues are open: - When filtering trees expanded directories should only get hidden if no child is visible - Regular expressions are not supported yet (they have not been supported in Dolphin 1.x but it is now quite simple to implement). - When filtering previews and removing the filter it might be possible that the preview is not shown (is most probably an an already existing bug in KFileItemModelRolesUpdater). BUG: 287642 FIXED-IN: 4.8.0
2011-11-24Fix restoring expanded URLsFrank Reininghaus
When navigating back or forward in history, DolphinView tells the KFileItemModel about the expanded URLs which should be restored before the folder is entered. In this case, the algorithm in the new function KFileItemModel::setExpanded(const QSet<KUrl>&) does not work. To fix this, the old function KFileItemModel::restoreExpandedUrls(const QSet<KUrl>&) is restored. Unit test included.
2011-11-20Initial draft for bringing back the "Folders" panelPeter Penz
The folders panel has been adjusted to use the new view-engine. A lot of things don't work yet, but are mostly minor issues that should be fixable during the next 10 days.
2011-10-31Internal KFileItemModel optimizations and cleanupsPeter Penz
- Use merge-sort instead of quick-sort. This assures a sane worst-case scenario where quick-sort has a runtime complexity of O(n*n) (e.g. when changing the sort-order from ascending to descending). - lessThan()-improvements: Change internal data-structures to allow a comparison of any role, not only roles available in KFileItem - Don't synchronously move an item if the value has been changed of a role defined as sort-role: This is too expensive in case if e.g. the sorting is done by "type" and the type is determined step by step.
2011-10-30Fix sorting-issues when value of a sort-role has been changedPeter Penz
If the value of a sort-role has been changed, emitting the signal itemsChanged() is not sufficient as from the KItemModelBase point of view an item has been moved or deleted/reinserted. Corresponding to the unit-test KFileItemModel::setData() respects this case correctly now, however there are some minor visual animation issues left that (hopefully) should not be tricky to solve.
2011-10-15Interface cleanups to prepare the return of "grouped sorting"Peter Penz
- Rename setCategorizedSorting() to setGroupedSorting() - Change the model interface to allow enabling/disabling grouping without the need to declare a role (the sort role will be taken). - Add dummy group role implementation in KFileItemModel The grouping code itself requires some cleanups and might crash at the moment or lead to weird layouts.
2011-09-29Keep current item and selection when resorting, part 1Frank Reininghaus
KFileItemModel now emits the itemsMoved signal when the model is resorted, and KItemListSelectionManager has a new function itemsMoved() which will be called indirectly when this signal is emitted. Unit tests for the new functionality are included. The following things are still needed to make the feature work: 1. KFileItemMdel::resortAllItems() should not emit itemsAdded/itemsRemoved any more. 2. KItemListView::itemsMoved() must update the view according to the changes in the model, and it must call KItemListSelectionManager::itemsMoved().
2011-09-18Implement 'Sort By Size'Frank Reininghaus
It only works for files so far. The sorting of folders by the number of items is more tricky to get right because this number is retrieved asynchronously by KFileItemModelRolesUpdater.
2011-09-18Implement some missing sorting optionsFrank Reininghaus
Changing the sort order and enabling/disabling the "Sort Folders First" option works now.
2011-09-17Implement restoring expanded folders in Details ViewFrank Reininghaus
2011-08-30KItemListKeyboardSearchManager improvements and unit testsFrank Reininghaus
This commit implements a 'repeated key search' feature, similar to QAbstractItemView, and adds unit tests for keyboard searching.
2011-08-26Fix issue that removing an item is not recognizedPeter Penz
Thanks to Tirtha Chatterjee for the patch! REVIEW: 102435
2011-08-15Add unit test for expanding folders in KFileItemModelFrank Reininghaus
2011-08-15Fix for KFileItemModel::expansionLevelsCompareFrank Reininghaus
Before this commit, expanding and collapsing folders in the details view would lead to strange results in a folder with the items "a", "a/a/", "a/a/1", "a/a-1/", and "a/a-1/1". The problem was that the comparison between "a/a/1" and "a/a-1/1" went wrong: the first character in which the paths differ is a "/" in one of the items, such that the code that reduces this 'index' in KFileItemModel::expansionLevelsCompare in order to find the 'common path' did nothing because it checked that only *one* of the two items does not have an "/" at the position 'index'.
2011-08-09Improvements for selections, smooth scrolling, tooltips and info-panelPeter Penz
2011-07-30Merged very early alpha-version of Dolphin 2.0Peter Penz
Dolphin 2.0 will get a new view-engine with the following improvements: - Better performance - Animated transitions - No clipped filenames due to dynamic item-sizes - Grouping support for all view-modes - Non-rectangular selection areas - Simplified code for better maintenance More details will be provided in a blog-entry during the next days. Please note that the code is in a very early alpha-stage and although the most tricky parts have been implemented already very basic things like drag and drop or selections have not been pushed yet. Those things are rather trivial to implement but this still will take some time.