┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistselectionmanager.cpp
AgeCommit message (Collapse)Author
2012-04-25When the current item is removed, make -1 the current index temporarilyFrank Reininghaus
This fixes two problems: 1. KItemListKeyboardSearchManger can cancel the current search when a new folder is opened (note that this action removes the current item from the view). 2. The view can underline the new current item (which is the item that used to be below the removed item). Note that this did not work before because the view did not receive a currentChanged() signal in this case and therefore did not update the "current item" status of the new current item. CCBUG: 297488 CCBUG: 298782 REVIEW: 104709 (cherry picked from commit 68ce395a192362969783615e50a8004d3029eb7e)
2011-12-30Fix inconsistency in selection managerPeter Penz
When a selection has been done with non-linear ranges, it was possible that the anchor item pointed to an invalid index that resulted into an invalid selection. As part of this fix the sorting for DolphinView::selectedItems() has been disabled (if the caller assumes a sorted selection he must manually adjust it). BUG: 288908 FIXED-IN: 4.8.0
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-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.