As the textbounding-rectangle is now a property of KItemListWidget
also the default visual appearance is moved now from
KFileItemListWidget to KItemListWidget.
It has been split now to iconBoundingRect() and textBoundingRect().
This is required to implement the rubberband in an efficient way
and makes it more explicit what rectangle is returned.
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.
Things that are still missing:
1. Moving to the previous/next row with Up/Down in Icons View,
moving to the previous/next columns in Compact View.
2. Navigation in Details View.
Note that scrolling to the current item doesn't work yet, and
that the view does not have keyboard focus initially, so one has
to click the view before keyboard navigation and seleciton works.
Up to now, KItemListContainer would show both a vertical and
horizontal scroll bar after a view mode change. This commit
fixes that by setting the maximum and the value of the scroll
bar that is not needed to 0 in
KItemListContainer::updateScrollBars().
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.
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.
Key press events are forwarded from KItemListContainer to
KItemListController. Right now, only the 'Home' and 'End' keys
are handled (arrow keys require some more work because their action
depends on the view mode).
Note:
1. Before key presses are handled, the view has to be clicked with
the mouse. It seems that the view does not have the keyboard
focus initially.
2. The view does not scroll to the new current item yet.
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.
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
The overall time for creating previews is faster the more items
are passed to KIO::previewJob() in parallel instead of passing
e.g. only 100 items once and start several KIO::previewJobs
sequentially.
However in the worst case KIO::previewJob() might
block the application for several seconds if the
MIME-type of the passed KFileItems are unknown and e.g. 10000 items
are forwarded.
So KFileItemModelRolesUpdater will now take care to resolve as many
MIME-types as possible until a timeout is reached and will only pass
those items to KIO::previewJob().
For huge image folders, where the MIME-type can be determined very
fast, this means that the overall time for creating previews will
decrease without blocking the application. For "worst case" directories
where resolving the MIME-type can get very expensive this approach
assures no blocking of the user-interface although the overall time
until all previews are generated might slightly increase.
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.