┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/kitemlistselectionmanagertest.cpp
AgeCommit message (Collapse)Author
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-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-10-25Fix minor typosYuri Chornoivan
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".
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-20Modernize: Use override where possibleKevin Funk
Also use override instead of Q_DECL_OVERRIDE
2017-04-07Fix some compiler warningsKevin Funk
2017-01-03Add missing Q_DECL_OVERRIDEMontel Laurent
2017-01-03Add missing Q_OBJECT macrosIlya Bizyaev
REVIEW: 129738
2015-09-01Pedantic--Montel Laurent
2015-02-26Use QT_GUILESS_MAINHeiko Becker
REVIEW: 122730
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-18Port test to qt5Montel Laurent
2014-04-26Do not change the selection when re-sorting the viewFrank Reininghaus
If a range of items has been selected by Shift-clicking or by pressing Shift+Arrow, then each of them is added individually to the selection before the items are re-sorted. Before this commit, the first and the last item in the range were moved, and all items between them were selected, even though these were not necessarily the items which had been selected before the re-sorting. BUG: 333457 REVIEW: 117603 FIXED-IN: 4.13.1
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-01-14Select right item as current item (first item after the deletion) after ↵Emmanuel Pescosta
deleting files BUG: 290736 REVIEW: 108356 FIXED-IN: 4.10
2012-02-23Whitespace cleanups and documentation fixesPeter Penz
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-10-03Add function KItemListSelectionManager::isSelected(int index)Frank Reininghaus
This function is used in KItemListView::updateWidgetProperties() to find out if an item is selected in a more efficient way. The new function is tested in KItemListSelectionManagerTest. I've factored out some code from KItemListSelectionManagerTest::testChangeSelection() to a new member to simplify the test.
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-08-27Remove unneded function KItemListSelectionManager::anchorItem()Frank Reininghaus
2011-08-26Simplify KItemListSelectionManagerFrank Reininghaus
1. The anchorChanged() signal is not needed. 2. The only place where setAnchorItem() is called is in beginAnchoredSelection() -> merge both functions.
2011-08-24Fix issues with the anchor selectionPeter Penz
Don't change the selection if the anchor is invalid. This fixes the issue that items might get selected during changing a directory.
2011-08-14Two small selection improvements in DolphinViewFrank Reininghaus
1. Implement DolphinView::clearSelection(). 2. Simplify DolphinView::invertSelection(). I found, fixed, and unit-tested a bug in the selection manager which was uncovered by this change.
2011-08-13Implement selection of items using mouse clicks.Frank Reininghaus
2011-08-11Test signal emission on selection changesFrank Reininghaus
This commit adds a unit test that changes the selection in various ways, verifies the result and checks that the selection manager's selectionChanged signal has been emitted correctly. The test is data-driven, so I hope that most further testing needs can be fulfilled by adding new test data. Moreover, I changed selectedItems() such that the anchored selection is only taken into account if anchor and current item are different. The reason is that in some situation the anchor should not be selected initially (i.e., if an already selected item is Control-clicked). If the anchor should be selected from the beginning, it must be selected manually.
2011-08-11Emit KitemListSelectionManager's selectionChanged signal correctlyFrank Reininghaus
This commit makes sure that the signal is emitted with the correct current and previous selection after a selection change, and that the signal is emitted exactly once in KItemListSelectionManager::itemsInserted and KItemListSelectionManager::itemsRemoved.
2011-08-10Implement beginAnchoredSelection() and endAnchoredSelection().Frank Reininghaus
Unit test included.
2011-08-10Always use the 'Select' mode for anchored selectionsFrank Reininghaus
In Dolphin, we don't actually use the 'Deselect' and 'Toggle' modes for anchored selections, so we can just remove these modes and always use 'Select' to reduce code complexity.
2011-08-10Initial support for anchored selections in the selection managerFrank Reininghaus
2011-08-10Update the anchor item when items are added or removedFrank Reininghaus
If items are added or removed in the model, not only the current item, but also the anchor item, which is the starting point for any selections via Shift+Click or Shift+Key, needs to be updated. BUG: 262638 FIXED-IN: 4.8.0
2011-08-09Test setting the current item and anchor itemFrank Reininghaus
2011-08-09Improvements for selections, smooth scrolling, tooltips and info-panelPeter Penz