]> cloud.milkyroute.net Git - dolphin.git/log
dolphin.git
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

12 years agoImprove filterbar lock button.
Kai Uwe Broulik [Wed, 26 Jun 2013 09:27:01 +0000 (11:27 +0200)]
Improve filterbar lock button.
Use object-(un)locked icon and make it flat.

REVIEW: 111233

12 years agoDolphin Search Date: Set the proper date
Vishesh Handa [Tue, 25 Jun 2013 18:56:45 +0000 (00:26 +0530)]
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

12 years agoDo not show "Move To Trash" action in context menu for remote URLs.
Dawit Alemayehu [Mon, 24 Jun 2013 05:11:16 +0000 (01:11 -0400)]
Do not show "Move To Trash" action in context menu for remote URLs.

BUG: 261762
REVIEW: 111206
FIXED-IN: 4.11

12 years agoMerge remote-tracking branch 'origin/KDE/4.10'
Frank Reininghaus [Mon, 24 Jun 2013 20:02:04 +0000 (22:02 +0200)]
Merge remote-tracking branch 'origin/KDE/4.10'

12 years agoUse the target url of a item when creating the QMimeData in KFileItemModel::createMim...
Emmanuel Pescosta [Mon, 24 Jun 2013 09:11:37 +0000 (11:11 +0200)]
Use the target url of a item when creating the QMimeData in KFileItemModel::createMimeData.

BUG: 307336
FIXED-IN: 4.10.5
REVIEW: 111209

12 years agoPrevent possible infinite recursion in ViewProperties
Frank Reininghaus [Sun, 23 Jun 2013 08:01:24 +0000 (10:01 +0200)]
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

12 years agoDolphin Nepomuk Roles: Handle values which are resource lists
Vishesh Handa [Sat, 22 Jun 2013 01:11:40 +0000 (06:41 +0530)]
Dolphin Nepomuk Roles: Handle values which are resource lists

It is common for music files to have more than one artist

BUG: 321359

12 years agoRemove knepomukdatamanagement_export.h
Vishesh Handa [Sat, 22 Jun 2013 01:00:24 +0000 (06:30 +0530)]
Remove knepomukdatamanagement_export.h

It is no longer required. In fact it hasn't been required since
nepomuk-core was introdcued.

12 years agoUpdate the "Move to Trash" action's and the "Delete" action's
Emmanuel Pescosta [Sat, 22 Jun 2013 12:04:45 +0000 (14:04 +0200)]
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

12 years agoMake sure that changing the view mode does not fail
Frank Reininghaus [Sat, 22 Jun 2013 07:27:37 +0000 (09:27 +0200)]
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

12 years agoEnable KIO error reporting when renaming with the dialog
Frank Reininghaus [Sat, 22 Jun 2013 07:19:27 +0000 (09:19 +0200)]
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

12 years agoDolphin: Do not try to connect to Nepomuk if it is not running
Vishesh Handa [Thu, 20 Jun 2013 18:39:15 +0000 (00:09 +0530)]
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

12 years agoRevert "Hide context menu plugins unless enabled by default or by the user"
Sune Vuorela [Fri, 21 Jun 2013 08:37:52 +0000 (10:37 +0200)]
Revert "Hide context menu plugins unless enabled by default or by the user"

This reverts commit b1aebb44d6863951841d857b84253a782d4138dc.

As agreed with Frank on k-c-d.

12 years agoMerge remote-tracking branch 'origin/KDE/4.10'
Frank Reininghaus [Thu, 20 Jun 2013 17:44:06 +0000 (19:44 +0200)]
Merge remote-tracking branch 'origin/KDE/4.10'

12 years agoAllow renaming multiple files without number if extensions are different
Frank Reininghaus [Thu, 20 Jun 2013 17:37:53 +0000 (19:37 +0200)]
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

12 years agoMake it possible to select files like "a_b" using keyboard search
Frank Reininghaus [Thu, 20 Jun 2013 17:32:25 +0000 (19:32 +0200)]
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

