First version of a unit test for KItemListController
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)
Peter Penz [Wed, 1 Feb 2012 19:40:57 +0000 (20:40 +0100)]
KFileItemModelRolesUpdater: Optimize updates
The asynchronous resolving to bypass performance bottlenecks is not necessary
anymore as multiple ranges can be inserted in one step now. This solves the issue
that e.g. opening a tree resulted in temporary unknown icons for a short period
of time.
Peter Penz [Wed, 1 Feb 2012 12:46:24 +0000 (13:46 +0100)]
Don't animate items if the number of grid elements has been changed
Having animated items is useful when e.g. deleting or inserting one
item or when the size or position slightly changes by increasing the
zoom level or the window size. However if the number of rows or columns
change, the animation gets obtrusive and in this case lets just apply
the final layout.
Fix keyboard navigation issue when Home or End are pressed
The problem was that m_keyboardAnchorIndex and m_keyboardAnchorPos were
not updated when Home or End are pressed. This causes the following
unexpected behavior in Icons View: Press Home, then Right, then Down,
then Home, finally Down. One would expect that the first item in the
second row is the current item then, but before this commit, it was the
second one because the controller still remembered that the second
column was active before Home was pressed.
(cherry picked from commit 999234a94ae41cfb4f2167d2779b562ebf8127ce)
Peter Penz [Mon, 30 Jan 2012 11:59:38 +0000 (12:59 +0100)]
Further animation optimizations
- Assure a proper minimim width in the compact mode.
- Don't calculate the old position of hidden items to animate the
moving. Just show them directly.
Peter Penz [Sun, 29 Jan 2012 17:29:00 +0000 (18:29 +0100)]
Make moving animations less obtrusive
Only animate the moving of items if the new position is within the same
row or the same column. Otherwise just fade in the icon on the new position.
This makes the the animations when resizing the window or changing the zoom-level
a lot more pleasant.
Handle folder names containing spaces correctly in the Folders Panel
The problem was that KFileItemModel::setExpanded() used KUrl::url()
to determine the names of the subfolders. This method encodes special
characters, such that comparing the folder names with the unencoded URLs
stored in the model fails.
Using KUrl::path(), which does not encode special characters, fixes the
problem.
Do not make items invisible when turning off previews
This commit fixes a problem in KItemListView::doLayout(): This function
assumed that firstVisibleIndex is a constant.
However, if the view is scrolled to the bottom with previews enabled,
and then previews are disabled (and the icon size is much smaller
without previews), this function changes the scroll offset, which also
changes the the first visible index. Using the unchanged variable causes
trouble later on (i.e., it makes items which are actually inside the
view area invisible).
lastVisibleIndex is not needed before the scroll offset change and is
const after that, so its calculation is moved a few lines down.
CCBUG: 291841
FIXED-IN: 4.8.1
(cherry picked from commit cc8f5b4939062df44ce0bd314ac4ae04973b9830)
Peter Penz [Tue, 17 Jan 2012 20:08:39 +0000 (21:08 +0100)]
Do a synchronous layout for dynamic item sizes when changing the geometry
This prevents a delayed update when resizing the window e.g. in the details
view. As no animated item position changes can happen for dynamic item sizes
the synchronous relayout is fine from a performance point of view.
Peter Penz [Tue, 17 Jan 2012 08:57:58 +0000 (09:57 +0100)]
Disable smooth-scrolling dependent on the graphics-effect level
If the graphics-effect-level has been set to NoEffects (systemsettings -> Appearance
-> Style -> Fine Tuning), the smooth scrolling in Dolphin will be disabled.
Additionally the duration for the smooth-scrolling has been decreased from 200 ms
to 100 ms to reduce the lag.
A wrong calculation of the end-value has been fixed that might trigger
a wrong position of the content.
If an item is clicked to trigger it, clear the rest of the selection
Note that the clearing is not done on mouse press, but on mouse release.
The reason is that there are situations when multiple items are selected
and pressing the mouse on one of them should not clear the selection
(e.g., drag and drop of multiple items).
Peter Penz [Sat, 14 Jan 2012 21:00:22 +0000 (22:00 +0100)]
Assure an active view when activating an item
This might not be the case when e.g. having a split view, having enabled the "auto
expand folders" option and dragging an item from the active view to another
folder of the inactive view.
Peter Penz [Sat, 14 Jan 2012 20:44:50 +0000 (21:44 +0100)]
Fix "general settings" issues
If the general settings for the "selection toggle" or "expanding folders during
drag operations" are changed, those changes must be applied to the engine.
Peter Penz [Mon, 9 Jan 2012 21:10:12 +0000 (22:10 +0100)]
Prevent generating previews all the time during downloading a large file
When downloading a large file the preview should not be recreated each time
a change-notification has been received. Create the preview after getting
the first file change, but postpone creating the next previews until no change
has been done during a longer period of time.
Peter Penz [Mon, 9 Jan 2012 21:10:12 +0000 (22:10 +0100)]
Prevent generating previews all the time during downloading a large file
When downloading a large file the preview should not be recreated each time
a change-notification has been received. Create the preview after getting
the first file change, but postpone creating the next previews until no change
has been done during a longer period of time.
Peter Penz [Sat, 7 Jan 2012 11:32:06 +0000 (12:32 +0100)]
Use the native graphicssystem per default
The scaling of pixmaps is just way too slow with the raster graphicssystem (see KPixmapModifier::scalePixmap()). It is of course still possible to run Dolphin
with the raster graphicssystem, but this has to be done explicitly then.
Peter Penz [Sat, 7 Jan 2012 11:32:06 +0000 (12:32 +0100)]
Use the native graphicssystem per default
The scaling of pixmaps is just way too slow with the raster graphicssystem (see KPixmapModifier::scalePixmap()). It is of course still possible to run Dolphin
with the raster graphicssystem, but this has to be done explicitly then.
Peter Penz [Thu, 5 Jan 2012 20:37:58 +0000 (21:37 +0100)]
Temporary skip 2 unit-tests in KFileItemModel
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.
Peter Penz [Thu, 5 Jan 2012 20:37:58 +0000 (21:37 +0100)]
Temporary skip 2 unit-tests in KFileItemModel
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.
Peter Penz [Thu, 29 Dec 2011 23:02:17 +0000 (00:02 +0100)]
Fix inconsistency in selection manager
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).
Peter Penz [Thu, 29 Dec 2011 23:02:17 +0000 (00:02 +0100)]
Fix inconsistency in selection manager
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).
Peter Penz [Mon, 26 Dec 2011 21:28:54 +0000 (22:28 +0100)]
Improve item offset scrolling
Don't check whether the m_layoutTimer is active: Changing the
item offset must always trigger a synchronous layout, otherwise
the smooth-scrolling might get jerky.
Peter Penz [Mon, 26 Dec 2011 21:28:54 +0000 (22:28 +0100)]
Improve item offset scrolling
Don't check whether the m_layoutTimer is active: Changing the
item offset must always trigger a synchronous layout, otherwise
the smooth-scrolling might get jerky.
Peter Penz [Sun, 25 Dec 2011 21:34:45 +0000 (22:34 +0100)]
Fix grouping issue
When switching to a group that is not shown currently, the group headers
won't be updated. The root-cause was that the m_groups-cache must be reset
when the roles have been changed.
Peter Penz [Sun, 25 Dec 2011 21:34:45 +0000 (22:34 +0100)]
Fix grouping issue
When switching to a group that is not shown currently, the group headers
won't be updated. The root-cause was that the m_groups-cache must be reset
when the roles have been changed.
Peter Penz [Sun, 25 Dec 2011 10:35:05 +0000 (11:35 +0100)]
Fix wrong grouping of types
- Uninitialized types count as one group
- Let the receiver of the signal itemsMoved() decide whether unmoved items
really result in an unchanged visual appearance. This might e.g. be the case
if the grouping is turned on and the group-names change although the items
themselves have not changed their position.
Peter Penz [Sun, 25 Dec 2011 10:35:05 +0000 (11:35 +0100)]
Fix wrong grouping of types
- Uninitialized types count as one group
- Let the receiver of the signal itemsMoved() decide whether unmoved items
really result in an unchanged visual appearance. This might e.g. be the case
if the grouping is turned on and the group-names change although the items
themselves have not changed their position.
Peter Penz [Sat, 24 Dec 2011 13:12:09 +0000 (14:12 +0100)]
Fix sort-issue for trees
If a protocol like fish is used, the sorting of sub-trees was wrong. The root
cause was a wrong comparing of URLs where the protocol was not initialized.
Peter Penz [Sat, 24 Dec 2011 13:12:09 +0000 (14:12 +0100)]
Fix sort-issue for trees
If a protocol like fish is used, the sorting of sub-trees was wrong. The root
cause was a wrong comparing of URLs where the protocol was not initialized.
Peter Penz [Fri, 23 Dec 2011 22:05:08 +0000 (23:05 +0100)]
Introduce "isExpandable" role
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.
Peter Penz [Fri, 23 Dec 2011 22:05:08 +0000 (23:05 +0100)]
Introduce "isExpandable" role
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.
Peter Penz [Fri, 23 Dec 2011 20:10:32 +0000 (21:10 +0100)]
Fix possible double entries in details view
The patch 30ae57ba807ecadfdef833a4895621fc330badc9 did not resolve the
issue completely: The pending items to insert must be dispatched before
checking for duplicates.
Related to this report the expanding for the remote-protocol has been
disabled.
Peter Penz [Fri, 23 Dec 2011 20:10:32 +0000 (21:10 +0100)]
Fix possible double entries in details view
The patch 30ae57ba807ecadfdef833a4895621fc330badc9 did not resolve the
issue completely: The pending items to insert must be dispatched before
checking for duplicates.
Related to this report the expanding for the remote-protocol has been
disabled.
Peter Penz [Fri, 23 Dec 2011 15:01:23 +0000 (16:01 +0100)]
The key "space" should select the current item
Also in case if only one item is shown the navigation-keys should
trigger a selection of the current item. This works now consistent
within all view-modes (there have been been behavior differences
in Dolphin 1.7 depending on the used mode).
Peter Penz [Fri, 23 Dec 2011 15:01:23 +0000 (16:01 +0100)]
The key "space" should select the current item
Also in case if only one item is shown the navigation-keys should
trigger a selection of the current item. This works now consistent
within all view-modes (there have been been behavior differences
in Dolphin 1.7 depending on the used mode).