┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/kitemlistcontrollertest.cpp
AgeCommit message (Collapse)Author
2013-10-30Store the selected items in a more efficient wayFrank Reininghaus
Since Dolphin 2.0, we have stored the selected items in a QSet<int>, which is neither space-efficient nor particularly fast when inserting many items which are in a consecutive range. This commit replaces the QSet<int> by a new class "KItemSet", which stores the items in a sorted list of ranges. For each range, we only store the first index and the length of the range, so we need a lot less memory for most common selection patterns, and we also save quite a few CPU cycles in many situations, because adding an item to the KItemSet will in many cases not need a memory allocation at all, and it's particularly easy when inserting sorted items into the KItemSet in a row. KItemSet contains a minimal subset of QSet's API which makes it suitable as a drop-in replacement for our needs. It also has iterators, such that the items can be iterated through easily, also with foreach. One advantage of KItemSet compared to QSet<int> is that the items are always iterated through in ascending order. REVIEW: 113488
2013-10-07Include "Space" in the keyboard search stringFrank Reininghaus
Before this commit, we only added pressed keys to the search string if they have no other meaning. This means that files containing a Space in their name could not be searched because Ctrl+Space toggles the selection state of the current item, and Space alone selects the current item. After this commit, Space is added to the search string if (a) the key press did not have any other effect, i.e., if Ctrl was not pressed, and the current item is selected already, and (b) a keyboard search has been started already (to prevent unexpected effects when pressing Space accidentally - I think that it's rather uncommon to have files whose names start with a Space - and to make the unit test simpler). I modified the unit test of KItemListController, which did not test keyboard search yet. This uncovered a small problem in KItemListController::slotChangeCurrentItem() when NoSelection mode is used. It's not really relevant for anything that is executed inside Dolphin, but I still fixed it to make the unit test happy. BUG: 324479 FIXED-IN: 4.11.3 REVIEW: 113071
2013-02-17Another fix for KItemListControllerTest::testMouseClickActivation()Frank Reininghaus
One one machine, I see that changing the global "single click" setting fails. I don't know why that is the case, but I think we should better just skip the test in that case and not hang forever.
2013-02-13Improve the recently added test testMouseClickActivationFrank Reininghaus
The method to make sure that the first item is visible turned out to be less reliable than I thought. This could make the test hang forever. Moreover, this commit removes some trailing whitespace that had been added accidentally.
2013-02-05Add unit test for bug 313342Frank Reininghaus
2012-06-08Krazy fixesPeter Penz
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-02-13Test which items are activated when pressing Enter or ReturnFrank Reininghaus
The ViewState struct gets a new bool member to indicate if the selected items should have been activated after the last event or not. One could argue that adding a bool parameter to the constructor is not optimal, but I think adding an enum is not really worth the effort because the struct is not used outside this unit test. Moreover, I could not think of a good name for the enum type and its values. (cherry picked from commit 307cca7b31b998fb7e8af0478a8e97e53bdc059c)
2012-02-13Fix regression in KItemListControllerTestFrank Reininghaus
Since commit 66ce4db4879cd80b2dcb6d65a0c74599c5e5f0ba, enabling or disabling groupling may change the number of columns in the view. Therefore, the test should first change the "grouping" setting and then change the view geometry to make sure that the column count is correct. (cherry picked from commit 61390b201acae2d8eea94fefc947977a8799af85)
2012-02-04Simplify KItemListControllerTest::testKeyboardNavigation_data()Frank Reininghaus
Function-static variables do not help much in a function which is called exactly once. (cherry picked from commit 847c8ebfd3259a6f090db7451dd3350c6e01e0d2)
2012-02-01First version of a unit test for KItemListControllerFrank Reininghaus
At the moment, only key press events are tested, and the current item and selection after the event are verified. Moreover, this commit makes sure that KItemListController::keyPressEvent() really does not select anything if the selection mode is NoSelection. (cherry picked from commit 7457f4868cf0bc83e8a90ce5693292378f3d07c4)