Commit graph

4408 commits

Author SHA1 Message Date
Frank Reininghaus b4efdc620e Merge remote-tracking branch 'origin/KDE/4.11' 2013-10-07 09:31:45 +02:00
Frank Reininghaus 9f24c02a75 Make the code that removes items from KFileItemModel more robust
When we remove items from the model, we called the function
KFileItemModel::removeItems(const KFileItemList&, RemoveItemsBehavior).
This function then looked up the indexes of the items using the hash
m_items. This is wasteful in the situations when the indexes of the
removed items are known in advance (like when an expanded folder is
collapsed in Details View), and it can cause trouble if one item is
contained in the model multiple times (can happen when searching, and a
file both matches the search and is a child of a folder that matches
the search). Even if expanding folders in the search results list might
not be particularly useful most of the time, it makes sense to make the
model more robust to prevent crashes and other unexpected behavior in
such situations.

This patch makes the following changes to achieve that goal:

* Change the argument of removeItems() from KFileItemList to
  KItemRangeList. To make this work, the "look the indexes up in
  m_items" code is moved from that function to slotItemsDeleted(). In
  the other places where removeItems() is called, the indexes are
  calculated directly (which is not more difficult than determining the
  removed items as a KFileItemList, if one considers that we needed the
  function childItems(KFileItem) for that, which is not needed any more
  with this patch).

* Also removeFilteredChildren() takes a KItemRangeList now. Rather than
  putting the parent KFileItems into a QSet for O(1) lookup (which
  prevents O(N^2) worst case behavior for the entire function), it uses
  a QSet<ItemData*> now, which should even be more efficient (hashing a
  pointer is cheaper than hashing a KFileItem/KUrl).

BUG: 324371
BUG: 325359
FIXED-IN: 4.12.0
REVIEW: 113070
2013-10-07 09:26:51 +02:00
Frank Reininghaus 5bfb5031a5 Reload the view if a previously unmounted device is mounted again
The problem was that DolphinViewContainer::setUrl(newUrl) was ignored
if newUrl is equal to the URL which is shown in the view already.

The new approach is to reload the view in that method if it is empty, to
make sure that we do not miss that a previously unmounted device has
been re-mounted.

Thanks to Grigoriadis Grigoris for analyzing the root cause of this
issue!

BUG: 161385
FIXED-IN: 4.11.3
2013-10-07 09:17:48 +02:00
Frank Reininghaus 46a27ca937 Include "Space" in the keyboard search string
Before this commit, we only added pressed keys to the search string if
they have no other meaning. This means that files containing a Space in
their name could not be searched because Ctrl+Space toggles the
selection state of the current item, and Space alone selects the
current item.

After this commit, Space is added to the search string if

(a) the key press did not have any other effect, i.e., if Ctrl was not
    pressed, and the current item is selected already, and
(b) a keyboard search has been started already (to prevent unexpected
    effects when pressing Space accidentally - I think that it's rather
    uncommon to have files whose names start with a Space - and to make
    the unit test simpler).

I modified the unit test of KItemListController, which did not test
keyboard search yet. This uncovered a small problem in
KItemListController::slotChangeCurrentItem() when NoSelection mode is
used. It's not really relevant for anything that is executed inside
Dolphin, but I still fixed it to make the unit test happy.

BUG: 324479
FIXED-IN: 4.11.3
REVIEW: 113071
2013-10-07 09:09:00 +02:00
Frank Reininghaus ae587d2682 Save memory and time in KFileItemModel by lazy-loading the "ItemData"
To reduce unnecessary memory comsumption and CPU usage, we only fill the
QHash<QByteArray, QVariant> if the methods data(int) or setData(int) are
called for the corresponding index, or the data is necessary for sorting
the model.

According to my tests, this patch reduces the memory usage when loading
a folder with 100,000 items by 17% in Icons View, and by 26% in Details
View.

REVIEW: 112725
2013-10-02 19:08:39 +02:00
Frank Reininghaus 926782d3be Merge remote-tracking branch 'origin/KDE/4.11' 2013-10-01 00:15:04 +02:00
Frank Reininghaus 4cb0a239e5 Add unit test for the calculation of "name" groups with expanded items
This prevents a possible regression that would have happened with the
first version of https://git.reviewboard.kde.org/r/112725/

The problem was that isChildItem(int index) would return "false"
incorrectly when the QHash for that item was not initialized yet. The
grouping code would then try to read the "text" from the empty QHash,
which yielded an empty QString, and then accessing the first character
of that string caused a crash.
2013-10-01 00:09:25 +02:00
Emmanuel Pescosta c44b9e685e Show the right version states for expanded items.
BUG: 267171
FIXED-IN: 4.11.3
REVIEW: 112980
2013-09-29 18:08:06 +02:00
Frank Reininghaus 08710b05c7 Make sure that removeExpandedItems() also removes filtered items
This fixes the problem that filtered child items in Details View may
reappear when switching the view mode and the clearing the filter.

BUG: 325344
REVIEW: 112962
FIXED-IN: 4.11.3
2013-09-29 15:45:14 +02:00
l10n daemon script 71a2be8d4c SVN_SILENT made messages (.desktop file) 2013-09-27 07:07:49 +00:00
l10n daemon script c185694f79 SVN_SILENT made messages (.desktop file) 2013-09-27 04:24:51 +00:00
Frank Reininghaus 4a093f956b Move KItemRange to its own header
Also factor out the code that transforms a sorted list of ints to a
KItemRangeList. This removes some duplicated code from KFileItemModel.

Note that overriding operator<<() in KItemRangeList was necessary
because it's not a typedef for QList<KItemRange>, but a class derived
from that now, and some code fails to compile if the return type of
that function is QList<KItemRange> and not KItemRangeList.

REVIEW: 112728
2013-09-17 00:11:42 +02:00
Frank Reininghaus 083248d16b Merge remote-tracking branch 'origin/KDE/4.11' 2013-09-14 15:11:17 +02:00
Frank Reininghaus ced472be07 Make preview loading faster when scrolling
KFileItemListView notifies KFileItemModelRolesUpdater of changes of the
visible index range and the icon size with a delay, to prevent that
expensive operations are triggered repeatedly, and that scrolling feels
sluggish because the GUI thread is blocked by icon loading.

This patch ensures that the "long" delay of 300 ms is only used when
the zoom level is changed, and the "short" delay if only the visible
index range has changed.

Thanks to Christoph Feck for helping to analyze this problem!

BUG: 322093
FIXED-IN: 4.11.2
REVIEW: 112580
2013-09-14 14:59:50 +02:00
Kai Uwe Broulik 53c8c76cee Remove "Copy text" statusbar contextmenu entry
REVIEW: 112355
2013-09-12 18:45:41 +02:00
Emmanuel Pescosta 88a7794097 Fix Bug 311099 - View the underscore when using Ctrl + PagDown
Take the style option vertical/horizontal margin into account
for the calculation of the new scroll offset.

