Commit graph

478 commits

Author SHA1 Message Date
Peter Penz
9419f0f3a5 Fix issue that no Nepomuk-data is shown when searching 2012-05-06 12:43:57 +02:00
Peter Penz
37bd2116cb Additional information: Use "Audio" instead of "Music"
This is consistent to the term used in the places panel.
2012-05-06 11:57:14 +02:00
Peter Penz
23fff35aeb Places Panel: Provide access to devices 2012-05-05 21:38:37 +02:00
Peter Penz
aacf20282d Places Panel: Allow showing of hidden items 2012-05-02 23:57:04 +02:00
Peter Penz
f158bf097a Places Panel: Fix implementation issues when hiding items 2012-05-02 21:24:16 +02:00
Peter Penz
d76b113ad1 Places Panel: Allow hiding of items
Related changes:
- Animate changed items for the details-view in case it is not expandable
- Remove the hardcoded "isHidden"-code in KStandardItemListWidget and
  allow derived widgets to define themselves what means "hidden" within
  their context.

The current code needs a lot of bugfixing, but lets make this in smaller
steps during the next days...
2012-05-01 23:14:52 +02:00
Peter Penz
6a7cb5ff7d Fix crash when closing Dolphin during generating previews
BUG: 299108
FIXED-IN: 4.9.0
2012-04-30 18:55:48 +02:00
Peter Penz
b419cfc597 Places Panel fixes
Implement adding, editing and removing of entries. Note that the
result currently is still not stored in bookmarks.xml (this needs
to wait until the hiding is implemented in the model).
2012-04-29 00:00:38 +02:00
Peter Penz
2854a69fca Reset to ascending sort order when changing the column
When changing the sort-column the sort order should always be reset
to 'ascending' to by consistent with the QListView behavior.

BUG: 298830
FIXED-IN: 4.9.0
2012-04-26 21:29:33 +02:00
Peter Penz
804021a8db Provide correct labels for Nepomuk resources 2012-04-25 21:15:14 +02:00
Frank Reininghaus
c3bd4b44e4 When the current item is removed, make -1 the current index temporarily
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 68ce395a19)
2012-04-25 09:20:23 +02:00
Frank Reininghaus
90baf5a897 When Esc is pressed, clear the selection and cancel the keyboard search
This patch restores the Dolphin 1.x behaviour that Esc clears the
selection (Dolphin 2.0 did not have an easy way to clear the selection
using the keyboard so far). Moreover, Esc now also cancels the current
keyboard search. This fixes the problem that the only way to cancel the
search is to wait until the timeout has expired.

CCBUG: 298742
CCBUG: 297458
(cherry picked from commit d3b1312d3e)
2012-04-25 09:17:43 +02:00
Frank Reininghaus
fa447df642 Reduce the timeout in KItemListKeyboardSearchManager to 1 second
It turned out that the longer timeout, introduced recently in
02eab49b2d, not only made multi-letter
keyboard searches easier, but also had some unwanted side effects. I
hope that 1 second, which is between the previous value of 5 seconds and
the pre-KDE 4.8.2 value of 0.4 seconds, is a compromise which will fit
most users' needs.
We will try to improve the situation further in future releases by
providing visual feedback about the keyboard search, but such a change
would not be suitable for a bug-fix release.
(cherry picked from commit d8732a59d3)
2012-04-25 09:16:39 +02:00
Peter Penz
d9de391720 Provide additional default groups for the Places Panel
If Nepomuk is enabled, it is now possible to easily search for
some most common queries by having additional groups.
2012-04-24 23:18:34 +02:00
Peter Penz
cbf83085be Details mode: Fix wrong required column-width calculation
BUG: 298577
FIXED-IN: 4.9.0
2012-04-23 00:24:40 +02:00
Peter Penz
007907be20 Bring back basic bookmark support for the Places Panel
The folders-panel signals have been adjusted too for consistency.
2012-04-21 23:29:11 +02:00
Peter Penz
e3f46c3b20 Inline renaming: Fix wrong assertion
BUG: 298512
FIXED-IN: 4.9.0
2012-04-21 21:41:24 +02:00
Peter Penz
ae4d11d918 Prepare view-engine for non-KFileItem usecase
Up to now the view-engine only provided a model-implementation that
supports file-items. The view-engine always had been designed to be able
to work with any kind of model, so now a KStandardItemModel is available.
The plan is to convert the places panel to the new view-engine. It should
be no problem to fix this until the feature freeze - in the worst case
the places-panel code could be reverted while still keeping the
KStandardItemModel changes.
2012-04-21 21:32:42 +02:00
Peter Penz
7afd2f0ae1 Inline renaming fixes
- Increase the editor-height in the icons-view if required
- Don't try to react on resizings of the parent, just finish
  the renaming
2012-04-18 01:15:49 +02:00
Peter Penz
beeb9078f5 Ensure authentication data is cached properly
The attached patch sets the main window on the main directory
lister in DolphinView and KIO jobs in DolphinMainWindow to ensure
that login data for remote protocols such as sftp, ftp are cached
properly for the duration of the application. Otherwise, the end
user is going to end up being unnecessarily re-prompted to enter
password login information.

Thanks to Dawit Alemayehu for the patch!