12 years agoHide the "drop" indicator when an item is not hovered any more
Frank Reininghaus [Thu, 20 Jun 2013 17:29:10 +0000 (19:29 +0200)]
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

12 years agoSome simplifications in KFileItemModelRolesUpdater
Frank Reininghaus [Thu, 20 Jun 2013 17:23:43 +0000 (19:23 +0200)]
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

12 years agoTry to do at least a "fast" icon loading for all items
Frank Reininghaus [Thu, 20 Jun 2013 17:18:22 +0000 (19:18 +0200)]
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

12 years agoAvoid a unnecessary resorting when items are changed, only resort the items when...
Emmanuel Pescosta [Thu, 20 Jun 2013 17:16:22 +0000 (19:16 +0200)]
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

12 years agoMake sure that all visible items have an icon
Frank Reininghaus [Thu, 20 Jun 2013 17:13:35 +0000 (19:13 +0200)]
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

12 years agoPrevent the selection rectangle from being reduced to 0px
Emmanuel Pescosta [Thu, 20 Jun 2013 17:02:06 +0000 (19:02 +0200)]
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

12 years agoSimplify handling of preview jobs
Frank Reininghaus [Thu, 20 Jun 2013 16:10:07 +0000 (18:10 +0200)]
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

12 years agoMerge remote-tracking branch 'origin/KDE/4.10'
Dawit Alemayehu [Thu, 20 Jun 2013 12:41:12 +0000 (08:41 -0400)]
Merge remote-tracking branch 'origin/KDE/4.10'

12 years agoDo not use fixed widths for the widgets in the status bar
Frank Reininghaus [Tue, 18 Jun 2013 15:46:51 +0000 (17:46 +0200)]
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

12 years agoEnsure that the "Sort by Type" setting is respected
Frank Reininghaus [Tue, 18 Jun 2013 15:39:56 +0000 (17:39 +0200)]
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

12 years agoRemove trailing white space
Frank Reininghaus [Thu, 13 Jun 2013 21:34:39 +0000 (23:34 +0200)]
Remove trailing white space

12 years agoFix "unused parameter" warning
Frank Reininghaus [Thu, 13 Jun 2013 21:32:01 +0000 (23:32 +0200)]
Fix "unused parameter" warning

We don't need the parameter at all, so let's just remove it.

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

12 years agoDo not rename files unexpectedly when changing the URL
Frank Reininghaus [Sun, 9 Jun 2013 10:14:26 +0000 (12:14 +0200)]
Do not rename files unexpectedly when changing the URL

This is the real fix now - note that the last commit
4de9a233642a62ee96bac6031340d3eea21f14f9 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

12 years agoDo not rename files unexpectedly when changing the URL
Frank Reininghaus [Mon, 10 Jun 2013 19:15:53 +0000 (21:15 +0200)]
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

12 years agoFix Bug 319119 - Dolphin doesn't notice when renaming failed
Emmanuel Pescosta [Mon, 10 Jun 2013 09:16:21 +0000 (11:16 +0200)]
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

12 years agoDo not delete files when Shift-clicking "Trash"
Frank Reininghaus [Sun, 9 Jun 2013 09:53:59 +0000 (11:53 +0200)]
Do not delete files when Shift-clicking "Trash"

Thanks to Dawit Alemayehu for making this fix possible with commit
8e023ae9e5051cb7b81af86a178e37c1f2c5da94 !

BUG: 307254
FIXED-IN: 4.11.0

12 years agoRemove unused argument
Frank Reininghaus [Fri, 7 Jun 2013 07:22:32 +0000 (09:22 +0200)]
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.

12 years agoIgnore a changed item if it cannot be found in the model
Frank Reininghaus [Thu, 6 Jun 2013 08:00:47 +0000 (10:00 +0200)]
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

12 years agoMake calls to resolveNextPendingRoles and resolveNextSortRole delayed
Frank Reininghaus [Thu, 6 Jun 2013 06:49:12 +0000 (08:49 +0200)]
Make calls to resolveNextPendingRoles and resolveNextSortRole delayed