Thanks to Frank for pointing out two other problems with "Page Up/Down" and providing
a better way to fix these problems. :)

BUG: 311099
FIXED-IN: 4.11.2
REVIEW: 112678
2013-09-12 13:58:29 +02:00
Frank Reininghaus e03a687c92 Merge remote-tracking branch 'origin/KDE/4.11' 2013-09-09 21:43:29 +02:00
Frank Reininghaus 4416377eae Always sort items correctly when the refreshItems() signal is received
When sorting by, e.g., "Size", and the name is used as a fallback
because there are multiple files with the same size, the refreshItems
signal that is received when a file's name is changed either with the
dialog or outside the current view did not cause the view to be resorted
after commit d70a481180. This patch fixes
it.

BUG: 324713
FIXED-IN: 4.11.2
REVIEW: 112561
2013-09-09 21:38:47 +02:00
Frank Reininghaus 258f0f60fe Merge remote-tracking branch 'origin/KDE/4.11'
The most recent commit from the KDE/4.11 branch (new unit test) had to
be modified slightly due to the changed signal emission when resorting
the model changes only the groups, and not the order of the items
(groupsChaged instead of itemsMoved).
2013-09-09 21:27:22 +02:00
Frank Reininghaus 2d8872c3ac Test if the groups are updated correctly when items are refreshed
This unit test will hopefully prevent regressions in the future. It is
the first part of https://git.reviewboard.kde.org/r/112561/.
2013-09-09 21:13:38 +02:00
Frank Reininghaus 7e30467679 Make expandedParentsCount() work without accessing the data hash
The idea is that we no longer assume that the "expandedParentsCount"
for each item will be stored in the QHash. It is only accessed for
items which are expanded, and which are not top-level items (i.e.,
which have an expandedParentsCount > 1).

Some unit tests are added to improve the coverage of the affected code.

REVIEW: 112562
2013-09-07 18:06:53 +02:00
Emmanuel Pescosta 1848854c6d Nothing special, just a little bit of code cleanup in KItemListViewLayouter::doLayout().
Make use of QSizeF::transpose() and simplify the m_itemInfos usage.

REVIEW: 112535
2013-09-05 17:03:04 +02:00
Emmanuel Pescosta e1d88c4d69 Fix Bug 296970 - split view wrong behavior with search tab
Implemented setActive(bool active), isActive() and activated() signal
for DolphinSearchBox - similar to the KUrlNavigator implementation.

BUG: 296970
FIXED-IN: 4.11.2
REVIEW: 112534
2013-09-05 16:22:59 +02:00
Frank Reininghaus 7b862465d4 Merge remote-tracking branch 'origin/KDE/4.11' 2013-09-04 21:53:08 +02:00
Frank Reininghaus 4bfc28cb4b Count the items inside directories in another thread
This prevents that the GUI freezes if there are many files inside the
directory, or if the access to the directory is slow for some other
reason.

BUG: 318518
REVIEW: 111920
FIXED-IN: 4.12.0
2013-09-04 21:50:16 +02:00
Frank Reininghaus 8f7c3619ec Try to avoid calling the model's data method if only "text" is needed
Currently, KStandardItemListWidgetInformant::itemSizeHint() calls the
model's data(int) method for every single item, but the full data is
actually only needed for the size calculation in Compact View. In
Details View, no data is needed at all to determine the size required
for the item, and in Icons View, only the name is needed.

This patch makes it possible for subclasses of
KStandardItemListWidgetInformant to provide an alternative way to
obtain the "text", and implements this in the subclass
KFileItemListWidgetInformant.

The final goal is to achieve that the QHash which contains all data
for a file item is only created if it is really needed, e.g., because
the view needs access to the data for displaying the item on the
screen.

REVIEW: 112253
2013-09-04 21:37:01 +02:00
Christoph Feck 5df1b07bbc Fix color role of services list
Fixes the color of non-selected items to make them
readable with every color scheme.

BUG: 286459
FIXED-IN: 4.11.2
REVIEW: 112483
2013-09-03 22:05:05 +02:00
Emmanuel Pescosta a4ef4bbfde Replaced all KNewFileMenu usages in DolphinPart by DolphinNewFileMenu.
Removed all signal-slot-connections related to DolphinNewFileMenu->errorMessage(QString)
in DolphinMainWindow and DolphinContextMenu and replaced it by a better solution.

Now we make use of the already existing DolphinNewFileMenuObserver singleton class to achieve a better
error handling, because every newly created DolphinContextMenu instance registers himself by DolphinNewFileMenuObserver
and we use this to connect the errorMessage(QString) signal of every DolphinContextMenu instance to the errorMessage(QString)
signal of the DolphinNewFileMenuObserver singleton class.

So we need only one connection from DolphinNewFileMenuObserver to DolphinMainWindow (or to DolphinPart) to
collect all error messages thrown by every DolphinNewFileMenu instance.

REVIEW: 112178
2013-08-28 18:46:45 +02:00
Frank Reininghaus cba24825c9 Merge remote-tracking branch 'origin/KDE/4.11' 2013-08-25 19:17:25 +02:00
Christoph Feck 092c820023 Move cursor to begin/end of selection before canceling it
Makes Left/Right keys consistent with QLineEdit behavior.

BUG: 323946
FIXED-IN: 4.11.1
REVIEW: 112256
2013-08-25 17:40:49 +02:00
Frank Reininghaus f830e1179c Fix filename trucation issues in Icons View with maximum number of lines
When the name of a file is too long to be shown inside the maximum
number of lines, the last line is elided. However, there were several
problems before this commit:

(a) "lastTextLine", which contains the text to be elided, was not
    assigned the complete remaining text, but only the part that would
    be put into the last line if there were more lines following. This
    may be less than what would fit into the line because we try to not
    break the text at random points.

(b) QFontMetrics::elidedText() was not given the width that is available
    for the last line (that would be maxWidth), but only the width that
    would be occupied by the text if there were more lines following
    (line.naturalTextWidth()).

(c) The variable "nameWidth", which is required to calculate the QRectF
    that is reserved for the name, was not updated correctly.

The result is that the text was sometimes trucated too early (especially
if there would be a line break early in the text if we had more lines
available), that there may be insufficient space to show the "...", and
that the hover/selection rectangle might be too narrow.

BUG: 304558
BUG: 321882
FIXED-IN: 4.11.1
REVIEW: 112265
2013-08-25 16:27:36 +02:00
Emmanuel Pescosta 2bdce34fe1 Adjust the size and position of the selection toggle on icon
resize (when changing the zoomlevel).