REVIEW: 104614
FIXED-IN: 4.9.0
2012-04-17 22:21:55 +02:00
Peter Penz
9f94aac23f Documentation update for KItemListRoleEditor 2012-04-17 18:18:10 +02:00
Peter Penz
b2e54c3a31 Implement inline-renaming for the new view-engine
BUG: 286893
FIXED-IN: 4.9.0
2012-04-17 18:15:12 +02:00
Peter Penz
60b8681081 Allow to optionally limit the maximum number of text lines
Showing the whole filename unclipped seems to be a good default,
however for users with a lot of files that have extremely long names
this might get a problem especially in the icons-view.

- Allow to limit the maximum number of lines in the icons-view
- Allow to specify a maximum width in the compact-view

(No limit is required for the details-view, as the name is shortened
automatically to show other columns)

BUG: 288596
FIXED-IN: 4.9.0
2012-04-14 00:28:24 +02:00
Peter Penz
40c71d5ce0 KFileItemModel: interface cleanups
Fix some naming inconsistencies regarding the usage of 'dir' vs.
'directory' vs. 'folder'.
2012-04-11 21:53:45 +02:00
Peter Penz
ff0a86288e Fix compile issue resulted by commit 2caff15b 2012-04-11 20:45:19 +02:00
Peter Penz
6c3d9acbc2 KItemViews: Internal directory restructuration
- Move all private headers from the kitemviews-directory into
the 'private' subdirectory.

- Get rid of DolphinDirLister and just use a directory-lister
  internally in KFileItemModel.

- Minor interface-cleanups for signals
2012-04-11 16:08:32 +02:00
Peter Penz
d9dbd3398a 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.

BUG: 292733
FIXED-IN: 4.9.0
2012-04-10 16:36:26 +02:00
Peter Penz
16e5740828 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.

BUG: 289850
FIXED-IN: 4.9.0
2012-04-09 09:50:17 +02:00
Peter Penz
05082aed16 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.

BUG: 273226
FIXED-IN: 4.9.0
2012-04-08 16:12:06 +02:00
Peter Penz
02f122f33c Remove unneeded/wrong signal-slot-connection 2012-04-08 15:25:38 +02:00
Peter Penz
1fe46e7dcc 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.

BUG: 293850
FIXED-IN: 4.8.3
2012-04-07 23:14:43 +02:00
Peter Penz
1ea1f351d6 Use stars for showing the rating in the group headers 2012-04-07 20:59:54 +02:00
Peter Penz
305ecd86f9 Just use "-" instead of "No destination" for the destination-role 2012-04-07 15:09:44 +02:00
Peter Penz
94a44c03e4 Provide proper translation for orientation-EXIF-value 2012-04-07 09:49:31 +02:00
Peter Penz
f4fd2c201f Show a placeholder for roles that are empty 2012-04-07 09:15:42 +02:00
Peter Penz
99f19a820b Icons Mode: Fix wrong width calculation of additional roles 2012-04-07 00:03:42 +02:00
Peter Penz
dc555b8e56 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 ;-)

CCMAIL: nuno.pinheiro@kdab.com
2012-04-06 23:12:07 +02:00
Peter Penz
5d27eb81cd Update items if a Nepomuk property has been changed
If a Nepomuk property has been changed (e.g. by changing the rating
in the Information Panel) the corresponding item in the view must
be updated.
2012-04-06 18:04:56 +02:00
Peter Penz
c9a6760f9f KItemListView: Minor internal cleanup 2012-04-05 16:34:09 +02:00
Peter Penz
f28377f1e3 Fix filtering issue
When filtering items it might be possible that the update of
the widgets is wrong although the model internally has a correct
state.

BUG: 297269
FIXED-IN: 4.8.3
2012-04-05 16:13:59 +02:00
Peter Penz
1e6031c04d Extract sorting-algorithm from KFileItemModel into custom class 2012-04-04 13:37:07 +02:00
Peter Penz
4657459937 Show the ratings as stars instead of text 2012-04-04 00:21:05 +02:00
Peter Penz
b8a12851b8 Minor internal cleanup 2012-04-02 22:24:16 +02:00
Peter Penz
fdab593c01 Fix focus-rectangle issues
Assure that the focus-rectangle exactly matches to the bottom of
the rendered text.

BUG: 297203
BUG: 289804
FIXED-IN: 4.9.0
2012-04-02 22:20:10 +02:00
Peter Penz
a4ede4e0eb 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

BUG: 296782
FIXED-IN: 4.9.0
2012-04-01 16:46:54 +02:00
Frank Reininghaus
aced85db1f 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 82fc1b54bd)
2012-03-29 20:05:49 +02:00
Frank Reininghaus
bd26bf2a20 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 02eab49b2d)
2012-03-28 19:22:12 +02:00
Peter Penz
793311dac1 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.
2012-03-27 00:48:34 +02:00
Peter Penz
8c986e22fd Rename KItemListView::preferredColumnWidth() to preferredRoleColumnWidth() 2012-03-26 22:19:38 +02:00
Peter Penz
829e5070ef Add missing 'virtual' to preferredColumnWidth() 2012-03-26 00:01:40 +02:00
Peter Penz
b7f0091733 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.
2012-03-26 00:00:12 +02:00
Peter Penz
e70c2f8aa4 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.
2012-03-25 22:58:16 +02:00
Peter Penz
1cbe55b97c Cleanup and minor fixes for column-handling 2012-03-24 23:47:42 +01:00
Peter Penz
3f88f79f86 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.