This prevents that functions that call these indirectly call themselves
recursively and cause trouble.

BUG: 320791

12 years agostartPreviewJob: if items is empty, delay call to slotPreviewJobFinshed
Frank Reininghaus [Thu, 6 Jun 2013 06:38:58 +0000 (08:38 +0200)]
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

12 years agoKFileItemModelRolesUpdater: waste less ressources and fix some bugs
Frank Reininghaus [Wed, 5 Jun 2013 21:31:01 +0000 (23:31 +0200)]
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

12 years agoReduce KFileItemModel memory usage by making use of implicit sharing
Frank Reininghaus [Wed, 5 Jun 2013 21:18:26 +0000 (23:18 +0200)]
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

12 years agomove focus to another view upon drop
Weng Xuetian [Wed, 5 Jun 2013 21:07:31 +0000 (17:07 -0400)]
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

12 years agoBug 196035 - middle clicking on archive files in dolphin does not open them in a...
Emmanuel Pescosta [Tue, 28 May 2013 15:31:14 +0000 (17:31 +0200)]
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

12 years agoDolphin Search: Do not use Nepomuk for hidden folders
Vishesh Handa [Tue, 28 May 2013 16:33:36 +0000 (22:03 +0530)]
Dolphin Search: Do not use Nepomuk for hidden folders

Nepomuk does not index hidden folders

BUG: 318442
REVIEW: 110697
FIXED-IN: 4.11.0

12 years agoHide context menu plugins unless enabled by default or by the user
Frank Reininghaus [Wed, 29 May 2013 05:48:11 +0000 (07:48 +0200)]
Hide context menu plugins unless enabled by default or by the user

REVIEW: 110685

12 years agoPlacesModel: Only allow folders to be pinned
Vishesh Handa [Tue, 7 May 2013 10:01:11 +0000 (15:31 +0530)]
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

12 years agoPlacesPanel: Do not allow drop events into timeline or search folder
Vishesh Handa [Tue, 7 May 2013 10:07:27 +0000 (15:37 +0530)]
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

12 years agoset KItemListView palette from scenes first view
Thomas Lübking [Sat, 18 May 2013 13:51:27 +0000 (15:51 +0200)]
set KItemListView palette from scenes first view

REVIEW: 110505

12 years agoAdded the "Open in new Tabs" action to the Dolphin Context menu.
Emmanuel Pescosta [Wed, 22 May 2013 19:47:14 +0000 (21:47 +0200)]
Added the "Open in new Tabs" action to the Dolphin Context menu.

BUG: 312296
REVIEW: 110371
FIXED-IN: 4.11.0

12 years agoFilter bar: add a button that prevents clearing if the URL changes
Stuart Citrin [Wed, 22 May 2013 16:48:00 +0000 (18:48 +0200)]
Filter bar: add a button that prevents clearing if the URL changes

FEATURE: 256651
FIXED-IN: 4.11.0
REVIEW: 107392

12 years agoMerge remote-tracking branch 'origin/KDE/4.10'
Frank Reininghaus [Wed, 22 May 2013 16:34:25 +0000 (18:34 +0200)]
Merge remote-tracking branch 'origin/KDE/4.10'

12 years agoKFileItemModel::insertItems(): guarantee O(N) run time complexity
Frank Reininghaus [Wed, 22 May 2013 16:27:05 +0000 (18:27 +0200)]
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

12 years agoDo not reset the 'isExpanded' state when an expanded folder is refreshed
Frank Reininghaus [Wed, 22 May 2013 16:14:21 +0000 (18:14 +0200)]
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

12 years agoKFileItemModelRolesUpdater: only update the size for changed folders
Frank Reininghaus [Wed, 22 May 2013 16:06:54 +0000 (18:06 +0200)]
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

12 years ago- Factored out the Delete/Move To Trash action into own class.
Dawit Alemayehu [Sat, 9 Feb 2013 20:56:51 +0000 (15:56 -0500)]
- 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