BUG: 310412
REVIEW: 112250
FIXED-IN: 4.11.1
2013-08-24 21:00:26 +02:00
Frank Reininghaus ebfcb5e19b Merge remote-tracking branch 'origin/KDE/4.11' 2013-08-24 20:27:30 +02:00
Frank Reininghaus 7ffa66f777 Make determining the mime type faster for folders
KFileItem::determineMimeType() not only determines the mime type, but
also the icon. For folders, it looks for a .directory file inside the
folder, where a custom icon might be stored. This can take quite a bit
of time and cause the problem that some folder's type still appears to
be "unknown" when the view is shown.

We can work around this problem by caching the folder mime type in a
static QString and applying to to all folders, which can be identified
easily with KFileItem::isDir(),

BUG: 321710
FIXED-IN: 4.11.1
REVIEW: 111830
2013-08-24 20:22:56 +02:00
Frank Reininghaus d7997f16a7 Delay the deletion of the role editor as long as possible
This should prevent crashes that can be caused if the view is closed in
a nested event loop that is run from the role editor.

BUG: 322969
FIXED-IN: 4.11.1
REVIEW: 111988
2013-08-24 20:06:11 +02:00
Emmanuel Pescosta efdef7e40c Make use of the "resort all items timer" in KFileItemModel::slotRefreshItems
to avoid too much expensive resorting calls, in case of many refresh items signals.

Followup to patch 111146

CCBUG: 303873
CCBUG: 299565
BUG: 323789
FIXED-IN: 4.11.1
REVIEW: 111195
2013-08-24 18:13:56 +02:00
Emmanuel Pescosta edcc9d5cee Replaced the loop to fill m_sizeHintCache with QSizeF() by a simple m_sizeHintCache.fill() in KItemListSizeHintResolver::clearCache().
REVIEW: 112179
2013-08-24 18:03:40 +02:00
Christoph Feck 5db3bdb9f4 Merge remote-tracking branch 'origin/KDE/4.11' 2013-08-20 12:21:44 +02:00
Christoph Feck 078ebd53e1 Fix crash when failing to get audio CD block device
CCBUG: 314544
REVIEW: 112117
2013-08-20 12:19:15 +02:00
Fabio D'Urso 55bf917361 dolphin: Show full KFileItem statusbar text with hovered folders too
This patch changes the status bar text dolphin shows when a folder is
hovered. It now shows full folder info, eg:
  "mydir (folder, symlink to /opt/mydir")
instead of:
  "mydir"
This is consistent with dolphin's behavior on regular files, and
DolphinPart already does that (DolphinPart::slotRequestItemInfo has no
special cases for folders).

CCBUG: 260717
REVIEW: 112106
2013-08-18 22:16:30 +02:00
Fabio D'Urso bfb10355c9 dolphin: Show full file info in statusbar when only one file is selected
The purpose of this change is to give the user a chance to see hover
file information if it doesn't fit in the status bar, by allowing to
click on the file and hover on the status bar.

As it's now possible to have status bar texts starting with "<qt>",
DolphinPart::updateStatusBar() must escape strings. Otherwise,
filenames such as "<qt>Tes<font color=red>t" would be rendered as HTML
data in konqueror's status bar when selected.

BUG: 260717
FIXED-IN: 4.12.0
REVIEW: 111934
2013-08-18 22:08:28 +02:00
Emmanuel Pescosta 804e83f893 Cut the ropes between DolphinMainWindow and DolphinNewFileMenu. Error handling is now done via signals.
REVIEW: 111989
2013-08-16 20:22:33 +02:00
l10n daemon script b6477f4e65 SVN_SILENT made messages (.desktop file) 2013-08-15 03:59:57 +00:00
Frank Reininghaus 6bfa0ccfc7 Merge remote-tracking branch 'origin/KDE/4.11' 2013-08-15 00:15:51 +02:00
Frank Reininghaus 7c99a9c2ad Make sure that the sort order is correct after renaming
KFileItemModel::setData() should not only cause a resorting when the
sort role is changed. The name is always used as a fallback if the sort
role of multiple files is equal, therefore, renaming a file can change
the correct order of the files even if the files are not sorted by
"name".

Unit test included.

BUG: 323518
FIXED-IN: 4.11.1
REVIEW: 111721
2013-08-15 00:07:43 +02:00
Frank Reininghaus 59723fca41 Do not store default values in QHash<QByteArray, QVariant>
Storing values which are equivalent to default-constructed QVariants
does not make much sense because QHash::value returns the same value
even if the corresponding key is not found in the hash.

This commit reduces Dolphin's memory consumption in large folders by
up to 7.3% (tested a folder with 100,000 files in Details View) and
reduces the time required for loading a folder.

BUG: 323517
FIXED-IN: 4.11.1
REVIEW: 111922
2013-08-14 23:57:51 +02:00
Frank Reininghaus fd5ba3b4b2 Fix slow scrolling when hidden files or symbolic links are shown
The problem was that we drawed the overlays using KIconLoader, which can
be very slow, every time an item appeared on the screen. This commit
makes sure that not only the icon, but the icon including overlays is
cached in QPixmapCache. Therefore, the overlay drawing is done just once
for each icon+overlays combination.

For previews, the overlay drawing is done in KFileItemModelRolesUpdater
just after the preview is received.

BUG: 310662
BUG: 314339
FIXED-IN: 4.11.1
REVIEW: 111956
2013-08-14 23:44:57 +02:00
Frank Reininghaus 7e5b7d5626 Fix crash when disabling "Show in groups"
The problem was that items are removed from m_visibleGroups while
a QMutableHashIterator iterates over this hash, such that the iterator
can become invalid. The solution is to use a QHashIterator instead,
which takes a copy of the hash. Therefore, it is not affected if
m_visibleGroups is modified in any way.

BUG: 323248
FIXED-IN: 4.11.1
REVIEW: 111919
2013-08-14 23:40:02 +02:00
Frank Reininghaus 68520f55f0 Merge remote-tracking branch 'origin/KDE/4.11' 2013-08-08 23:39:28 +02:00
Fabio D'Urso 87f8303023 dolphin: Escape text in statusbar tooltip
This fixes the same issue as 4450f8449a,
but for the status bar's tooltip text.

BUG: 323170
FIXED-IN: 4.11.0
REVIEW: 111836
2013-08-05 02:12:09 +02:00
Fabio D'Urso 254ab4b579 DolphinPart: Use Qt::convertFromPlainText instead of Qt::escape for filenames
Unlike escape, convertFromPlainText preserves whitespace sequences

CCBUG: 321778
REVIEW: 111835
2013-08-05 01:47:23 +02:00
Frank Reininghaus 6524bf701a Introduce a new signal "groupsChanged"
Sometimes when items are renamed, the order of the items in the
directory is not affected, but the groups still change (simple example:
with files a, b, c, e, rename "c" to "d"). At the moment, we always emit
the itemsMoved signal in such a case to make sure that the view is
updated. However, it would be preferable if this signal was not emitted
because it can trigger some quite expensive operations which are not
needed at all.