BUG: 264434
FIXED-IN: 4.9.0
2012-03-23 22:31:55 +01:00
Peter Penz
3fc96ef97b 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.

CCBUG: 264434
2012-03-22 15:47:01 +01:00
Peter Penz
403aa0bff3 KFileItemModel: Fix triggering of wrong assertion
When switching from the details-mode of a search-view into any other
mode, the m_expandedParentsCountRoot is set to ForceExpandedParentsCountRoot.
2012-03-21 16:54:02 +01:00
Peter Penz
982ce7ae20 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.
2012-03-21 12:12:35 +01:00
Peter Penz
d3a2f1ba82 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().

BUG: 296437
FIXED-IN: 4.8.2
2012-03-20 23:35:43 +01:00
Peter Penz
4815fbd00b Bypass crash with Polyester-style
The Polyester style crashes when drawing a header where the
parent widget is 0.

BUG: 296453
FIXED-IN: 4.8.2
2012-03-20 21:09:52 +01:00
Peter Penz
03a65da80a KFileItemModel: Remove minimum-update timer
The timer became unnecessary after introducing the behavior to
collect all new items until KDirLister emits a completed()-signal.
2012-03-20 17:23:28 +01:00
Peter Penz
0dcb51b927 Fix alternate background issue
When items get inserted or deleted, the alternate background
must be updated.
2012-03-20 17:23:27 +01:00
Peter Penz
5798e081f5 Let additional mouse buttons trigger history navigation
Thanks to Sebastian Dörner for the patch!

REVIEW: 101335
BUG: 181823
FIXED-IN: 4.9
2012-03-19 16:53:53 +01:00
Peter Penz
d6e10a5942 Use sub-menus for the "Sort By"- and "Additional Information"-menu
This allows doing some grouping for the visible roles by e.g. Image,
Document, Music or whatever.
2012-03-14 16:53:31 +01:00
Peter Penz
f041099904 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.
2012-03-13 16:29:45 +01:00
Peter Penz
956d32ed16 Prevent endless scrolling of list when dragging items
BUG: 295584
FIXED-IN: 4.8.2
2012-03-09 17:58:57 +01:00
Peter Penz
475f8b1261 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.

Thanks to H.H. "cyberbeat" for the initial patch!

BUG: 289090
FIXED-IN: 4.8.2
2012-03-09 16:19:19 +01:00
Peter Penz
08a485349f Allow custom sorting of details-view columns
Fix regression that Dolphin 2.0 did not allow to adjust the sorting
of the details-view columns.

BUG: 164696
FIXED-IN: 4.8.2
2012-03-07 22:18:59 +01:00
Peter Penz
90e6190f13 Update siblings when turning on/off grouping 2012-02-28 17:17:55 +01:00
Peter Penz
ee31c709a5 Finetuning of margins and alternate row colors
Thanks to Martin Zilz for the ongoing support.
2012-02-28 16:43:53 +01:00
Peter Penz
21a5a890b3 Whitespace cleanups and documentation fixes 2012-02-23 17:28:03 +01:00
Peter Penz
dbc5fd7a49 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.
2012-02-22 18:31:03 +01:00
Peter Penz
bdd0fdf246 Fix possible crash if no model is set
When updating the siblings-information by e.g. a call to
setSupportsItemExpanding() it is possible that the model is not
set yet.
2012-02-21 17:20:27 +01:00
Peter Penz
7deb601f31 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.

BUG: 294531
FIXED-IN: 4.8.1
2012-02-21 16:49:38 +01:00
Peter Penz
51bd6cfdfa 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.
2012-02-17 16:02:14 +01:00
Peter Penz
a5becac42c Compact view: Fix of left margin for first group 2012-02-16 16:37:36 +01:00
Peter Penz
613758b5ec Compact view: Padding- and margin-improvements for grouped alignments 2012-02-16 16:23:00 +01:00
Peter Penz
749362987b Folders Panel: Use the whole width as selection region
As no rubberband-selection is enabled for the Folders Panel it does
not make sense to keep the selection region as small as possible.

BUG: 294111
FIXED-IN: 4.8.1
2012-02-15 16:20:47 +01:00
Peter Penz
cf72e48111 Minor padding optimizations 2012-02-14 23:27:01 +01:00
Peter Penz
83130d8e16 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.
2012-02-14 23:00:48 +01:00
Peter Penz
55f46ceb9c Details view: Siblings fixes
The siblings should only range within one group.
2012-02-14 20:59:08 +01:00
Peter Penz
0397658b81 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.

BUG: 290276
FIXED-IN: 4.8.1
2012-02-14 18:05:29 +01:00
Peter Penz
056d12d60f 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
2012-02-11 18:04:53 +01:00
Peter Penz
e29e1cda15 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.
2012-02-09 16:05:03 +01:00
Peter Penz
03415d9078 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
2012-02-08 17:48:32 +01:00
Peter Penz
3c83d8f14d Drag and drop: Adjust destination if the item is no directory or desktop-file
The URL of the view should be used as destination target if a dropping is not
done above a directory or desktop-file.

BUG: 293511
FIXED-IN: 4.8.1
2012-02-08 17:48:28 +01:00
Peter Penz
a3a19f4a06 Compact view: Don't hide items at the bottom when grouping is turned on
When grouping has been turned on, it was possible that items aligned
at the bottom have been hidden.

