Peter Penz [Tue, 10 Apr 2012 14:30:50 +0000 (16:30 +0200)]
Improvements for slow sorting roles
If the sorting is done for data which is resolved asynchronously
(e.g. rating), it is important to give a visual feedback about
the state of the sorting. This is done now by a progress
indication in the statusbar.
Also optimizations for "Sort by type" have been done: Although
resolving a type can be expensive in the most often case it is a
very cheap operation. So it the sorting is done by type, try
to resolve the type synchronously for at least 200 ms to prevent
a asynchronous resorting. This is usually sufficient to have
resolved types even for directories with several thousands of
items.
Peter Penz [Mon, 9 Apr 2012 07:44:05 +0000 (09:44 +0200)]
Revert the 2.0 decision to always use KB for file-sizes
The feedback on bugs.kde.org has shown that the previous behavior
(= show size with best-matching unit) is preferred by most users.
I initially wanted to make this configurable, but for implementing
it in a non-hacky way extending KLocale from kdelibs would have
been required. I'm not sure whether the usecase in Dolphin justifies
having such a configuration in KLocale - however as kdelibs is frozen
at the moment this is no option and the old behavior has been
restored.
Peter Penz [Sun, 8 Apr 2012 21:15:32 +0000 (23:15 +0200)]
Layout improvements for settings
- Handle 'Context Menu' settings as part of the services
- Handle 'Version Control' settings as part of the services
- Move the confirmations-settings into own tab
- Use combobox for view-property settings
- A lot of minor spacing cleanups
Peter Penz [Sun, 8 Apr 2012 14:08:25 +0000 (16:08 +0200)]
Ignore maximum size for local files when creating previews
It is up to the plugins to decide what sensible size is required for
creating a preview, this cannot be decided by the user for all
plugins. A maximum size only makes sense for remote files, where
the user implicitely decides how much of the bandwith may be used
for having previews.
Peter Penz [Sat, 7 Apr 2012 22:09:11 +0000 (00:09 +0200)]
Remove toolbar-spacer if the menu has been disabled
Aligning the control-button to the right of Dolphin has the problem
that sub-menus might be opened on the left of the menu if the Dolphin
window reaches the right of the desktop. So the toolbar-spacer has
been removed and a default label has been applied to the control-button
to increase the target-area for opening the menu.
Peter Penz [Sat, 7 Apr 2012 21:11:16 +0000 (23:11 +0200)]
Fix drag & drop cursor issue
When dragging a file within the same Dolphin window and the Ctrl, Shift
or Alt-key is pressed the shape of the cursor was not changed to
indicate the copy/move/link-operation.
Peter Penz [Fri, 6 Apr 2012 21:06:05 +0000 (23:06 +0200)]
Allow to specify whether an upscaling of images should be done
The option is currently hidden as up to now only Nuno requested it,
but it seems to be urgent: "my icon making productivity has drop subtantialy"
((c) 2012 Nuno)
As I don't want to get blamed for an outdated Oxygen-icon-set I have
no other choice ;-)
Peter Penz [Sun, 1 Apr 2012 14:42:46 +0000 (16:42 +0200)]
Allow showing Nepomuk metadata inside views
Metadata like image-size, rating, comments, tags, ... can be shown
now in the view (e.g. as column in the Details mode).
Still open: The rating-information needs to be shown as stars.
In the context of this feature also the following bugs have been
fixed:
- Fix visual glitches in the header of the Details mode
- Improve the minimum column width calculation to respect also
the headling and not only the content
KItemListKeyboardSearchManager: make it possible to choose the timeout
It's now possible to change the timeout, after which any call of
KItemListKeyboardSearchManager::addKeys(const QString&) starts a new
search, from the default value of 5000 milliseconds. This is not used
in Dolphin at the moment, but it permits to reduce the timeout to a
small value in the unit test. Before this change, the unit test took
more than 5 seconds to complete.
(cherry picked from commit 82fc1b54bd01768f50aba7d328cdcde7de1483d7)
Increase the timeout in KItemListKeyboardSearchManager to 5 seconds
The previous timeout [QApplication::keyboardInputInterval()] was too
short to do a multi-letter search for users who do not type extremely
fast.
(cherry picked from commit 02eab49b2de51c31fe46a0d9501327b579b3648e)
Peter Penz [Mon, 26 Mar 2012 22:44:39 +0000 (00:44 +0200)]
KItemListView interface and implementation simplification
- Remove KItemListView::preferredRoleColumnWidth() and allow implementing
this as part of derived classes from KItemListWidget. Those derived
classes are aware about the layout and hence also can provide the
preferred role width.
- Make KItemListView::itemSizeHint() non-virtual and also allow
implementing the size hint as part of derived classes from KItemListWidget.
Peter Penz [Sun, 25 Mar 2012 21:57:51 +0000 (23:57 +0200)]
Internal interface cleanup
Let derived classes from KItemListView just implement
preferredColumnWidth() for one role of an item instead of returning
a hashtable for a given item-range.
Peter Penz [Sun, 25 Mar 2012 20:56:13 +0000 (22:56 +0200)]
Details view: Don't reset to automatic resizing when adding columns
Until now when a new column is added in the case where custom column widths
are used, the automatic resizing has been turned on again. The patch fixes
this so that the current widths stay and the new column gets a proper default
width.
Peter Penz [Fri, 23 Mar 2012 21:26:17 +0000 (22:26 +0100)]
Details view: Optionally remember user changed column-widths
If the user changed a column-width in the details-view, up to now
the width got reset when changing a directory or when restarting
Dolphin. Now the column-widths automatically get remembered for each
directory in case if the user has modified the width. The automatic
resizing is still turn on per default. The storing of the custom
column-width can easily be reset by right clicking on the header and
selecting "Automatic Column Widths" from the context-menu.
Some finetuning is still necessary (e.g. the "Adjust View Properties"
dialog currently is not aware about this setting) but this will
be fixed during the next weeks.
Peter Penz [Thu, 22 Mar 2012 14:39:07 +0000 (15:39 +0100)]
Details view: Expand the name-column like in Dolphin 1.x
With the new view-engine the name-column always has been expanded
to the maximum width of all available names. But this makes it
impossible to see other columns without scrolling when having long
filenames, so per default the Dolphin 1.x behavior has been applied
to the new view-engine so that the name-column-width gets decreased
to be able to show the other columns.
This patch will be released with KDE applications 4.8.2. For
Dolphin 2.1 (KDE applications 4.9) user-modified widths of the
columns will be remembered per directory also between different
sessions.
Peter Penz [Wed, 21 Mar 2012 11:08:59 +0000 (12:08 +0100)]
Prevent flickering when updating items
When downloading images from e.g. the camera-IO-slave the files
will be downloaded as *.part files and renamed afterwards. The renaming
results in an undetermined mimetype and hence the probably already available
preview or icon gets replaced by a dummy icon. The patch fixes this by
keeping the old values as long until they have been resolved by
KFileItemModelRolesUpdater.
Peter Penz [Tue, 20 Mar 2012 22:28:39 +0000 (23:28 +0100)]
Fix sorting-issue when "Sort folders first" is disabled
The comparison of expanded trees may not assume that directories
are always sorted first and must respect the "Sort folders first"
setting.
The sorting-unittest has been extended by a sub-tree and the usecase
of bug 296437. The already deactivated test for
KFileItemModel::expandedParentsCountCompare() has been completely removed
as it has been replaced by testSorting().
Peter Penz [Tue, 13 Mar 2012 15:26:16 +0000 (16:26 +0100)]
Remove RolesInfoAccessor
Now KFileItemModel provides a way to access the available roles
including their translations. Note that the 3 roles "comments",
"rating" and "tags" have not been implemented yet in KFileItemModel
and turning them on does not work currently.
Peter Penz [Sun, 11 Mar 2012 18:02:45 +0000 (19:02 +0100)]
First step to introduce dynamic roles
Currently Dolphin is only capable of showing a fixed number of
roles (e.g. name, size, date, owner, ...). Dolphin 2.1 should
support also other roles like rating, tags, comments or other
meta-information of images or audio-files.
To support this the sorting-type and additional-type from
DolphinView has been replaced by a role-type represented as
QByteArray.
Peter Penz [Fri, 9 Mar 2012 15:12:00 +0000 (16:12 +0100)]
Details view: Allow to turn off expandable folders like in Dolphin 1.7
The option for turning off expandable folders has been removed with
the new view-engine. Due to several requests this option has been
readded again.
As for 4.8.x no new user-interface strings may be introduced, the
line
ExpandableFolders=false
must be manually added below the section "[DetailsMode]" in the file
~/.kde/share/config/dolphinrc if the expandable-folders feature
should be disabled.
Peter Penz [Thu, 23 Feb 2012 14:51:47 +0000 (15:51 +0100)]
Fix drag and drop issue when dragging between windows
Explicitly check whether a dragging is ongoing to decide whether a
tooltip may be shown or not, just using QApplication::mouseButtons()
is not sufficient when dragging between windows.
Peter Penz [Wed, 22 Feb 2012 17:28:11 +0000 (18:28 +0100)]
Fix alternate backgrounds when enabling grouping
Up to now the alternating backgrounds just have been calculated by
checking whether the item index is odd. This does not work well when
grouping is enabled: In this case the alternate background color
of the first item of a group should stay consistent.
Peter Penz [Tue, 21 Feb 2012 15:46:56 +0000 (16:46 +0100)]
Don't trigger assert when switching to details-view
If the visible roles of the details-view are equal to the visible roles
of other views, then switching to the details-view will trigger an
assert because the invisible roles don't get updated.
Thanks to Frank Reininghaus for the detailed analyses!
In the context of this fix optimizations have been done when switching
view-modes: The "don't-animate-workaround" could be removed.
Peter Penz [Fri, 17 Feb 2012 15:00:52 +0000 (16:00 +0100)]
Remember the row- and column-information for visible items
Up to now KItemListView has not been aware to which column or row
an item belongs to. This has been handled internally in
KItemListViewLayouter. But for deciding whether a move-animation
might result in overlapping items it is mandatory to be aware about
the column/row. The current approach to guess a column/row change
by comparing the source- and target-rectangle works very well but
breaks on some corner-cases when e.g. zooming.
Now the layouter allows to access the information. This assures
that in the vertical alignment no move-animation is done between
rows and the in the horizontal alignment no move-animation is
done between the columns.
Peter Penz [Tue, 14 Feb 2012 21:58:24 +0000 (22:58 +0100)]
Details view: Fix filter issue with sibblings
When the filter has been enabled, the sibblings got not updated. Explicitely
update the sibblings when inserting, removing or moving items. For layouting
implicitely update the sibblings only for recycled widgets.
Peter Penz [Tue, 14 Feb 2012 17:04:47 +0000 (18:04 +0100)]
Details view: Fix indicator-branches
Up to now no indicator-branches have been drawn when showing a tree. The patch
fixes this so that that the style-dependent branches are drawn.
The main part of the patch is the implementation of
KItemListView::updateSiblingsInformation(). Most of the other changes are
related due to an internal renaming of the expansionsLevel-role to
expandedParentsCount and some related cleanups.
Test which items are activated when pressing Enter or Return
The ViewState struct gets a new bool member to indicate if the selected
items should have been activated after the last event or not. One could
argue that adding a bool parameter to the constructor is not optimal,
but I think adding an enum is not really worth the effort because the
struct is not used outside this unit test. Moreover, I could not think
of a good name for the enum type and its values.
(cherry picked from commit 307cca7b31b998fb7e8af0478a8e97e53bdc059c)
Since commit 66ce4db4879cd80b2dcb6d65a0c74599c5e5f0ba, enabling or
disabling groupling may change the number of columns in the view.
Therefore, the test should first change the "grouping" setting and then
change the view geometry to make sure that the column count is correct.
(cherry picked from commit 61390b201acae2d8eea94fefc947977a8799af85)
Peter Penz [Sat, 11 Feb 2012 17:02:38 +0000 (18:02 +0100)]
Group header layout fixes
- Don't use a margin for the first group header
- Provide margins between the groups
- Use a more subtle coloring
- Prevent animation glitches when resizing a window
Peter Penz [Thu, 9 Feb 2012 08:57:47 +0000 (09:57 +0100)]
Icon-rectangle and selection-toggle optimizations
- No padding should be applied to the icon-rectangle
- Base the selection-toggle size on the icon-size of the style not
the actual pixmap content, as this might lead to smaller selection-toggles
when having pixmap-previews with a small height.
Peter Penz [Wed, 8 Feb 2012 16:45:22 +0000 (17:45 +0100)]
Layout optimizations
- Differ internally between margins and paddings
- Add a small padding in the icons-view and the compact-views
- Optimize the width of the icons-view if previews are shown
Peter Penz [Mon, 6 Feb 2012 22:26:20 +0000 (23:26 +0100)]
Group header improvements
- Use a simpler background and colors as suggested by Martin Zilz.
This is just an early draft, I need to post some comparison screenshots to
Martin for review.
- Fixes of some layout issues that have been revealed because of adjusting
the group header heights.
- More clever animation/no-animation detection when doing listview-property
changes in parallel.
Peter Penz [Sun, 5 Feb 2012 18:14:17 +0000 (19:14 +0100)]
Fix potential endless loop in layout
Usecase:
- No scrollbar is shown
- Window size will be decreased so that a scrollbar gets necessary
The decreased window size minus the space required for the scrollbar
results in a relayout of the items. In 99 % of all
cases a decreased window size won't result in showing more items in parallel in
comparison to a larger window size. However in the remaining 1 % this can
happen (e.g. see bug 293318 for a sample). This results in an endless loop as
now no scrollbar is required anymore, the layout changes again, the scrollbar
is required again, ...
Replace setExpanded(const QSet<KUrl>&) by expandParentItems(const KUrl&)
The use case of this function (Folders Panel) requires the expansion of
the parent items of a single URL, so it's not needed to handle a full
set of URLs in this function. Moreover, the issue that not only the
parents, but also the URLs themselves were expanded is fixed by this
commit.
(cherry picked from commit 89082ca391807abdc26d8985efe6b4c27183a9b1)
Peter Penz [Sat, 4 Feb 2012 21:14:53 +0000 (22:14 +0100)]
Icons view: Layout optimizations
- Assure that landscape-previews use the whole available width of the icon-area
instead of only using the square width. This waste of space occured if the
text-width was larger than the icon-width.
- Only use one margin instead of two between the icons and the text to improve the
visual appearance (thanks to Martin Zilz for the hint)
Peter Penz [Fri, 3 Feb 2012 22:07:33 +0000 (23:07 +0100)]
Show the value "Unknown" for the item-count only after it has been verified
During determining the item-count for directories just show an empty string
until either the item-count has been calculated or if the item-count is unknown.
Thanks to Nikita Skovoroda for the initial proof-of-concept patch.
Peter Penz [Fri, 3 Feb 2012 08:57:18 +0000 (09:57 +0100)]
Folders Panel: Show expansion toggles for directories on ISO-images
When counting the number of sub-directories consider unknown file types
as potential directories. In the "worst case" an expansion toggle will be
shown although the directory contains only files, however from a performance
point of view this seems to be an acceptable compromise.