This commit introduces a new signal groupsChanged and modifies
KFileItemModel and KItemListView such that these classes make use of it.
Some unit tests for the new functionality are included as well.

Thanks to Emmanuel Pescosta for finding a latent bug in the code which
was triggered by this change and fixed in
998954db6d.

REVIEW: 111808
2013-08-04 22:20:37 +02:00
Frank Reininghaus bedf1db916 Fix possible out of range error inKItemListSizeHintResolver::itemsMoved
The function assumes implicitly that the moved range always starts with
the index 0. This is indeed the case at the moment, but it might make
sense to change that in the future. This commit prevents that we get an
out of range problem then.

Thanks to Emmanuel Pescosta for finding this problem, see
https://git.reviewboard.kde.org/r/111808/
2013-08-04 21:46:08 +02:00
Frank Reininghaus 6467358eef Merge remote-tracking branch 'origin/KDE/4.11' 2013-08-04 21:28:04 +02:00
Frank Reininghaus 8bf4aab73e Add some unit tests for grouping in KFileItemModel
Hopefully, this will prevent regressions in the future.

REVIEW: 111807
2013-08-04 21:08:57 +02:00
Frank Reininghaus 3f0ed8c44a Make KFileItemModelTest faster
The 500 ms timeout before items are resorted does not make much sense in
the unit test. Removing this delay makes the test run much faster.
2013-08-04 21:04:56 +02:00
l10n daemon script c03e7a3272 SVN_SILENT made messages (.desktop file) 2013-08-04 04:16:50 +00:00
Frank Reininghaus 4e67f53f1c Do not enable the "Create New..." menu when a search is finished
BUG: 321577
FIXED-IN: 4.12.0
REVIEW: 111805
2013-07-31 19:19:30 +02:00
Frank Reininghaus b86388f9c6 Do not allow that panels are dragged out of the main window
This feature might have been useful in some cases, but it's most likely
not useful enough to justify that we accept the bugs that it causes.
Even though some of these bugs are not Dolphin's fault at all, they
cause serious problems for users in some cases.

I'm pushing this commit to master only because I prefer to not push such
behavior changes to 4.11 at this point of the release cycle.

BUG: 288629
CCBUG: 322299
CCBUG: 322812
FIXED-IN: 4.12.0
REVIEW: 111692
2013-07-29 23:22:02 +02:00
Frank Reininghaus 8552eb5d75 Merge remote-tracking branch 'origin/KDE/4.11' 2013-07-29 23:16:58 +02:00
Frank Reininghaus 09bf5b66dc When pasting a folder and expanding it, do not select its children
Thanks to Emmanuel for pointing out a problem with my first patch.

BUG: 322965
FIXED-IN: 4.11.0
REVIEW: 111722
2013-07-29 23:15:49 +02:00
Fabio D'Urso 29013ed214 Don't let HTML-like filenames be interpreted as HTML strings
So that filenames that look like HTML don't get fancy-formatted when
we show info about them (i.e. on hover)

This patch fixes the same issue in two places:
 - dolphin, by setting Qt::PlainText on the status bar's label
 - konqueror, by escaping setStatusBarText strings emitted by
   DolphinPart

BUG: 321778
FIXED-IN: 4.11.0
REVIEW: 111746
2013-07-29 11:21:55 +02:00
Frank Reininghaus 15107c780c Do not convert a KUrl to a QString and back again
This small change saves a lot of CPU cycles when the items are resorted.

REVIEW: 111700
2013-07-28 23:36:43 +02:00
Emmanuel Pescosta 32bf4827c4 Don't open .desktop files with http:/https: urls in Dolphin,
open these urls in the default browser instead.

BUG: 283475
BUG: 318217
FIXED-IN: 4.11.0
REVIEW: 111674
2013-07-26 15:05:40 +02:00
Frank Reininghaus 611c935e03 Merge remote-tracking branch 'origin/KDE/4.11' 2013-07-25 22:35:37 +02:00
Frank Reininghaus 55a989626d Fix maximum value for scroll bar when deleting items in Details View
The problem was that the view heigt minus the header height was
subtracted from maximumScrollOffset() to determine the maximum value
of the scroll offset of the top of the view.

However, the top of the view is the part that is hiden behind the
header. Therefore, the full view height must be subtracted from
maximumScrollOffset.

The remaining bits of bug 319951 were fixed by other recent commits.

Thanks to Emmanuel Pescosta for helping to track down the problem!

BUG: 319951
FIXED-IN: 4.11.0
REVIEW: 111486
2013-07-25 22:25:18 +02:00
Frank Reininghaus 08c2f7f5fb Prevent that removing items can cause icons to overlap
When items are removed, new items may become visible because of that.
This includes

(a) Items *behind* the removed range. KItemListView may try to create
    their widgets at their "imaginary" old positions and move them to
    the new position with an animation.

(b) Items *before* the removed range, if the deletion causes the view
    to scroll up. In that case, the "imaginary" old position and the new
    position was equal, but KItemListView still tried to determine the
    "old" position by adding the number of removed items to the index.
    The result was that the widgets were created at completely wrong
    positions, and no animation was started to fix this.

Thanks to Emmanuel for helping to find the cause of this bug!

BUG: 302373
FIXED-IN: 4.11.0
REVIEW: 111630
2013-07-25 22:15:19 +02:00
l10n daemon script f89b412a8a SVN_SILENT made messages (.desktop file) 2013-07-25 06:33:03 +00:00
l10n daemon script 5e96822ee3 SVN_SILENT made messages (.desktop file) 2013-07-25 03:57:05 +00:00
Frank Reininghaus 3991e9d24e Make sure that widgets are initialized when changing the view mode
The problem was that DolphinItemListView overrides the virtual function
onItemLayoutChanged() without calling the base class implementation.
Therefore, KStandardItemListView::updateLayoutOfVisibleItems(), which
calls initializeItemListWidget(), is never called.

This patch refactors the "change item layout"/"supports item expanding"
code a bit to make it more robust and fix the problem that the view
looks "messed up" when switching from Details View without expandable
folders to Icons View.

I'm only pushing this patch to master (going to be KDE 4.12).
The patch is a bit too intrusive for the KDE/4.11 branch for my taste
at this point of the release cycle, and the bug is not a real
showstopper. If it works well in master, one could consider backporting
it to a 4.11.x bug fix release.

Thanks to Emmanuel Pescosta for helping to analyze this issue.

BUG: 302703
REVIEW: 111632
FIXED-IN: 4.12.0
2013-07-24 22:31:48 +02:00
Frank Reininghaus 0ad86983f4 Do not try to smooth-scroll past the end of the view
KItemListSmoothScroller::scrollTo(qreal position) did not check if
'position' is a valid value. Even if the view is scrolled to the bottom
already, it tried to scroll further and activated "smooth scrolling"
when the mouse wheel is used. Because it never got out of the "smooth
scrolling" state then, it got confused when changing the directory, and
restoring the correct scroll offset could fail.