BUG: 291640
FIXED-IN: 4.8.1
2012-02-07 17:18:47 +01:00
Peter Penz
5369ee6819 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.
2012-02-06 23:31:49 +01:00
Peter Penz
7af39fb960 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, ...

BUG: 293318
FIXED-IN: 4.8.1
2012-02-05 19:22:34 +01:00
Frank Reininghaus
d0933155e2 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 89082ca391)
2012-02-05 15:59:59 +01:00
Peter Penz
72af3125a8 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)

BUG: 293268
FIXED-IN: 4.8.1
CCMAIL: martin@kreativkonzentrat.de
2012-02-04 22:22:19 +01:00
Peter Penz
1041f340a2 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.

BUG: 291823
FIXED-IN: 4.8.1
2012-02-03 23:12:12 +01:00
Peter Penz
313a03d448 The autoscroll timer should be only a single-shot timer 2012-02-03 17:06:59 +01:00
Peter Penz
e20a6e59ea 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.

BUG: 292642
FIXED-IN: 4.8.1
2012-02-03 16:15:22 +01:00
Peter Penz
452c8b8ec8 Fix sorting issue when sorting by "size"
Root cause of the issue was an overflow in:
result = a - b;
where result is 'int' and a and b are 'KIO::filesize_t'.

BUG: 293086
FIXED-IN: 4.8.1
2012-02-02 16:03:15 +01:00
Peter Penz
110dd6de3c Fix pending zooming animation
If doLayout() is invoked with the 'NoAnimation' hint, it must be assured
that any ongoing animations are stopped.
2012-02-02 09:39:28 +01:00
Frank Reininghaus
6db0bec325 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 7457f4868c)
2012-02-01 22:08:16 +01:00
Peter Penz
e854a3221a 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.
2012-02-01 20:47:19 +01:00
Peter Penz
39348650d5 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.
2012-02-01 15:33:27 +01:00
Frank Reininghaus
530b91b9c7 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 999234a94a)
2012-01-31 23:19:09 +01:00
Peter Penz
3872938944 Animation optimizations
Prevent that the moving-animation crosses other items when zooming or
changing the window size.
2012-01-31 21:24:38 +01:00
Peter Penz
8121bb14b1 Fix sorting issues
For some roles the sorting has not been implemented.

BUG: 292941
FIXED-IN: 4.8.1
2012-01-31 17:18:05 +01:00
Peter Penz
03bed41e73 Only move the items if at least one direction is within the item size 2012-01-30 16:52:06 +01:00
Peter Penz
6c39b4622f 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.
2012-01-30 13:01:13 +01:00
Frank Reininghaus
0a33aad3d2 Fix crash in Compact View if view height is smaller then item height
CCBUG: 292816
FIXED-IN: 4.8.1
(cherry picked from commit f5ecaee9c4)
2012-01-30 10:10:15 +01:00
Peter Penz
d05ffe96f9 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.

CCBUG: 289238
2012-01-29 18:31:57 +01:00
Peter Penz
2f3e84d8fb Fix regression: Respect "natural sorting" setting
BUG: 292270
FIXED-IN: 4.8.1
2012-01-28 22:10:47 +01:00
Peter Penz
a89ed94378 Assure to mark an item as unhovered on a drag-leave event
BUG: 292501
FIXED-IN: 4.8.1
2012-01-28 11:04:49 +01:00
Frank Reininghaus
c7d6f43a94 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.

CCBUG: 291781
FIXED-IN: 4.8.1
(cherry picked from commit 80d9bfec58)
2012-01-25 21:35:00 +01:00
Frank Reininghaus
fbb73966b2 Make sure that Control+click toggles the selection state
This commit fixes a regression caused by the recent commit
9f711b5f2e.
CCBUG: 292250
(cherry picked from commit 84a9cc4bf6)
2012-01-23 19:38:26 +01:00
Frank Reininghaus
a043163b61 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 cc8f5b4939)
2012-01-19 19:57:51 +01:00
Frank Reininghaus
0b0b2cba93 Make PageUp/PageDown work in Dolphin's new view engine
BUG: 288748
FIXED-IN: 4.8.0
REVIEW: 103721
(cherry picked from commit e56a363aa6)
2012-01-18 10:46:47 +01:00
Frank Reininghaus
375b35762d Fix typo, which caused a Qt runtime warning when closing Dolphin
(cherry picked from commit dbf0bfffa7)
2012-01-18 09:39:07 +01:00
Peter Penz
e96af09351 Avoid unnecessary animations when switching view modes
Thanks to Nikita Skovoroda for the initial patch and the analyses.

BUG: 290947
FIXED-IN: 4.8.0
2012-01-17 23:44:28 +01:00
Peter Penz
8b8091f275 Fix probably wrong alternative background color
Thanks to Nikita Skovoroda for the patch!

CCMAIL: chalkerx@gmail.com
2012-01-17 21:19:34 +01:00
Peter Penz
7f718123b2 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.

BUG: 290953
FIXED-IN: 4.8.0
2012-01-17 21:11:49 +01:00
Peter Penz
ab61a6174e 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.

BUG: 291740
BUG: 291607
FIXED-IN: 4.8.0
2012-01-17 10:04:00 +01:00
Frank Reininghaus
555364c006 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).

