]> cloud.milkyroute.net Git - dolphin.git/log
dolphin.git
12 years agoMerge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12
Frank Reininghaus [Thu, 5 Dec 2013 23:56:34 +0000 (00:56 +0100)]
Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12

12 years agoFix Bug 328262 - rename bug if you cancel when folder already exists
Emmanuel Pescosta [Tue, 3 Dec 2013 18:00:28 +0000 (19:00 +0100)]
Fix Bug 328262 - rename bug if you cancel when folder already exists

Only connect the renamingFailed signal if there is no item with the new name in the model yet.

BUG: 328262
FIXED-IN: 4.11.5
REVIEW: 114228

12 years agoLazy-load the item data also in Compact View
Frank Reininghaus [Mon, 2 Dec 2013 22:14:20 +0000 (23:14 +0100)]
Lazy-load the item data also in Compact View

The recent changes which prevent that all data for each item are saved
in a QHash already when loading the folder (see
https://git.reviewboard.kde.org/r/112725/), which save both memory and
time, do not work yet in Compact View, because
KItemListWidgetInformant::itemSizeHint() calls the model's data(int)
method for every item, which then initializes the hash.

This patch prevents that by accessing the file name directly if only
the "Name" is shown in the view, just like it's done in Icons View.

REVIEW: 113849

12 years agoMerge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12
Frank Reininghaus [Wed, 20 Nov 2013 23:51:08 +0000 (00:51 +0100)]
Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12

12 years agoFix incorrect geometry updates in KItemListContainer
Yichao Yu [Wed, 20 Nov 2013 23:47:23 +0000 (00:47 +0100)]
Fix incorrect geometry updates in KItemListContainer

When resizing the window and when KItemListContainer::updateGeometries
is called before the scrollbar visibility is updated, a relayout is
triggered in `m_controller->view()->setGeometry` which updates the
scrollbar visibility and calls back to
`KItemListContainer::updateGeometries` again. Since the first call,
which has the wrong geometry (due to the incorrect scrollbar states),
updates the geometries of the scene and viewport after the second call
(which has the right geometry!!) returns, the final result is a size
that corresponded to the old scrollbar state before this commit.

This patch uses the new geometry of the view after updating it (since
it might not be the size we put in) and therefore makes the sizes
consistent.

BUG: 327709
FIXED-IN: 4.11.4
REVIEW: 113939

12 years agoMake the "Create New..." menu in the "item context menu" work again
Frank Reininghaus [Wed, 20 Nov 2013 23:41:23 +0000 (00:41 +0100)]
Make the "Create New..." menu in the "item context menu" work again

Since https://git.reviewboard.kde.org/r/111989/, the "Create New..."
menu in the context menu that appears when right-clicking a folder was
not a child of the DolphinMainWindow any more, but of the context menu
itself. This is the reason why the dialog that asks for a file name
when choosing one of the "Create New..." options disappeared
immediately.

This patch makes sure that the main window is the parent of the
"Create New..." menu again.

BUG: 327783
REVIEW: 113930

12 years agodolphinnewfilemenu.cpp is part of dolphinprivate
Patrick von Reth [Tue, 19 Nov 2013 18:51:16 +0000 (19:51 +0100)]
dolphinnewfilemenu.cpp is part of dolphinprivate

12 years agoMerge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12
Frank Reininghaus [Mon, 18 Nov 2013 22:44:45 +0000 (23:44 +0100)]
Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12

12 years agoFix scrollbar spacing when no scrollbar is visible in dolphin.
Yichao Yu [Mon, 18 Nov 2013 22:40:40 +0000 (23:40 +0100)]
Fix scrollbar spacing when no scrollbar is visible in dolphin.

Before this commit, Dolphin reserved space for the scrollbar spacing
even when no scrollbar is visible resulting in a ugly gap in the view
when:

1. the theme uses QStyle::SH_ScrollView_FrameOnlyAroundContents and
2. the theme has a positive PM_ScrollView_ScrollBarSpacing.

QtCurve can have both while Oxygen have 1 but not 2.
To reproduce the problem with Oxygen style. Replace the
`width += ....` (which returns -2 or 0 for Oxygen) with `width += 2`.

See more info here:
https://github.com/QtCurve/qtcurve-qt4/issues/9#issuecomment-28630517

CCBUG: 306631
FIXED-IN: 4.11.4
REVIEW: 113902

12 years agoUpdate the Places Panel entries when switching the language
Frank Reininghaus [Fri, 15 Nov 2013 08:16:22 +0000 (09:16 +0100)]
Update the Places Panel entries when switching the language

Before this commit, we stored the translated "Places" in
.kde4/share/apps/kfileplaces/bookmarks.xml. This was not intentional -
it only happened because
PlacesItem::updateBookmarkForRole(const QByteArray& role) always stored
the translated text (returned by PlacesItem::text()) in the KBookmark.

This is be fixed by first checking if the text() is equal to the
translation of the text that is already stored in the KBookmark, and
not updating it in that case.

Note that we have to make sure that all "Places"-related use the same
context "KFile System Bookmarks" to make that work.

Thanks to Burkhard Lück and Albert Astals Cid for helping to fix this
problem!

BUG: 319282
FIXED-IN: 4.12.0
REVIEW: 113850

12 years agoMerge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12
Frank Reininghaus [Thu, 14 Nov 2013 08:14:51 +0000 (09:14 +0100)]
Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12

12 years agoDo not select items when navigating back/forward with the mouse
David Rosca [Thu, 14 Nov 2013 08:08:29 +0000 (09:08 +0100)]
Do not select items when navigating back/forward with the mouse

If we detect that the user pressed the back/forward buttons while
hovering the empty space of the view, such that
DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons) will request
that Dolphin navigates back/forward in the history, handling the mouse
press event should stop. This prevents the possible unexpected selection
of items in the new directory.

