Peter Penz [Sun, 6 Nov 2011 08:53:03 +0000 (09:53 +0100)]
Fix issues with applying wrong view-mode
- The view properties dialog mixed the details-view with
the compact-view (#285848).
- The view properties have been reset when applying a
setting from the "Dolphin Preferences" dialog. The rootcause
was that the obsolete DolphinSettings class implemented
the saving in a wrong way because of the recent refactoring
(will remove this class completely now to prevent such
issues in future).
Peter Penz [Fri, 4 Nov 2011 22:31:11 +0000 (23:31 +0100)]
Fix layout-issues when sorting by roles that are changed
When sorting is enabled for a role that gets changed e.g. because
a value like the MIME-type is determined asynchronously, then the
layout might get messed up.
slotItemsMoved() has been adjusted to invalidate the sizehint-cache
and to update the group-headers.
Peter Penz [Fri, 4 Nov 2011 20:54:01 +0000 (21:54 +0100)]
Don't use mixed units in size-column of details-view
This makes it tricky to compare the filesizes without adjusting
the sort-order, so now all sizes in the size-column are shown
in KiB or KB (dependent on the KLocale setting).
BUG: 219932
FIXED-IN: 4.8.0
Related fixes:
- Stay consistent with the rounding when using the KiB/KB unit
in the statusbar.
- Fix sorting-by-size issue for folders
- Show "Unknown" in the size-column when the number of items
cannot be determined.
Peter Penz [Mon, 31 Oct 2011 18:32:31 +0000 (19:32 +0100)]
Internal KFileItemModel optimizations and cleanups
- Use merge-sort instead of quick-sort. This assures a sane
worst-case scenario where quick-sort has a runtime complexity of
O(n*n) (e.g. when changing the sort-order from ascending to
descending).
- lessThan()-improvements: Change internal data-structures to
allow a comparison of any role, not only roles available
in KFileItem
- Don't synchronously move an item if the value has been changed
of a role defined as sort-role: This is too expensive in case if
e.g. the sorting is done by "type" and the type is determined
step by step.
Peter Penz [Sun, 30 Oct 2011 19:57:50 +0000 (20:57 +0100)]
Fix sorting-issues when value of a sort-role has been changed
If the value of a sort-role has been changed, emitting the signal
itemsChanged() is not sufficient as from the KItemModelBase point
of view an item has been moved or deleted/reinserted.
Corresponding to the unit-test KFileItemModel::setData() respects
this case correctly now, however there are some minor visual
animation issues left that (hopefully) should not be tricky to
solve.
Peter Penz [Thu, 27 Oct 2011 20:34:33 +0000 (22:34 +0200)]
Fix minor visual issues in the view-engine
- Increasing the window-size should not result in increasing the
size from previously invisible items
- Rename group 'Numerics' to '0 - 9'
- Fix "damaged" icons when changing the view-sizes or changing the
view-mode
Peter Penz [Tue, 18 Oct 2011 20:11:22 +0000 (22:11 +0200)]
Implement group-header layouting
The most tricky part for groups - the layouting - basically works
now for all views (grouping was available only in the icons views
for Dolphin 1.x) and is nearly equally fast as without groups.
Still open:
- Group headers are ugly screen rectangles
- Return valid groups in KFileItemModel instead of the currently
hardcoded testing values
- Dynamically turning on/off groups does not work currently, the
directory must be reentered
Before this commit, the order of the items in the list returned by
DolphinView::selectedItems() was random. Now the items are sorted like
they are sorted in the view.
BUG: 283409
Peter Penz [Sat, 15 Oct 2011 20:55:01 +0000 (22:55 +0200)]
Interface cleanups to prepare the return of "grouped sorting"
- Rename setCategorizedSorting() to setGroupedSorting()
- Change the model interface to allow enabling/disabling grouping
without the need to declare a role (the sort role will be taken).
- Add dummy group role implementation in KFileItemModel
The grouping code itself requires some cleanups and might crash
at the moment or lead to weird layouts.
Commit 9311f4bc97ec7000be46b8eec242a8 accidentally removed
DolphinView::wheelEvent(), which is responsible for the handling of
Control+mouse wheel events. These should change the zoom level.
Peter Penz [Mon, 10 Oct 2011 21:26:08 +0000 (23:26 +0200)]
Remove workaround to draw the focus indicator manually
In Oxygen the focus-indicator has only been drawn for widget
instances derived from QAbstractItemView and Q3ListView, so it
was not possible in Dolphin to use the style for drawing.
This has been fixed now in Oxygen, so using the style works now.
The custom code for drawing the text background will be removed
and replaced by a style-code later.
Peter Penz [Sat, 8 Oct 2011 19:40:34 +0000 (21:40 +0200)]
Context menu cleanups
- Open the context menu on the mouse-press event, not on the
mouse-release event.
- Provide an explicit position-information and don't use
QCursor::pos(). This fixes the issue that opening a context-menu
by the keyboard opens below the cursor.
- Provide different signals in the KItemListController for
the different context-menu types (item vs. view vs. header).
- Implement turning on/off roles by the header-context-menu.
Peter Penz [Thu, 6 Oct 2011 14:41:29 +0000 (16:41 +0200)]
Use QFontMetrics::height() instead of averageCharWidth()
QFontMetrics::averageCharWidth() is quite slow and does not work
well on fonts with broken characters. In the
usecases required by Dolphin QFontMetrics::height() is a better
and faster alternative to get a font-dependent minimum width.
Add function KItemListSelectionManager::isSelected(int index)
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.
Peter Penz [Fri, 30 Sep 2011 21:22:56 +0000 (23:22 +0200)]
Implement smooth-scrolling for horizontal and vertical scrollbars
Currently only a smoothscrolling was provided into the
scroll-direction, but not in case of the details-view where a
horizontal scrollbar might be shown too.
Some minor adjustments of the private KItemListSmoothScroller interface
will be done later...
Keep current item and selection when resorting, part 1
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().
Peter Penz [Sun, 25 Sep 2011 17:52:33 +0000 (19:52 +0200)]
Provide scrollbar for large items
If an item does not fit into the available width/height a scrollbar
should be provided (e.g. typically this represents the horizontal
scrollbar in the details-view where the width can be larger than
the than the visible width).
Currently the interaction with the scrollbar is not implemented but
this will be a quite minor task in comparison to this patch.
Fixed selection of directories with a trailing slash used with --select
parameter.
As QHash would not match a KUrl key with it's value if the key had a
trailing slash, so it would return -1, hence the file won't get
selected.
Changed the UpdateViewState slot to remove the trailing slash before
calling the index function for the selected URL. Also modified
DolphinView to use KUrl list instead of KFileItemList to maintain
simplicity.
Peter Penz [Fri, 23 Sep 2011 22:18:09 +0000 (00:18 +0200)]
Fix size-hint calculation in KFileItemListView
The current approach works fine but should be replaced in the longterm
by a helper class shared by KFileItemListWidget and
KFileItemListView to share information that is required to
calculate the size hints in KFileItemListView and to represent
the actual data in KFileItemListWidget.
Peter Penz [Thu, 22 Sep 2011 20:15:40 +0000 (22:15 +0200)]
Update the layout periodically when resizing the window
Up to now the layout has only been updated when the geometry has
not been changed for at least 300 ms. This has been changed so
that at least each 300 ms the layout is updated to give a better
visual feedback when resizing the window.
Fixed bug for selecting files with --select parameter.
Files selected via --select parameter did not get current item focus.
And if files were deleted while being current item, updating the view
would select the next item instead of the first item in the list.
It only works for files so far. The sorting of folders
by the number of items is more tricky to get right because
this number is retrieved asynchronously by
KFileItemModelRolesUpdater.
Fix possible crash in KFileItemModel::slotRefreshItems()
If the changed items have been created recently, they might not be in
m_items yet. In that case, the list 'indexes' might be empty, which
leads to a crash later on (I saw the crash in KFileItemModel's unit
test).
Peter Penz [Sat, 10 Sep 2011 16:08:03 +0000 (18:08 +0200)]
Provide KVersionControlPlugin version 2
Based on the work of Vishesh Yadav some extensions where required
for the KVersionControlPlugin interface that have found there way
now into KVersionControlPlugin2.
Beside some interface cleanups it is now possible that a version
control plugin may also provide context actions for directories or
files that are not versioned yet.
Peter Penz [Tue, 6 Sep 2011 21:42:42 +0000 (23:42 +0200)]
First step to reactivate version control plugin functionality
- Add a DolphinFileItemListWidget that provides icon-overlays
and colored text for the version state (implementation is
missing yet)
- Allow KFileItemListWidget to have custom text colors
- Update interface of VersionControlObserver to work with
KFileItemModel instead of the old model-interface.