BUG: 322212
FIXED-IN: 4.11.0
REVIEW: 111557
2013-07-22 19:16:07 +02:00
Frank Reininghaus 9d6d998a51 Fix "truncated header" in Details View with non-Oxygen styles
The code for painting the "empty header" was inconsistent with the
headers of the other columns, which is probably the reason why the other
styles got confused

a) No QStyleOptionHeader is used
b) Even if an empty header must be drawn, the last column is drawn with
   the option QStyleOptionHeader::End.

According to Christoph, it still doesn't work with the Skulpture style,
but it seems that the patch does at least not make things worse.

BUG: 301800
FIXED-IN: 4.11.0
REVIEW: 111608
2013-07-22 19:04:14 +02:00
Frank Reininghaus 0f853681ab Fix build if HAVE_NEPOMUK is not defined
We really have to make nepomuk-core and nepomuk-widgets a hard
dependency in the framworks era.
2013-07-18 22:51:21 +02:00
Emmanuel Pescosta aa2dda8cb4 Overwrite the changed role value with an empty QVariant,
because the nepomuk roles provider doesn't overwrite it when the property
value list is empty.

BUG: 322348
REVIEW: 111505
FIXED-IN: 4.11.0
2013-07-18 17:07:34 +02:00
Frank Reininghaus 63b26cbf2c Load unknown icons for items just before showing items in the view
Rather than loading many icons (without full mime type determination)
in advance, we make sure that an item has an icon just before it is
shown in the view. This makes sure that no "unknown" icons are shown
unnecessarily, and saves some resources.

REVIEW: 111396
2013-07-12 08:27:05 +02:00
Frank Reininghaus 6028bd7cf6 Fix O(N^2) complexity issue in KItemListView::slotItemsRemoved()
If many item ranges are removed, KItemListView::slotItemsRemoved()
could take very long because it looped over all items after the first
removed one for every removed range, even if most of these items are
not visible at all.

This commit improves this by just looping over the visible items (whose
number is limited by the window size) for each range.

Test case (for very large N):

touch {1..N}.png
touch {1..N}.jpg

(wait until all files are shown in the view)

rm *.jpg

REVIEW: 111398
2013-07-05 19:51:14 +02:00
Frank Reininghaus 837be34333 Keep the "item size hints" of moved items
It's quite expensive to re-calculate them, so we should better just move
them to the correct position, rather than throwing them away.

REVIEW: 111399
2013-07-05 19:42:39 +02:00
Frank Reininghaus 786cea0076 Make sure that KItemListSizeHintResolver is always consistent
This was the root cause of bug 317827. The assert tried to make sure
that we never access KItemListSizeHintResolver from
KItemListViewLayouter inside the loop over the item ranges. This would
be dangerous because it might be in an inconsistent state - the removed
item ranges were removed step by step, so accessing the item size hints
before the operation was finished could lead to wrong results.

The solution is to insert/remove all item ranges immediately. A nice
side effect is that there are no sources of O(N^2) complexity in
KItemListSizeHintResolver any more if many item ranges are
inserted/removed.

BUG: 317827
FIXED-IN: 4.11.0
REVIEW: 111382
2013-07-04 23:35:01 +02:00
Frank Reininghaus 508661100f Fix crash when dropping URLs on the URL navigator's drop down menus
The problem was that the files were copied/moved inside the nested event
loop of the drag, which caused problems if the "File exists" dialog was
shown.

The solution is to make the copy/move operation delayed, such that it is
executed in the main event loop.

Note that dropping files on these menus does apparently not work at the
moment when using the Oxygen style (see bug 310016).

BUG: 192139
BUG: 256338
BUG: 293220
BUG: 309076
FIXED-IN: 4.11.0
REVIEW: 111273
2013-07-02 19:27:06 +02:00
Frank Reininghaus 4ff5ae361d Make it clear that the Trash/Delete confirmations apply to all KDE apps
FIXED-IN: 4.11.0
REVIEW: 111324
2013-07-02 19:18:43 +02:00
Frank Reininghaus 82ea33762f Prevent some unnecessary layoutings when the view size is changed
In Icons/Details (Compact) View, no layouting is necessary if the view
height (width) changes.

REVIEW: 111322
2013-07-02 19:13:43 +02:00
Frank Reininghaus 2a612e12ce Replace QList by QVector if the elements are larger than a pointer
If the elements are larger than a pointer, QList does not store the
elements themselves, but pointers to them in a contiguous block of
memory. This wastes quite a bit of memory. This can be prevented easily
by using QVector instead.

REVIEW: 111304
2013-06-30 14:26:24 +02:00
Vishesh Handa dedebed468 Dolphin: Use the Nepomuk2::FileMetaDatConfigWidget
Instead of the KFileMetaDataConfigurationWidget

REVIEW: 111294
2013-06-29 03:38:09 +05:30
Frank Reininghaus 7799bf1828 Fix memory leak in KFileItemModel
Since m_pendingItemsToInsert is a list of pointers now (and not a list
of KFileItems, as in the 4.10 branch), we have to delete all pointers
when clearing or destroying the model.

I think that no review request is necessary for this small and obvious
change.

CCMAIL: emmanuelpescosta099@gmail.com
2013-06-28 21:39:35 +02:00
Emmanuel Pescosta 5ca5a8f3b6 Remove the space (1 pixel) between the file name and the file
icon in Compact View and Details View mode.

BUG: 320899
FIXED-IN: 4.11.0
REVIEW: 111244
2013-06-26 22:07:57 +02:00
Emmanuel Pescosta 391d36edf7 Re-enable expandable folders for network top level folders (remote:/)
Added a hash table for target url to url mapping. So when the dir lister
sends us the target url as directory url, we can use the url mapping table
to get the right "Dolphin internal" directory url, which is the non-target url.

BUG: 306219
FIXED-IN: 4.11.0
REVIEW: 111252
2013-06-26 22:04:52 +02:00
Emmanuel Pescosta 1634501b0e Fix the "dropped files are not selected" regression that has
recently been brought up and that have been caused by review 107351 / commit
fd65a97b07

CCBUG: 233335
FIXED-IN: 4.11.0
REVIEW: 111254
2013-06-26 22:00:09 +02:00
Frank Reininghaus 913e49e915 Merge remote-tracking branch 'origin/KDE/4.10' 2013-06-26 21:26:21 +02:00
Frank Reininghaus 559fdae18f Use the KDE SC version also as the Dolphin versions
This has some advantages:

(a) The version actually changes for every bug fix release, making it
    easier to find out which version a bug reporter has used.