BUG: 327412
FIXED-IN: 4.11.4

12 years agoMake it build with QT_STRICT_ITERATORS
Wolfgang Bauer [Wed, 6 Nov 2013 16:53:43 +0000 (17:53 +0100)]
Make it build with QT_STRICT_ITERATORS

Redo commit 81c99da7e0043d433756d1f062bf30845db93c66 by Kevin Ottens

Was removed by mistake during the last merge with KDE/4.11, sorry!

12 years agoMerge branch 'KDE/4.11' into KDE/4.12
Wolfgang Bauer [Wed, 6 Nov 2013 16:07:10 +0000 (17:07 +0100)]
Merge branch 'KDE/4.11' into KDE/4.12

Revert "Files passed as arguments: Ignore unsupported files"

This reverts commit cd9e50ae4f3ded5a78d0cfb09a67684a9c15d726.

See bug#327224 for details.

12 years agoRevert "Files passed as arguments: Ignore unsupported files"
Wolfgang Bauer [Wed, 6 Nov 2013 15:46:09 +0000 (16:46 +0100)]
Revert "Files passed as arguments: Ignore unsupported files"

This reverts commit cd9e50ae4f3ded5a78d0cfb09a67684a9c15d726.

See bug#327224 for details.

12 years agoMerge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12
Frank Reininghaus [Tue, 5 Nov 2013 07:47:37 +0000 (08:47 +0100)]
Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12

12 years agoOnly do a fast pre-sorting when "Sort by Name" is used
Frank Reininghaus [Tue, 5 Nov 2013 07:44:31 +0000 (08:44 +0100)]
Only do a fast pre-sorting when "Sort by Name" is used

This is a follow-up to commit 0e9f4a398735cfc19ae783d2ab054d2400d95416,
which tries to speed up sorting the items naturally by their name using
the idea that a fast non-natural pre-sorting already sorts the items
mostly correctly and thus reduces the number of expensive natural
comparisons.

This change only makes sense if the view is really sorted by "Name". In
other cases, the pre-sorting will most likely not be useful.

Thanks to Christoph Feck for pointing this out!

12 years agoFix Bug 287983 - Dolphin truncates tooltip information for long file names
Emmanuel Pescosta [Fri, 1 Nov 2013 23:12:33 +0000 (00:12 +0100)]
Fix Bug 287983 - Dolphin truncates tooltip information for long file names

Use KStringHandler and QTextLayout to wrap the text (file name)
into the maximum width of the label "name".

Make use of QFontMetrics to calculate a font size aware tooltip size.

BUG: 287983
FIXED-IN: 4.11.3
REVIEW: 113101

12 years agoStore the selected items in a more efficient way
Frank Reininghaus [Wed, 30 Oct 2013 22:21:09 +0000 (23:21 +0100)]
Store the selected items in a more efficient way

Since Dolphin 2.0, we have stored the selected items in a QSet<int>,
which is neither space-efficient nor particularly fast when inserting
many items which are in a consecutive range.

This commit replaces the QSet<int> by a new class "KItemSet", which
stores the items in a sorted list of ranges. For each range, we only
store the first index and the length of the range, so we need a lot
less memory for most common selection patterns, and we also save quite
a few CPU cycles in many situations, because adding an item to the
KItemSet will in many cases not need a memory allocation at all, and
it's particularly easy when inserting sorted items into the KItemSet in
a row.

KItemSet contains a minimal subset of QSet's API which makes it
suitable as a drop-in replacement for our needs. It also has iterators,
such that the items can be iterated through easily, also with foreach.
One advantage of KItemSet compared to QSet<int> is that the items are
always iterated through in ascending order.

REVIEW: 113488

12 years agoSort in items in two stages to speed up natural sorting
Frank Reininghaus [Wed, 30 Oct 2013 16:48:32 +0000 (17:48 +0100)]
Sort in items in two stages to speed up natural sorting

Sort the items in a folder first according to their name, without doing
a natural/locale-aware sorting. This is very fast, but the order of the
items is then already close to the final order in most cases.

The number of expensive natural comparisons required to sort the items
is thus greatly reduced.

In my experiments with a folder with 100,000 items, the time required
to sort the files was reduced by 63% with this patch.

REVIEW: 113485

12 years agoPrevent storing some redundant data in KItemListViewLayouter
Frank Reininghaus [Wed, 30 Oct 2013 16:39:20 +0000 (17:39 +0100)]
Prevent storing some redundant data in KItemListViewLayouter

In KItemListViewLayouter, we have always stored a QRectF for each item,
which is "the area that the item occupies". However, the size of the
QRectF is already stored in the size hint resolver.

Therefore, it is sufficient to store the position of the top left
corner of the QRectF in a QPointF and construct the QRectF on demand.

This patch reduces the memory usage by 16 bytes for each item in the
view:

* a QRectF is 4 doubles -> 32 byes
* a QPointF contains only 2 doubles -> 16 bytes

REVIEW: 113487

12 years agoRestore the tree state in Details View if a folder is re-expanded
Frank Reininghaus [Sat, 26 Oct 2013 07:36:40 +0000 (09:36 +0200)]
Restore the tree state in Details View if a folder is re-expanded

This patch actually does two things when collapsing an expanded folder
with expanded children:

(a) It removes all expanded children (which are removed from the model)
    from m_expandedDirs.

(b) It remembers the expanded children and restores them if the
    top-level folder is re-expanded.

BUG: 304363
FIXED-IN: 4.12.0
REVIEW: 113293

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)