BUG: 290854
REVIEW: 103703
FIXED-IN: 4.8.0
(cherry picked from commit 9f711b5f2e)
2012-01-16 20:03:49 +01:00
Peter Penz
8d7a2c96ea Don't select items if the selection toggle has been disabled 2012-01-15 10:51:46 +01:00
Peter Penz
8306a0fa6c Don't show a expanding-toggle in the Folders Panel if there are no subdirectories
BUG: 290745
FIXED-IN: 4.8.0
2012-01-15 10:41:44 +01:00
Peter Penz
b09986ef27 Fix current-item indicator in combination with the cleanlooks style
Thanks to Christoph Feck for the hint.

BUG: 290536
FIXED-IN: 4.8.0
2012-01-14 11:31:06 +01:00
Peter Penz
d5d65f545a Fix selection issue when expanding a tree
The selection anchor must be reset when changing the current item
to the root of the tree.

BUG: 290832
FIXED-IN: 4.8.0
2012-01-12 07:01:24 +01:00
Peter Penz
6584f06cd1 Prevent accessing an item with an invalid index 2012-01-11 16:15:19 +01:00
Peter Penz
5289e852c1 Fix issue that shift + drag does not move files
BUG: 291103
FIXED-IN: 4.8.0
2012-01-10 17:23:56 +01:00
Peter Penz
69f68a2349 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.

BUG: 290698
FIXED-IN: 4.8.0
2012-01-09 22:18:24 +01:00
Peter Penz
fc600ed255 Revert patch using the native graphicssystem as default
I'm trusting Christoph Feck's advice here. Additionally the smooth scaling
has been activated to fix bug 290865.

BUG: 290865
FIXED-IN: 4.8.0
2012-01-07 18:21:21 +01:00
Peter Penz
636292bfcb Details view: Fix wrong expansion level
The calculation of the root-expansion level had been incorrect which
lead to a wrong indentation on some directories.

BUG: 290757
FIXED-IN: 4.8.0
2012-01-06 18:03:15 +01:00
Peter Penz
afc55cc985 Fix issue that an empty directory is shown in the split mode
Root-cause was that the signal KDirLister::completed(KUrl) must be watched
by the model and not KDirLister::completed().

BUG: 290182
FIXED-IN: 4.8.0
2012-01-05 21:25:33 +01:00
Peter Penz
33eea8c929 Folders Panel: Activate folders on single-click
Even if double-click is used as default setting, the folders panel should
open folders with a single-click.

BUG: 289971
FIXED-IN: 4.8.0
2012-01-05 20:44:46 +01:00
Peter Penz
c8d8556950 Fix style-issues in items when not using Oxygen
Thanks to Jonathan Marten and Christoph Feck for the analyses
and the patch.

Still open: The focus frame in cleanlooks is not drawn.

CCBUG: 290536
2012-01-05 20:18:21 +01:00
Peter Penz
7953913c9f 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).

BUG: 288908
FIXED-IN: 4.8.0
2011-12-30 00:09:42 +01:00
Peter Penz
3e9d31d293 Fix issue that dragging pictures/videos to Google-Search/YouTube fails
BUG: 289917
BUG: 278236
FIXED-IN: 4.8.0
2011-12-27 15:53:49 +01:00
Peter Penz
8b977e91fb Fix group-header clipping in compact mode 2011-12-27 09:11:08 +01:00
Peter Penz
7be14d0cde Fix icon alignment issue in the details view
BUG: 289889
FIXED-IN: 4.8.0
2011-12-27 08:34:15 +01:00
Peter Penz
8403383926 Minor cleanup: Rename m_keyboardAnchorXPos to m_keyboardAnchorPos 2011-12-26 22:44:26 +01:00
Peter Penz
2e2a6ae24c 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.
2011-12-26 22:30:15 +01:00
Peter Penz
118fe89449 Fix keyboard issues when groups are enabled
When groups are enabled in Dolphin the key-up and key-down keys did not behave
consistent in comparison to traditional views or like done in editors.

CCBUG: 261995
CCBUG: 262038
2011-12-26 22:22:50 +01:00
Peter Penz
4dc5714016 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.

CCBUG: 289654
2011-12-25 22:38:34 +01:00
Peter Penz
ee26791cee 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.

BUG: 289654
FIXED-IN: 4.8.0
2011-12-25 11:39:46 +01:00
Peter Penz
00b0bfcd01 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.

BUG: 289697
FIXED-IN: 4.8.0
2011-12-24 14:16:10 +01:00
Peter Penz
b5b8d48bb7 Don't show the name as part of the "path" role
This allows a useful grouping by paths when e.g. searching files.

BUG: 269335
FIXED-IN: 4.8.0
2011-12-23 23:38:38 +01:00
Peter Penz
b2cb38214e 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.

CCBUG: 288521
2011-12-23 23:19:48 +01:00
Peter Penz
2cafa66f00 Fix possible double entries in details view
The patch 30ae57ba80 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.

BUG: 288521
FIXED-IN: 4.8.0
2011-12-23 21:15:48 +01:00
Peter Penz
6f699495b5 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).

BUG: 289589
FIXED-IN: 4.8.0
2011-12-23 16:04:32 +01:00
Peter Penz
32faa14c1a Don't show child items of collapsed parent items
If a parent item got expanded and collapsed again, KDirLister keeps
the items of the previously expanded directory. Hence inserting new
items there will result in emitting the signal newItems() and a check
must be done whether the parent is still expanded.