(b) No changes in Dolphin's source code are required to keep the version
    always up to date.

(c) It is more transparent for users because there are not two different
    versions any more.
2013-06-26 21:24:15 +02:00
Frank Reininghaus d72ce53141 Fix performance regression when loading folders in Details View
When using Details View, only insert all pending items immediately if
new items are inserted which might be children of a pending item. Fixes
the problem that inserting the items in multiple bunches slows down the
folder loading.

Note that the cause of the slowness when inserting in multiple bunches
is that KItemListSizeHintResolver needs O(N^2) time in the worst case
for inserting N items into a model with N existing ones.

REVIEW: 111226
2013-06-26 21:18:37 +02:00
Kai Uwe Broulik bbbf039338 Improve filterbar lock button.
Use object-(un)locked icon and make it flat.

REVIEW: 111233
2013-06-26 11:27:01 +02:00
Vishesh Handa 4c99efe4d2 Dolphin Search Date: Set the proper date
QDate's api is not that intuitive and the addDays functions return a
QDate with those amount of days. They do not modify the original QDate.

BUG: 321198
2013-06-26 01:32:33 +05:30
Dawit Alemayehu d72f5d2db7 Do not show "Move To Trash" action in context menu for remote URLs.
BUG: 261762
REVIEW: 111206
FIXED-IN: 4.11
2013-06-24 22:41:53 -04:00
Frank Reininghaus 51b978f7fd Merge remote-tracking branch 'origin/KDE/4.10' 2013-06-24 22:02:04 +02:00
Emmanuel Pescosta aebe7a9010 Use the target url of a item when creating the QMimeData in KFileItemModel::createMimeData.
BUG: 307336
FIXED-IN: 4.10.5
REVIEW: 111209
2013-06-24 11:11:37 +02:00
Frank Reininghaus b4dc66e27f Prevent possible infinite recursion in ViewProperties
If each directory can have its own view properties, and loadting the
.directory file fails in a directory, we have to load the global view
properties. However, if we try to do this by changing the "global view
properties setting" and loading the view properties for the same
directory again, we might get an infinite recursion if changing the
setting fails.

We now force a loading of the global view properties by constructing a
new ViewProperties object with an empty URL.

Thanks to Kurt Hindenburg for helping to debug this issue (which was
only reproducible on MacOS).

BUG: 316209
FIXED-IN: 4.10.5
REVIEW: 111182
2013-06-23 10:01:24 +02:00
Vishesh Handa e715b9a8a4 Dolphin Nepomuk Roles: Handle values which are resource lists
It is common for music files to have more than one artist

BUG: 321359
2013-06-22 19:06:22 +05:30
Vishesh Handa 8188c70a00 Remove knepomukdatamanagement_export.h
It is no longer required. In fact it hasn't been required since
nepomuk-core was introdcued.
2013-06-22 19:06:22 +05:30
Emmanuel Pescosta a18550fb76 Update the "Move to Trash" action's and the "Delete" action's
enabled state in the context menu for read only files/folders (also
archives).

BUG: 294013
FIXED-IN: 4.11
REVIEW: 111160
2013-06-22 14:04:45 +02:00
Frank Reininghaus 5a647117ab Make sure that changing the view mode does not fail
This commit ensures that changing the view mode works even if the
.directory file in the user's KDE folder is not writable.

BUG: 318534
FIXED-IN: 4.11.0
REVIEW: 111120
2013-06-22 09:27:37 +02:00
Frank Reininghaus 0d6bf03598 Enable KIO error reporting when renaming with the dialog
The problem was that the KonqOperations object did not have the right
parent.

BUG: 299646
FIXED-IN: 4.11.0
REVIEW: 111111
2013-06-22 09:19:27 +02:00
Vishesh Handa 5778e10e9b Dolphin: Do not try to connect to Nepomuk if it is not running
Each time one uses any of the Nepomuk classes, an attempt is made to
connect to the database. This slows down the application since
connecting to Nepomuk is not so cheap.

BUG: 321299
2013-06-22 04:31:15 +05:30
Sune Vuorela 7a7cfa6add Revert "Hide context menu plugins unless enabled by default or by the user"
This reverts commit b1aebb44d6.

As agreed with Frank on k-c-d.
2013-06-21 10:37:52 +02:00
Frank Reininghaus a05db2f0d0 Merge remote-tracking branch 'origin/KDE/4.10' 2013-06-20 19:44:06 +02:00
Frank Reininghaus e8c4d19b7c Allow renaming multiple files without number if extensions are different
Normally, we only allow renaming multiple files if the new file name
contains a contiguous sequence of '#' placeholders, which are then
replaced by numbers.

However, if all extensions are different, we can also rename the files
without such a placeholder because the original extension is preserved
when renaming.

This had been possible some time ago already. That this "accidental
feature" was lost was a side effect of the fix for bug 318942.

BUG: 321234
FIXED-IN: 4.10.5
REVIEW: 111079
2013-06-20 19:37:53 +02:00
Frank Reininghaus 7496f007cc Make it possible to select files like "a_b" using keyboard search
The problem was that pressing the Shift key would reset the keyboard
search.

BUG: 321286
FIXED-IN: 4.11.0
REVIEW: 111102
2013-06-20 19:32:25 +02:00
Frank Reininghaus 51f2bdaeab Hide the "drop" indicator when an item is not hovered any more
This fixes the problem that the drop indicator might still be shown
after the drag&drop operation in the Places Panel is finished.

REVIEW: 111037
2013-06-20 19:29:10 +02:00
Frank Reininghaus 6db55f5443 Some simplifications in KFileItemModelRolesUpdater
This removes some things that are obsolete after the recent commits:

(a) resolveNextPendingRoles() is not called any more when the preview
    job is running.

(b) In applyResolvedRoles(), we always load the icon if it isn't known
    yet. This ensures that every item has an icon.

REVIEW: 111012
2013-06-20 19:23:43 +02:00
Frank Reininghaus eda483436b Try to do at least a "fast" icon loading for all items
If all icons for the visible items could be loaded in 200 ms, we
continue loading icons without mime type determination for all items
until the 200 ms are over. This reduces the risk that the user ever
sees "unknown" icons.

REVIEW: 111011
2013-06-20 19:22:24 +02:00
Emmanuel Pescosta 0c0c86f220 Avoid a unnecessary resorting when items are changed, only resort the items when the sorting role value is changed.
BUG: 299565
FIXED-IN: 4.11
REVIEW: 111146
2013-06-20 19:19:47 +02:00
Frank Reininghaus 015957c5a2 Make sure that all visible items have an icon
We try to determine "final" icons, i.e., icons with known mime type,
for 200 ms. If this does not succeed, we at least load "fast" icons,
i.e., load the icons without determining the mime type.

