Commit graph

267 commits

Author SHA1 Message Date
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
Peter Penz ba0c58c221 Fix wrong position of selection-toggle
When switching between view-modes the selection-toggle sometimes
had a wrong position.
2011-11-18 22:05:32 +01:00
Peter Penz fdab9ee644 Fix colors for the selection/hover-area
Thanks to Hugo Pereira Da Costa for pointing this out and
the initial patch!

CCMAIL: hugo@oxygen-icons.org
2011-11-18 20:53:22 +01:00
Peter Penz e560a2f646 Fix selection style issues
Don't use a custom drawing code for showing the hover-indication
or selection of the text.
- The default style for items is used.
- Merge icon-rectangle and text-rectangle if possible.
- Fix background and minor focus-issues
2011-11-13 20:58:43 +01:00
Peter Penz 2438b61d8e Bring back the selection-markers
Still some finetuning is necessary, but lets first bring
back the missing features from Dolphin 1.x to 2.0 before starting
with this.
2011-11-13 16:21:56 +01:00
Peter Penz c4e3528c7a Fix expansion-level issue
When the details-view has been used on / a wrong expansion-level
has been calculated and hence no expansion-toggles have been
visible.
2011-11-06 23:10:56 +01:00
Peter Penz 49d75cfe45 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.

BUG: 285542
FIXED-IN: 4.8.0
2011-11-04 23:34:39 +01:00
Peter Penz eadbf920b5 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.
2011-11-04 21:58:32 +01:00
Peter Penz d27f776cd2 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.
2011-10-31 19:38:02 +01:00
Peter Penz c872dcbda9 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.
2011-10-30 21:01:43 +01:00
Peter Penz a803819afd Fix layout issue for groups
When enabling a group where the sort-role is retrieved
asynchronously (e.g. group by "type") the group-headers have
stayed invisible.
2011-10-30 10:21:11 +01:00
Peter Penz d062256db2 Fix grouping-issue with not visible sorting roles
It must be assured that the data for a sorting role always is
determined even it is not shown as "additional info" in the view.
2011-10-29 19:52:05 +02:00