BUG: 289598
FIXED-IN: 4.8.0
2011-12-22 21:50:30 +01:00
Peter Penz
2c77176c9c Fix first visible index calculation
When having a row with different item-heights, the calculation of the
first visible index might have been wrong.
2011-12-21 23:18:38 +01:00
Peter Penz
965107fd02 Update previews when the preview-plugin settings have changed
Thanks to Janardhan Reddy for the initial patch.

BUG: 288726
FIXED-IN: 4.8.0
2011-12-21 21:48:24 +01:00
Peter Penz
a8622c7a1e Fix autoscroll issue when selecting items
If items get selected with the rubberband the scroll offset must stay inside
the visible range.

BUG: 282353
FIXED-IN: 4.8.0
2011-12-20 23:08:26 +01:00
Peter Penz
e76affea64 Remove child items when a parent item gets deleted
BUG: 289447
FIXED-IN: 4.8.0
2011-12-20 22:22:24 +01:00
Frank Reininghaus
a3c41997db KFileItemModel: Always use upper case letters to group by name
This fixes the following problems:
1. In a folder containing the items ~a and b, the first group,
   containing ~a, is named "Others".
2. In a folder containing the items a, ~b, ~c, and ~d, the first group
   "A" contains a and ~b, and the other two items are in the group
   "Others".
2011-12-20 02:03:31 +01:00
Peter Penz
023ab306c7 Hide tooltips when dragging items 2011-12-18 20:29:34 +01:00
Peter Penz
45a42d6a42 Turn off animations if they are globally disabled
Respect the graphicseffect level in the system settings. This will disable
all item-animations if the graphicseffect level is "NoEffect".

The smooth scrolling won't be disabled in this case, but the duration has been
made smaller so that it is not recognized as an animation.

BUG: 289238
FIXED-IN: 4.8.0
2011-12-18 15:38:42 +01:00
Peter Penz
422da53333 Force a root-expansion level for the trash protocol 2011-12-17 23:17:12 +01:00
Peter Penz
999e498a68 Determine the path of the trash-protocol correctly 2011-12-17 23:11:59 +01:00
Peter Penz
fd60b81573 Animation finetuning
If dynamic item sizes are used don't animate the size of the widget
in along the dynamic direction. This prevents unnecessary animations when
increasing the window width in combination with e.g. the details view.
2011-12-16 23:57:33 +01:00
Peter Penz
d0ba75d13e Minor layout and coding style cleanups
- Disable performance debugging output
- Force a synchronous layout during scrolling. This prevents having a jerky
  scroll-animation if there are pending operations ongoing in parallel.
- Minor coding style cleanups
2011-12-16 23:39:57 +01:00
Peter Penz
ea2ed61cd1 Update the roles if items have been changed
The code "// TODO..." in slotItemsChanged() obviously was not
sufficient ;-)

BUG: 288691
BUG: 288824
BUG: 288921
FIXED-IN: 4.8.0
2011-12-16 22:06:12 +01:00
Frank Reininghaus
dbfba7dfed Start an anchored selection when clicking a selection marker
BUG:200782
FIXED-IN:4.8.0
2011-12-15 00:36:30 +01:00
Peter Penz
065244fac9 Fix descending sort order issue
If the sort order is descending and directories and files are
shown on the same hierarchy level, the sorting was partly wrong.
2011-12-15 00:24:33 +01:00
Peter Penz
756c648f62 Don't show an expansion toggle for locked expansions 2011-12-15 00:05:33 +01:00
Peter Penz
b27aefa798 Fix expansion levels for search results
Force an expansion level of 0 for search results to prevent
showing tabbed child items without parent items.
2011-12-14 23:46:12 +01:00
Peter Penz
0c1ad320d1 Fix filtering issue in combination with expanded items
When items have been expanded they should never get filtered, as
each child item must have a parent item.
2011-12-14 22:59:10 +01:00
Peter Penz
10659d97af Improve private method KFileItemModel::expansionLevelsCompare()
Get rid of the hack to access the m_itemData member for getting
the parent of an item during sorting. ItemData has been extended
by a parent-member which allows a fast and save way to do this.

Sadly this makes the unit-test for expansionLevelsCompare() more
complex and it has been temporary deactivated. I'll take care to
fix this during the next week.
2011-12-14 22:33:34 +01:00
Peter Penz
ee8d9bb4ab Fix comment 2011-12-14 00:03:40 +01:00
Peter Penz
67783026f5 Fix several sort-issues
- Treeview: When sorting descending assure that the parent item is still
  ordered before the child items and not afterwards.
- Treeview: When sorting by other roles than names expansionsLevelCompare()
  had been buggy and resulted in ordering child items below wrong parent
  items.
- General: When sorting by another role than names and the role of
  two items had been equal a case sensitive sorting of the names had
  been done. This has been fixed by using the default name sorting
  as fallback.