REVIEW: 111009
2013-06-20 19:13:35 +02:00
Emmanuel Pescosta 584574e07d Prevent the selection rectangle from being reduced to 0px
width or 0px height, so the selected items can not be accidently
unselected when the rectangle width/height becomes 0px.

BUG: 320897
REVIEW: 111144
FIXED-IN: 4.10.5
2013-06-20 19:02:06 +02:00
Frank Reininghaus 4b8c4124cb Simplify handling of preview jobs
This patch changes two things about the way we handle the preview jobs:

(a) Rather than passing a KFileItemList to startPreviewJob(),
    remembering the leftovers in the member variable
    m_pendingPreviewItems and then starting a new preview job for
    these, we append items that need a preview to this member, and let
    startPreviewJob() take its input from there. This simplifies the
    code greatly.

(b) To prevent that we start preview jobs with just one item and also
    that the GUI is frozen too long by startPreviewJob(), we take the
    following approach:

    * If the mime type of the first pending item is known, the function
      has probably been called by startUpdating(), which has determined
      mime types for the visible items already. startUpdating() has
      also blocked the GUI, so we just take all items at the beginning
      of the list with known mime type, and do not do any expensive
      mime type determination in startPreviewJob().

    * If the mime type of the first pending item is unknown, the
      function has probably been called by slotPreviewJobFinished(). In
      that case, we can afford to block the GUI for a short while, so
      we determine mime types for 200 ms.

REVIEW: 111008
2013-06-20 18:10:07 +02:00
Dawit Alemayehu fda88516e9 Merge remote-tracking branch 'origin/KDE/4.10' 2013-06-20 08:41:12 -04:00
Frank Reininghaus 030acf4f11 Do not use fixed widths for the widgets in the status bar
This fixes the problem that the Dolphin window has a rather large
minimum size. A side effect of this was that splitting the view could
resize the window (because twice the minimum status bar width was
needed then).

BUG: 319373
REVIEW: 110966
FIXED-IN: 4.10.5
2013-06-18 17:46:51 +02:00
Frank Reininghaus 75ed1946f8 Ensure that the "Sort by Type" setting is respected
Before this commit, switching from, e.g., "Sort by Name" to "Sort by
Type" sometimes had no effect until the view was refreshed. The problem
was that the re-sorting was triggered before the type information was
actually added to the model.

BUG: 310705
BUG: 312014
FIXED-IN: 4.10.5
REVIEW: 111004
2013-06-18 17:39:56 +02:00
Frank Reininghaus bc9f7b8527 Remove trailing white space 2013-06-13 23:34:39 +02:00
Frank Reininghaus 1eea832d13 Fix "unused parameter" warning
We don't need the parameter at all, so let's just remove it.
2013-06-13 23:32:01 +02:00
Frank Reininghaus e8c3df5f60 Merge remote-tracking branch 'origin/KDE/4.10' 2013-06-10 21:40:41 +02:00
Frank Reininghaus 9cf54dcc02 Do not rename files unexpectedly when changing the URL
This is the real fix now - note that the last commit
4de9a23364 was actually the fix for bug
320823. Somehow, I have messed up the local branches in my git
respository clone - sorry for the confusion!

BUG: 319912
FIXED-IN: 4.10.5
REVIEW: 110908
2013-06-10 21:32:31 +02:00
Frank Reininghaus 15b34a0d05 Do not rename files unexpectedly when changing the URL
If the role editor loses focus, it considers the current renaming
operation finished, and tells DolphinView to rename the file. This is a
problem when changing the directory, because the URL change happens
before DolphinView receives the signal, which results in a file in the
new directory being renamed unexpectedly.

The solution is to establish the connection to the
slotRoleEditingFinished signal only when the "rename inline" editor is
opened, and disconnect it when renaming is finished or canceled or the
URL changes.

BUG: 319912
FIXED-IN: 4.10.5
REVIEW: 110908
2013-06-10 21:19:56 +02:00
Emmanuel Pescosta 7c4d91c465 Fix Bug 319119 - Dolphin doesn't notice when renaming failed
Change the data in the model before the real renaming is done by KonqOperations::rename(),
but when the rename operation fails, revert the data changes in the model.

BUG: 319119
REVIEW: 110922
2013-06-10 11:16:21 +02:00
Frank Reininghaus ca6e6a342e Do not delete files when Shift-clicking "Trash"
Thanks to Dawit Alemayehu for making this fix possible with commit
8e023ae9e5 !

BUG: 307254
FIXED-IN: 4.11.0
2013-06-09 11:53:59 +02:00
Frank Reininghaus bd88f237b1 Remove unused argument
I saw a runtime warning from QMetaObject::invokeMethod() that KJob* is
not a registered type. Since we don't use that argument in
slotPreviewJobFinished(KJob*) anyway, it's best to remove it.
2013-06-07 09:24:24 +02:00
Frank Reininghaus 39c7c343cf Ignore a changed item if it cannot be found in the model
This prevents repeated attempts to reload the data for the non-existing
item. This was the root cause of bug 320791.

Thanks to Hrvoje Senjan and Jekyll Wu for testing the new code and
finding this bug!

BUG: 320791
2013-06-06 10:00:47 +02:00
Frank Reininghaus f114564523 Make calls to resolveNextPendingRoles and resolveNextSortRole delayed
This prevents that functions that call these indirectly call themselves
recursively and cause trouble.

BUG: 320791
2013-06-06 08:49:12 +02:00
Frank Reininghaus e7a9d5590b startPreviewJob: if items is empty, delay call to slotPreviewJobFinshed
This should prevent that other functions, which start preview jobs,
eventually call themselves and thus cause trouble.

CCBUG: 320791
2013-06-06 08:38:58 +02:00
Frank Reininghaus 2bdc5eff54 KFileItemModelRolesUpdater: waste less ressources and fix some bugs
The main change in this commit is that we do not determine expensive
roles (like previews, mime types, etc) for all items, but only for the
visible ones and those close to the visible area or on the first and
the last page of the view.

This prevents that the CPU and hard drive are kept busy for quite some
time after entering a folder while all items are handled asynchronously.

There is one known problem at the moment: when sorting by "Type" or
another role that can be resolved by KFileItemModelRolesUpdater, the
icons of the visible items are sometimes not loaded while the sorting is
still in progress. I will try to fix this issue during the next few
days.

REVIEW: 110839
2013-06-05 23:31:01 +02:00
Frank Reininghaus c6494823c8 Reduce KFileItemModel memory usage by making use of implicit sharing
The idea is based on
http://milianw.de/blog/katekdevelop-sprint-vienna-2012-take-1

REVIEW: 110686
2013-06-05 23:18:26 +02:00
Weng Xuetian 9ec8c3b790 move focus to another view upon drop
When user drag and drop to another splitted view, the view will be activated,
thus if user close the split view, the view will be closed, while this is
usually the case when user copy file to remote/removable media.

