]> cloud.milkyroute.net Git - dolphin.git/log
dolphin.git
12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Sat, 26 Oct 2013 07:30:18 +0000 (09:30 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoFix broken view state restoration
Frank Reininghaus [Sat, 26 Oct 2013 07:24:04 +0000 (09:24 +0200)]
Fix broken view state restoration

The fix for bug 161385 (which was about Dolphin still showing an empty
view if a device that had been unmounted earlier was clicked in the
Places Panel) caused a regression: the view state (current item, scroll
position, Details View expansion state) was not restored any more when
going "Back".

The reason is that "m_view->reload()" in
DolphinViewContainer::setUrl(const KUrl& newUrl) was always executed
just after entering a directory, and that command overwrites this
information.

Distinguishing between "change URL" and "reload the view" works better
if it's done in DolphinMainWindow instead of DolphinViewContainer.

BUG: 326039
FIXED-IN: 4.11.3
REVIEW: 113290

12 years agoTwo small simplifications in KItemListViewLayouter
Frank Reininghaus [Wed, 16 Oct 2013 21:01:54 +0000 (23:01 +0200)]
Two small simplifications in KItemListViewLayouter

1. Remove the unneeded variable rowCount.

2. Simplify the calculation of the member m_maximumScrollOffset. We can
   just use the current value of "y" because this is the offset that
   the next row would have.

REVIEW: 113233

12 years agoAbort loading the current URL if the user presses Escape
Frank Reininghaus [Wed, 16 Oct 2013 20:37:50 +0000 (22:37 +0200)]
Abort loading the current URL if the user presses Escape

BUG: 323181
FIXED-IN: 4.12.0
REVIEW: 113234

12 years agoMake it build with QT_STRICT_ITERATORS
Kevin Ottens [Wed, 16 Oct 2013 17:24:01 +0000 (19:24 +0200)]
Make it build with QT_STRICT_ITERATORS

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
David Faure [Tue, 15 Oct 2013 07:08:47 +0000 (09:08 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoFix crash when triggereing the "Compare files" action via D-Bus
Frank Reininghaus [Sun, 13 Oct 2013 08:55:21 +0000 (10:55 +0200)]
Fix crash when triggereing the "Compare files" action via D-Bus

If the number of selected items is not two, Dolphin disables this
action. However, it is still possible to trigger it via D-Bus, and this
could cause a crash in DolphinMainWindow::compareFiles() because this
function did not test at all if there are really two items selected.

This patch adds such a check and simplifies the code in that function.

BUG: 325517
FIXED-IN: 4.11.3

12 years agoFiles passed as arguments: Ignore unsupported files
Erik Hahn [Sun, 13 Oct 2013 08:44:13 +0000 (10:44 +0200)]
Files passed as arguments: Ignore unsupported files

With this patch, Dolphin ignores all files passed to it that it can't

Also, archives are now opened inside Dolphin so it can be used as an
archive manager at least for local files. If the user tries to open a
remote archive Dolphin still opens it externally; I have observed that
if it receives one as an argument, it will display a pseudo-folder that
contains only said archive. So having it set as the archive handler is
still broken, but in a less annoying way.

CCBUG: 318683
REVIEW: 113191
FIXED-IN: 4.11.3

12 years agoMoved all the extension code into dolphinpart_ext.*
Dawit Alemayehu [Fri, 16 Aug 2013 13:01:55 +0000 (09:01 -0400)]
Moved all the extension code into dolphinpart_ext.*

REVIEW: 113132

12 years agoUse the icon size from KItemListStyleOption for the width and height of the
Emmanuel Pescosta [Wed, 9 Oct 2013 17:52:53 +0000 (19:52 +0200)]
Use the icon size from KItemListStyleOption for the width and height of the
expansion area instead of KIconLoad::SizeSmall.

BUG: 325543
REVIEW: 113169
FIXED-IN: 4.12

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Mon, 7 Oct 2013 07:31:45 +0000 (09:31 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoMake the code that removes items from KFileItemModel more robust
Frank Reininghaus [Mon, 7 Oct 2013 07:26:51 +0000 (09:26 +0200)]
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

12 years agoReload the view if a previously unmounted device is mounted again
Frank Reininghaus [Mon, 7 Oct 2013 07:17:48 +0000 (09:17 +0200)]
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

12 years agoInclude "Space" in the keyboard search string
Frank Reininghaus [Mon, 7 Oct 2013 07:08:55 +0000 (09:08 +0200)]
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

12 years agoSave memory and time in KFileItemModel by lazy-loading the "ItemData"
Frank Reininghaus [Wed, 2 Oct 2013 17:08:39 +0000 (19:08 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Mon, 30 Sep 2013 22:15:04 +0000 (00:15 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoAdd unit test for the calculation of "name" groups with expanded items
Frank Reininghaus [Mon, 30 Sep 2013 22:09:25 +0000 (00:09 +0200)]
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.

12 years agoShow the right version states for expanded items.
Emmanuel Pescosta [Sun, 29 Sep 2013 16:08:06 +0000 (18:08 +0200)]
Show the right version states for expanded items.

BUG: 267171
FIXED-IN: 4.11.3
REVIEW: 112980

12 years agoMake sure that removeExpandedItems() also removes filtered items
Frank Reininghaus [Sun, 29 Sep 2013 13:45:02 +0000 (15:45 +0200)]
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

12 years agoSVN_SILENT made messages (.desktop file)
l10n daemon script [Fri, 27 Sep 2013 07:07:49 +0000 (07:07 +0000)]
SVN_SILENT made messages (.desktop file)

12 years agoSVN_SILENT made messages (.desktop file)
l10n daemon script [Fri, 27 Sep 2013 04:24:51 +0000 (04:24 +0000)]
SVN_SILENT made messages (.desktop file)

12 years agoMove KItemRange to its own header
Frank Reininghaus [Mon, 16 Sep 2013 22:11:32 +0000 (00:11 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Sat, 14 Sep 2013 13:11:17 +0000 (15:11 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoMake preview loading faster when scrolling
Frank Reininghaus [Sat, 14 Sep 2013 12:52:22 +0000 (14:52 +0200)]
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

12 years agoRemove "Copy text" statusbar contextmenu entry
Kai Uwe Broulik [Thu, 12 Sep 2013 16:45:41 +0000 (18:45 +0200)]
Remove "Copy text" statusbar contextmenu entry
REVIEW: 112355

12 years agoFix Bug 311099 - View the underscore when using Ctrl + PagDown
Emmanuel Pescosta [Thu, 12 Sep 2013 11:58:29 +0000 (13:58 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Mon, 9 Sep 2013 19:43:29 +0000 (21:43 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoAlways sort items correctly when the refreshItems() signal is received
Frank Reininghaus [Mon, 9 Sep 2013 19:38:47 +0000 (21:38 +0200)]
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 d70a4811807776966c3241a72121242f4d1eaee8. This patch fixes
it.

BUG: 324713
FIXED-IN: 4.11.2
REVIEW: 112561

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Mon, 9 Sep 2013 19:21:43 +0000 (21:21 +0200)]
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).

12 years agoTest if the groups are updated correctly when items are refreshed
Frank Reininghaus [Mon, 9 Sep 2013 19:13:38 +0000 (21:13 +0200)]
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/.

12 years agoMake expandedParentsCount() work without accessing the data hash
Frank Reininghaus [Sat, 7 Sep 2013 16:06:45 +0000 (18:06 +0200)]
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

12 years agoNothing special, just a little bit of code cleanup in KItemListViewLayouter::doLayout().
Emmanuel Pescosta [Thu, 5 Sep 2013 15:03:04 +0000 (17:03 +0200)]
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

12 years agoFix Bug 296970 - split view wrong behavior with search tab
Emmanuel Pescosta [Thu, 5 Sep 2013 14:22:59 +0000 (16:22 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Wed, 4 Sep 2013 19:53:08 +0000 (21:53 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoCount the items inside directories in another thread
Frank Reininghaus [Wed, 4 Sep 2013 19:49:01 +0000 (21:49 +0200)]
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

12 years agoTry to avoid calling the model's data method if only "text" is needed
Frank Reininghaus [Wed, 4 Sep 2013 19:34:03 +0000 (21:34 +0200)]
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

12 years agoFix color role of services list
Christoph Feck [Tue, 3 Sep 2013 20:05:05 +0000 (22:05 +0200)]
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

12 years agoReplaced all KNewFileMenu usages in DolphinPart by DolphinNewFileMenu.
Emmanuel Pescosta [Wed, 28 Aug 2013 16:46:45 +0000 (18:46 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Sun, 25 Aug 2013 17:17:25 +0000 (19:17 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoMove cursor to begin/end of selection before canceling it
Christoph Feck [Sun, 25 Aug 2013 15:40:49 +0000 (17:40 +0200)]
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

12 years agoFix filename trucation issues in Icons View with maximum number of lines
Frank Reininghaus [Sun, 25 Aug 2013 14:24:20 +0000 (16:24 +0200)]
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

12 years agoAdjust the size and position of the selection toggle on icon
Emmanuel Pescosta [Sat, 24 Aug 2013 19:00:26 +0000 (21:00 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Sat, 24 Aug 2013 18:27:30 +0000 (20:27 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoMake determining the mime type faster for folders
Frank Reininghaus [Sat, 24 Aug 2013 18:22:56 +0000 (20:22 +0200)]
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

12 years agoDelay the deletion of the role editor as long as possible
Frank Reininghaus [Sat, 24 Aug 2013 18:06:11 +0000 (20:06 +0200)]
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

12 years agoMake use of the "resort all items timer" in KFileItemModel::slotRefreshItems
Emmanuel Pescosta [Sat, 24 Aug 2013 16:13:56 +0000 (18:13 +0200)]
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

12 years agoReplaced the loop to fill m_sizeHintCache with QSizeF() by a simple m_sizeHintCache...
Emmanuel Pescosta [Sat, 24 Aug 2013 16:03:40 +0000 (18:03 +0200)]
Replaced the loop to fill m_sizeHintCache with QSizeF() by a simple m_sizeHintCache.fill() in KItemListSizeHintResolver::clearCache().

REVIEW: 112179

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Christoph Feck [Tue, 20 Aug 2013 10:21:44 +0000 (12:21 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoFix crash when failing to get audio CD block device
Christoph Feck [Tue, 20 Aug 2013 10:19:15 +0000 (12:19 +0200)]
Fix crash when failing to get audio CD block device

CCBUG: 314544
REVIEW: 112117

12 years agodolphin: Show full KFileItem statusbar text with hovered folders too
Fabio D'Urso [Thu, 15 Aug 2013 17:04:16 +0000 (19:04 +0200)]
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

12 years agodolphin: Show full file info in statusbar when only one file is selected
Fabio D'Urso [Thu, 15 Aug 2013 16:56:48 +0000 (18:56 +0200)]
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

12 years agoCut the ropes between DolphinMainWindow and DolphinNewFileMenu. Error handling is...
Emmanuel Pescosta [Fri, 16 Aug 2013 18:22:33 +0000 (20:22 +0200)]
Cut the ropes between DolphinMainWindow and DolphinNewFileMenu. Error handling is now done via signals.

REVIEW: 111989

12 years agoSVN_SILENT made messages (.desktop file)
l10n daemon script [Thu, 15 Aug 2013 03:59:57 +0000 (03:59 +0000)]
SVN_SILENT made messages (.desktop file)

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Wed, 14 Aug 2013 22:15:51 +0000 (00:15 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoMake sure that the sort order is correct after renaming
Frank Reininghaus [Wed, 14 Aug 2013 22:07:43 +0000 (00:07 +0200)]
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

12 years agoDo not store default values in QHash<QByteArray, QVariant>
Frank Reininghaus [Wed, 14 Aug 2013 21:57:51 +0000 (23:57 +0200)]
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

12 years agoFix slow scrolling when hidden files or symbolic links are shown
Frank Reininghaus [Wed, 14 Aug 2013 21:44:57 +0000 (23:44 +0200)]
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

12 years agoFix crash when disabling "Show in groups"
Frank Reininghaus [Wed, 14 Aug 2013 21:40:02 +0000 (23:40 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Thu, 8 Aug 2013 21:39:28 +0000 (23:39 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agodolphin: Escape text in statusbar tooltip
Fabio D'Urso [Thu, 1 Aug 2013 12:17:26 +0000 (14:17 +0200)]
dolphin: Escape text in statusbar tooltip

This fixes the same issue as 4450f8449af91e491636728a4669e2a9e27b49fa,
but for the status bar's tooltip text.

BUG: 323170
FIXED-IN: 4.11.0
REVIEW: 111836

12 years agoDolphinPart: Use Qt::convertFromPlainText instead of Qt::escape for filenames
Fabio D'Urso [Thu, 1 Aug 2013 12:14:40 +0000 (14:14 +0200)]
DolphinPart: Use Qt::convertFromPlainText instead of Qt::escape for filenames

Unlike escape, convertFromPlainText preserves whitespace sequences

CCBUG: 321778
REVIEW: 111835

12 years agoIntroduce a new signal "groupsChanged"
Frank Reininghaus [Sun, 4 Aug 2013 20:20:37 +0000 (22:20 +0200)]
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
998954db6d53999dfa75d380cbb4ca3111589f66.

REVIEW: 111808

12 years agoFix possible out of range error inKItemListSizeHintResolver::itemsMoved
Frank Reininghaus [Sun, 4 Aug 2013 19:46:08 +0000 (21:46 +0200)]
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/

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Sun, 4 Aug 2013 19:28:04 +0000 (21:28 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoAdd some unit tests for grouping in KFileItemModel
Frank Reininghaus [Sun, 4 Aug 2013 19:08:26 +0000 (21:08 +0200)]
Add some unit tests for grouping in KFileItemModel

Hopefully, this will prevent regressions in the future.

REVIEW: 111807

12 years agoMake KFileItemModelTest faster
Frank Reininghaus [Sun, 4 Aug 2013 19:04:56 +0000 (21:04 +0200)]
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.

12 years agoSVN_SILENT made messages (.desktop file)
l10n daemon script [Sun, 4 Aug 2013 04:16:50 +0000 (04:16 +0000)]
SVN_SILENT made messages (.desktop file)

12 years agoDo not enable the "Create New..." menu when a search is finished
Frank Reininghaus [Wed, 31 Jul 2013 17:19:30 +0000 (19:19 +0200)]
Do not enable the "Create New..." menu when a search is finished

BUG: 321577
FIXED-IN: 4.12.0
REVIEW: 111805

12 years agoDo not allow that panels are dragged out of the main window
Frank Reininghaus [Mon, 29 Jul 2013 21:22:02 +0000 (23:22 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Mon, 29 Jul 2013 21:16:58 +0000 (23:16 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoWhen pasting a folder and expanding it, do not select its children
Frank Reininghaus [Mon, 29 Jul 2013 21:14:39 +0000 (23:14 +0200)]
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

12 years agoDon't let HTML-like filenames be interpreted as HTML strings
Fabio D'Urso [Mon, 1 Jul 2013 00:02:21 +0000 (02:02 +0200)]
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

12 years agoDo not convert a KUrl to a QString and back again
Frank Reininghaus [Sun, 28 Jul 2013 21:36:43 +0000 (23:36 +0200)]
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

12 years agoDon't open .desktop files with http:/https: urls in Dolphin,
Emmanuel Pescosta [Fri, 26 Jul 2013 13:05:40 +0000 (15:05 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.11'
Frank Reininghaus [Thu, 25 Jul 2013 20:35:37 +0000 (22:35 +0200)]
Merge remote-tracking branch 'origin/KDE/4.11'

12 years agoFix maximum value for scroll bar when deleting items in Details View
Frank Reininghaus [Thu, 25 Jul 2013 20:25:18 +0000 (22:25 +0200)]
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

12 years agoPrevent that removing items can cause icons to overlap
Frank Reininghaus [Thu, 25 Jul 2013 20:15:19 +0000 (22:15 +0200)]
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

12 years agoSVN_SILENT made messages (.desktop file)
l10n daemon script [Thu, 25 Jul 2013 06:33:03 +0000 (06:33 +0000)]
SVN_SILENT made messages (.desktop file)

12 years agoSVN_SILENT made messages (.desktop file)
l10n daemon script [Thu, 25 Jul 2013 03:57:05 +0000 (03:57 +0000)]
SVN_SILENT made messages (.desktop file)

12 years agoMake sure that widgets are initialized when changing the view mode
Frank Reininghaus [Wed, 24 Jul 2013 20:30:54 +0000 (22:30 +0200)]
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

12 years agoDo not try to smooth-scroll past the end of the view
Frank Reininghaus [Mon, 22 Jul 2013 17:16:07 +0000 (19:16 +0200)]
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

12 years agoFix "truncated header" in Details View with non-Oxygen styles
Frank Reininghaus [Mon, 22 Jul 2013 17:04:14 +0000 (19:04 +0200)]
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

12 years agoFix build if HAVE_NEPOMUK is not defined
Frank Reininghaus [Thu, 18 Jul 2013 20:51:21 +0000 (22:51 +0200)]
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.

12 years agoOverwrite the changed role value with an empty QVariant,
Emmanuel Pescosta [Thu, 18 Jul 2013 15:07:34 +0000 (17:07 +0200)]
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

12 years agoLoad unknown icons for items just before showing items in the view
Frank Reininghaus [Fri, 12 Jul 2013 06:27:04 +0000 (08:27 +0200)]
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

12 years agoFix O(N^2) complexity issue in KItemListView::slotItemsRemoved()
Frank Reininghaus [Fri, 5 Jul 2013 17:47:44 +0000 (19:47 +0200)]
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

12 years agoKeep the "item size hints" of moved items
Frank Reininghaus [Fri, 5 Jul 2013 17:42:39 +0000 (19:42 +0200)]
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

12 years agoMake sure that KItemListSizeHintResolver is always consistent
Frank Reininghaus [Thu, 4 Jul 2013 21:35:01 +0000 (23:35 +0200)]
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

12 years agoFix crash when dropping URLs on the URL navigator's drop down menus
Frank Reininghaus [Tue, 2 Jul 2013 17:27:06 +0000 (19:27 +0200)]
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

12 years agoMake it clear that the Trash/Delete confirmations apply to all KDE apps
Frank Reininghaus [Tue, 2 Jul 2013 17:18:43 +0000 (19:18 +0200)]
Make it clear that the Trash/Delete confirmations apply to all KDE apps

FIXED-IN: 4.11.0
REVIEW: 111324

12 years agoPrevent some unnecessary layoutings when the view size is changed
Frank Reininghaus [Tue, 2 Jul 2013 17:12:08 +0000 (19:12 +0200)]
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

12 years agoReplace QList by QVector if the elements are larger than a pointer
Frank Reininghaus [Sun, 30 Jun 2013 12:26:24 +0000 (14:26 +0200)]
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

12 years agoDolphin: Use the Nepomuk2::FileMetaDatConfigWidget
Vishesh Handa [Fri, 28 Jun 2013 13:38:30 +0000 (19:08 +0530)]
Dolphin: Use the Nepomuk2::FileMetaDatConfigWidget

Instead of the KFileMetaDataConfigurationWidget

REVIEW: 111294

12 years agoFix memory leak in KFileItemModel
Frank Reininghaus [Fri, 28 Jun 2013 19:39:35 +0000 (21:39 +0200)]
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

12 years agoRemove the space (1 pixel) between the file name and the file
Emmanuel Pescosta [Wed, 26 Jun 2013 20:07:57 +0000 (22:07 +0200)]
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

12 years agoRe-enable expandable folders for network top level folders (remote:/)
Emmanuel Pescosta [Wed, 26 Jun 2013 20:04:52 +0000 (22:04 +0200)]
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

12 years agoFix the "dropped files are not selected" regression that has
Emmanuel Pescosta [Wed, 26 Jun 2013 20:00:09 +0000 (22:00 +0200)]
Fix the "dropped files are not selected" regression that has
recently been brought up and that have been caused by review 107351 / commit
fd65a97b0787b23246c9392fdc34173fb604c9ca

CCBUG: 233335
FIXED-IN: 4.11.0
REVIEW: 111254

12 years agoMerge remote-tracking branch 'origin/KDE/4.10'
Frank Reininghaus [Wed, 26 Jun 2013 19:26:21 +0000 (21:26 +0200)]
Merge remote-tracking branch 'origin/KDE/4.10'

12 years agoUse the KDE SC version also as the Dolphin versions
Frank Reininghaus [Wed, 26 Jun 2013 19:24:15 +0000 (21:24 +0200)]
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.

12 years agoFix performance regression when loading folders in Details View
Frank Reininghaus [Wed, 26 Jun 2013 19:18:37 +0000 (21:18 +0200)]
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