BUG: 286726
FIXED-IN: 4.8.0
2011-12-13 23:43:28 +01:00
Michael Drueing
bd9f6e49d3 dolphin: DLLEXPORT is not valid for template class
MSVC tries to import the specialized class from the library, which fails because only the generic version can be exported.
GCC probably silently ignores the export.
2011-12-13 23:07:24 +01:00
Christoph Feck
a390d12de8 Respect style's viewport scrollbar layout policy
REVIEW: 103381
2011-12-12 17:36:19 +01:00
Peter Penz
42adf258b6 Remember sort settings
If the user has changed the sort-role or sort-order by clicking on the view-header of the details-view, the settings have been adjusted to the model but not remembered in the directory settings.
2011-12-11 20:24:38 +01:00
Peter Penz
85d08ac7ed Fix KItemListView::scrollToItem()
Don't let the item be invisible if the header is shown.
2011-12-11 19:34:08 +01:00
Peter Penz
7b679cc956 Scroll the view when the current item has been changed
We need now explicitly to scroll to the item when the current item has been changed, as this is not done automatically in the scope of KItemListView.

BUG: 288745
FIXED-IN: 4.8.0
2011-12-11 19:23:02 +01:00
Peter Penz
bb6dda6500 Fix issue that icon overlay is missing for links
BUG: 288609
FIXED-IN: 4.8.0
2011-12-10 23:03:38 +01:00
Peter Penz
542a80874b Minor fix in copyright header
This class is not based on the ItemViews-NG project.
2011-12-10 21:38:15 +01:00
Peter Penz
cf704d2db6 Support wildcards for the filter
Thanks to Janardhan Reddy for the patch!

BUG: 155986
FIXED-IN: 4.8.0
2011-12-10 21:30:07 +01:00
Peter Penz
780e42533a Resort items when they have been changed
This assures that when renaming an item the sort-position will be adjusted. Thanks to Frank Reininghaus and Janardhan Reddy for the patch and the tests.

BUG: 288311
2011-12-10 12:27:09 +01:00
Peter Penz
54745c440c Fix issue with duplicate items in details view
When expanding an item, collapsing it and expanding it again before the items for the first expanding could be loaded, it was possible that items have been inserted twice into the model.

BUG: 288521
FIXED-IN: 4.8.0
2011-12-09 21:52:31 +01:00
Peter Penz
a237e085fc Fix font settings issue
The font settings have been ignored currently because of the transition to the new view-engine.

The patch is based on the work of Janardhan Reddy and has been extended by the helper class ViewModeSettings.

BUG: 288395
FIXED-IN: 4.8.0
2011-12-08 23:10:42 +01:00
Peter Penz
2827b96d98 Fix "show hidden files" issues
Use KFileItemModel instead of KDirLister for toggling the whether
hidden files should be shown. This assures that the signal
KFileItemModel::loadingCompleted() will be emitted.

In the longterm Dolphin should only use the KFileItemModel, so that
the KDirLister instance is used only internally as implementation
detail in KFileItemModel. Although there are only a few cases left
where KDirLister is used instead of KFileItemModel this cleanup
will be postponed to after the 4.8 release...

BUG: 287314
BUG: 288213
FIXED-IN: 4.8.0
2011-12-08 11:13:28 +01:00
Peter Penz
b358e99280 Enable "menu key" functionality
Bring back the functionality that a context-menu is opened if the "menu key" has been pressed. In opposite to Dolphin 1.7 the context-menu is shown above the selected item and not on the (probably unrelated) mouse position.

A new method KItemListView::itemContextRect() has been introduced: The method is now also used as reference for tooltips which fixes the issue that tooltips had a wrong horizontal alignment in the details-view.

BUG: 288366
FIXED-IN: 4.8.0
2011-12-07 23:10:00 +01:00
Peter Penz
c2533317f2 Fix issue of unknown icon-types
If the split-view is used and/or the Folders Panel is activated
it might happen that the "unknown"-icon of an item is shown instead
of the correct icon. The root-cause is that one model might already
have been resolved the MIME-type of a KFileItem while the other
model has not updated the icon yet. As KFileItems are shared the
check whether the MIME-type has been resolved is wrong. As at that
stage it is assured anyhow that the MIME-type is known just
applying the icon-name in any case won't slow down the performance.
2011-12-07 18:39:58 +01:00
Peter Penz
6c29a1d98a Fix icon boundaries issue
The size of the icon boundaries should be as minimal as possible.
The patch for fixing the zooming-issues with the selection resulted
into a minor regression where the icon boundaries might be too large.
This patch remembers the original size of the pixmap to be able
to scale m_iconRect.
2011-12-07 15:34:34 +01:00
Peter Penz
cf422a8abf Use scaled size for KFileItemListWidget::iconRect()
This prevents temporary selection rectangle issues when zooming
the icon sizes.

BUG: 287542
FIXED-IN: 4.8.0
2011-12-06 21:38:30 +01:00
Peter Penz
9d5d18739f Selection and current item fixes
- Remember selection + current item when switching view-modes
- Fix the current item indicator alignment for selections
- Set the item as current item when the selection toggle has
  been clicked
2011-12-06 21:17:01 +01:00
Peter Penz
51e1858398 Fix calculation of maximum scroll offset
The maximum scroll offset must be the maximum y-range of the last
row, not only the maximum of the last item.

Thanks to Frank Reininghaus for analysing the root-cause and
for providing the initial patch!

BUG: 287211
FIXED-IN: 4.8.0
2011-12-05 20:01:11 +01:00
Frank Reininghaus
eb21254eef Update the view if an item is renamed 2011-12-04 23:37:18 +01:00
Peter Penz
7263a091c5 Fix crash #2 when filtering items
When KFileItems get removed from the model it is temporary possible
that the pending items are still part of the KFileItemModelRolesUpdater
while they have already been removed from the model (this happens
in the context during the signal itemsRemoved() gets emitted).