REVIEW: 110167
CCBUG: 312834
2013-06-05 17:07:31 -04:00
Emmanuel Pescosta 616294bc80 Bug 196035 - middle clicking on archive files in dolphin does not open them in a new tab
When 'browse through archives' is enabled, open archive files
like folders on middle clicking, context menu -> new tab action
and context menu -> new window action.

BUG: 196035
REVIEW: 110487
2013-06-04 15:27:45 +02:00
Vishesh Handa 780327f7d3 Dolphin Search: Do not use Nepomuk for hidden folders
Nepomuk does not index hidden folders

BUG: 318442
REVIEW: 110697
FIXED-IN: 4.11.0
2013-05-29 20:13:10 +05:30
Frank Reininghaus ae415dcebd Hide context menu plugins unless enabled by default or by the user
REVIEW: 110685
2013-05-29 07:48:11 +02:00
Vishesh Handa 844738fb91 PlacesModel: Only allow folders to be pinned
It makes no sense to pin files. Plus the old
PlacesModel from kdelibs had the same behaviour.

REVIEW: 110347
2013-05-28 21:52:01 +05:30
Vishesh Handa c69ebd1e0c PlacesPanel: Do not allow drop events into timeline or search folder
They are read only. You cannot modify them, so it makes no point showing
the "Move/Copy Into" context menu.

REVIEW: 110348
2013-05-28 21:21:27 +05:30
Thomas Lübking c756bc6c89 set KItemListView palette from scenes first view
REVIEW: 110505
2013-05-25 14:20:43 +02:00
Emmanuel Pescosta 45c659b440 Added the "Open in new Tabs" action to the Dolphin Context menu.
BUG: 312296
REVIEW: 110371
FIXED-IN: 4.11.0
2013-05-22 21:47:14 +02:00
Stuart Citrin 7c9808ef5d Filter bar: add a button that prevents clearing if the URL changes
FEATURE: 256651
FIXED-IN: 4.11.0
REVIEW: 107392
2013-05-22 18:48:00 +02:00
Frank Reininghaus 04e825d022 Merge remote-tracking branch 'origin/KDE/4.10' 2013-05-22 18:34:25 +02:00
Frank Reininghaus bf85483c99 KFileItemModel::insertItems(): guarantee O(N) run time complexity
This commit prevents repeated insertions of single items into the list
m_itemData, which shift all following items by one position and result
in O(N^2) worst case complexity for the entire function.

Moreover, the hash m_items is updated only for the items starting from
the first inserted/removed item to save some superfluous calculations
of hash values.

REVIEW: 110355
2013-05-22 18:27:44 +02:00
Frank Reininghaus 2f51debbea Do not reset the 'isExpanded' state when an expanded folder is refreshed
If an item is moved out of an expanded folder, the model receives the
dir lister's refreshItems signal for the folder. The method
retrieveData() then updates the folder's properties. This commit makes
sure that the 'isExpanded' state is not touched by retrieveData(). A
side-effect is that the 'isExpanded' role is not initialized to 'false',
but this does not matter because trying to read a non-existing role from
the QHash<QByteArray, QVariant> yields a default-constructed QVariant,
which evaluates to 'false'.

BUG: 299675
FIXED-IN: 4.10.4
REVIEW: 110401
2013-05-22 18:14:38 +02:00
Frank Reininghaus e66c3221ce KFileItemModelRolesUpdater: only update the size for changed folders
When using inotify, we also receive signals for modified files, even if
we only ask KDirWatch to watch the directory containing them. In that
case, we must not set the size to -1 (which means "unknown number of
items" for folders) temporarily, or we end up with an apparent file size
of 2^64 - 1 bytes.

BUG: 309740
FIXED-IN: 4.10.4
REVIEW: 110428
2013-05-22 18:09:42 +02:00
Dawit Alemayehu 01761798a9 - Factored out the Delete/Move To Trash action into own class.
- Updated both the Dolphin KPart and context menu to use the new
  DolphinRemoveAction class to manage "Delete/Move to Trash" actions.

See also https://git.reviewboard.kde.org/r/107509/.

REVIEW: 108802
2013-05-14 08:37:21 -04:00
Dawit Alemayehu 799641859e Merge remote-tracking branch 'origin/KDE/4.10' 2013-05-14 08:36:11 -04:00
Vishesh Handa fffbb5b583 DolphinSearchBox setReadOnly: Update if either of the parameters change
This way when another read only query is added, the internal state is
changed and the search label gets updated.

REVIEW: 110324
BUG: 315796
FIXED-IN: 4.10.4
2013-05-13 14:40:39 +05:30
Vishesh Handa cc4947d1ac Dolphin Places: Make it easier to drag and drop items
When doing a drop, a check is performed to see if it is within x pixels
from the top or x pixel from the bottom of the rect. If it is, then the
drop is considered a drop between items.

This x was fixed to qMax( 4, myStyleOption.padding ) which would
generally be 4. This is fine for some cases, but when the rectangle size
increases then this 4 pixels is not enough. Hence this 'x' is now being
set to 30% of the rectangle height.

By default the rectangle height is 20 pixels, so x is now 6 instead of 4
in the default case, which does make it slightly easier.

Also, this in-between-items check is only performed when moving from one
item to another. This is not good since if you enter the item and the
bottom, the indicator is shown, and then as to start moving it up it
stops showing, and then it should start showing again as you approach
the top edge.

Modified the code to run the check on every mouse drag event even if the
hovered item has not changed.

Both these changes combined make it much easier to drag and drop items.

REVIEW: 110342
2013-05-13 14:39:23 +05:30
Frank Reininghaus 10857727ec Make error message translatable 2013-05-12 10:38:22 +02:00
Frank Reininghaus 600166152d Merge remote-tracking branch 'origin/KDE/4.10' 2013-05-12 10:04:01 +02:00
Frank Reininghaus 63e2513abe Hide the message widget when the URL changes
Most error messages are only relevant when trying to open a URL, e.g.,
they inform the user that opening the URL failed. After the next
successful URL change, these errors are not relevant any more.
Therefore, it makes sense to hide the message widget automatically to
prevent that the user is forced to close it manually.

BUG: 312872
FIXED-IN: 4.11.0
REVIEW: 110369
2013-05-12 10:01:01 +02:00
Frank Reininghaus 3924b10b62 Fix unit test failure
The recent commit 022b564831, which added
a few source files to kitemlistcontrollertest, caused a crash in that
test - an assert was hit because now a different virtual method was
called in one place (KStandardItemListView::initializeItemListWidget()),
and qobject_cast could not cast the 'item', which is of type
KFileItemListWidget, to its base class KStandardItemListWidget. Adding
the source file kfileitemlistwidget.cpp fixes this.

CCMAIL: ps_ml@gmx.de
2013-05-12 09:34:05 +02:00