BUG: 287642
2011-12-04 20:50:01 +01:00
Peter Penz
854b0acd1a Fix crash #1 when filtering items
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-12-04 18:21:46 +01:00
Frank Reininghaus
031b1a4c19 Make sure that enabling previews triggers the generation of previews
Before this commit, no previews were generated if the icon size was the
same with and without previews.
2011-12-04 17:44:59 +01:00
Frank Reininghaus
82b20ff58e Clear the selection in MousePressEvent() rather than MouseReleaseEvent()
This fixes the problem that clicking an unselected item in order to drag
it would result in dragging all previously selected items as well. With
this commit, previously selected items are unselected when a new item is
clicked.

The reason why clearing the selection was moved to MouseReleaseEvent()
in commit b583dd6d4d was that clicking one
of several selected items should not result in unselecting the other
items (to make sure that dragging multiple items is possible). However,
this can also be assured by just checking in MousePressEvent() if the
clicked item has been selected already and not clearing the previous
selection in that case. This applies equally to the case that a context
menu is requested when several items are selected.
2011-12-04 13:54:05 +01:00
Frank Reininghaus
27339e15c6 Update the current item during rubber band selections 2011-12-03 18:09:34 +01:00
Peter Penz
7b8fbf7374 Reimplement name-filtering
The filtering of items has not been implemented yet in
the KFileItemModel of the new view-engine. The patch brings back
this functionality again, but some minor issues are open:
- When filtering trees expanded directories should only get
  hidden if no child is visible
- Regular expressions are not supported yet (they have not been
  supported in Dolphin 1.x but it is now quite simple to implement).
- When filtering previews and removing the filter it might be
  possible that the preview is not shown (is most probably an
  an already existing bug in KFileItemModelRolesUpdater).

BUG: 287642
FIXED-IN: 4.8.0
2011-11-30 00:24:33 +01:00
Peter Penz
3719ce7d2a Reactivate the "Open folders during drag operations" feature
The feature got temporary lost due to the port to the new view
engine.
2011-11-29 22:03:26 +01:00
Peter Penz
d7f89808f7 Apply icon effect for cut items
Fix issue that no icon effect got applied to icons that have
been cut.
2011-11-27 00:29:25 +01:00
Peter Penz
362817d183 Folders Panel fixes
The following functionality from Dolphin 1.x has
been ported to the new view-engine:
- Allow expanding/collapsing of items
- Automatically select the current item
- Context menu for items

Related improvements to the view-engine:
- Make the expanding/collapsing interface already accessible
  in the base classes KItemModelBase and KItemListView. If
  no expanding/collapsing is supported at all by derived models
  (which is usually the default case) simply not reimplementing
  those 3 methods is sufficient and it does not introduce an
  additional complexity like in QAbstractItemModel/QModelIndex.

- Automatically handle the expanding/collapsing in KItemListController.
  This also includes the key-handling, which is quite special for
  expandable items.

- Don't let KItemListView automatically scroll to the current item
  if the current item got changed. The automatic scrolling should
  only be done if the current item has been changed by the user.
  Hence this functionality has been moved to the KItemListController
  which currently only triggers the automatic scrolling if the current
  item has been changed by the keyboard (we might extend the usecases
  later if required).
2011-11-26 01:16:31 +01:00
Peter Penz
bf1a8f989e Use correct selection color for inactive windows 2011-11-25 21:34:19 +01:00
Sebastian Trueg
93cc480803 Use KFileItem::text() instead of KFileItem::name().
This way Nepomuk search results get their proper user readable names.
BUG: 287472
REVIEW: 103237
2011-11-25 16:09:57 +01:00
Frank Reininghaus
3950eccaf0 Fix restoring expanded URLs
When navigating back or forward in history, DolphinView tells the
KFileItemModel about the expanded URLs which should be restored before
the folder is entered. In this case, the algorithm in the new function
KFileItemModel::setExpanded(const QSet<KUrl>&) does not work. To fix
this, the old function
KFileItemModel::restoreExpandedUrls(const QSet<KUrl>&) is restored.

Unit test included.
2011-11-24 23:38:36 +01:00
Frank Reininghaus
1f41bed142 Don't try to divide by zero.
Fixes a crash in Dolphin when pressing a key so quickly after a url
change that there are no items in the file item model yet.

BUG:287147
2011-11-22 00:54:52 +01:00
Peter Penz
b27e599429 Initial draft for bringing back the "Folders" panel
The folders panel has been adjusted to use the new view-engine.
A lot of things don't work yet, but are mostly minor issues that
should be fixable during the next 10 days.
2011-11-20 19:35:01 +01:00
Peter Penz
fcfb63bb9d Simplify creation of drag-pixmap 2011-11-19 08:09:38 +01:00
Peter Penz
cbab7fdc62 Improve dragging pixmap
When dragging multiple files, those files should be shown as part
of the dragging pixmap like in Dolphin 1.7.

BUG: 285031
FIXED-IN: 4.8.0
2011-11-19 07:36:25 +01:00
Peter Penz
d4d83e04e5 Apply the selected-state to the current item
This assures that (with the default colors) the indication
of the current item is done in white instead of black.
2011-11-18 22:53:16 +01:00