Commit graph

4408 commits

Author SHA1 Message Date
Fabio D'Urso 254ab4b579 DolphinPart: Use Qt::convertFromPlainText instead of Qt::escape for filenames
Unlike escape, convertFromPlainText preserves whitespace sequences

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thanks to Emmanuel Pescosta for helping to analyze this issue.

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

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

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

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

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

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

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

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

Test case (for very large N):

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

(wait until all files are shown in the view)

rm *.jpg

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CCMAIL: ps_ml@gmx.de
2013-05-12 09:34:05 +02:00
Frank Reininghaus cad78cdfcf Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	CMakeLists.txt
2013-05-11 18:47:58 +02:00
Frank Reininghaus f9990aff6a Update copyright year 2013-05-11 18:44:21 +02:00
Patrick Spendrin f6fcf4be85 fix building tests under windows 2013-05-10 23:03:23 +02:00
Daniel Faust 3f108bd7fa Don't try to change the icon of the "sort" action menu if it doesn't exist
BUG: 255819
FIXED-IN: 4.10.4
REVIEW: 109966
2013-05-10 22:27:22 +02:00
Vishesh Handa 38bb5f1547 Dolphin Places: React to Nepomuk system changes
Reload the places panel when Nepomuk starts up and shutsdown. This way
the user does not need to restart Dolphin to see the custom searches and
places after Nepomuk switches on.

BUG: 304918
REVIEW: 110323
2013-05-07 01:36:37 +05:30
David Faure 57e65aab7f Reimplement handling of Shift while showing menu without KModifierKeyInfo
Finding out whether shift is pressed initially can be done
with qApp->keyboardModifiers(), and finding out that the user is pressing
or release shift can be done with keyPressEvent/keyReleaseEvent.

This required to inherit from KMenu rather than having the KMenu
as a member.

KModifierKeyInfo is only implemented on X11, so this makes the code
more portable. If similar solutions can be found for other users of
KModifierKeyInfo, it will be deprecated in KF5.

REVIEW: 110303
2013-05-05 22:42:49 +02:00
David Faure 926ed302d6 Remove erroneous double-quotes around %c in Exec line 2013-05-03 13:22:33 +02:00
Frank Reininghaus 692e7d4d32 Merge remote-tracking branch 'origin/KDE/4.10' 2013-05-02 19:45:08 +02:00
Frank Reininghaus ff3b009e68 Do not change the view URL if it is a symlink to the current directory
BUG: 302037
FIXED-IN: 4.10.3
REVIEW: 110233
2013-05-02 19:40:01 +02:00
Frank Reininghaus 9480a1ee44 Use the same text color for selected hidden and non-hidden items
This fixes the problem that the names of selected hidden items are
unreadable with some color schemes.

BUG: 305734
FIXED-IN: 4.10.3
REVIEW: 110164
2013-05-02 19:28:10 +02:00
Frank Reininghaus a70fd06124 Rename multiple files: Determine correctly if the name pattern is valid
The "Rename" button in the dialog should be enabled if and only if the
"new name" pattern is valid. This is the case if the pattern contains
exactly one sequence of '#', which will be replaced by digits.

This patch fixes the problem that
(a) A pattern that contains a single '#' is not considered valid, and
(b) A pattern without any '#' at all is not recognized as invalid.

BUG: 318942
FIXED-IN: 4.10.3
REVIEW: 110223
2013-05-02 19:23:38 +02:00
Frank Reininghaus dbc00fa190 Replace the button label "Less Options" by "Fewer Options"
BUG: 318937

FIXED-IN: 4.11.0
2013-04-27 19:09:42 +02:00
Emmanuel Pescosta d167699932 Scroll to newly pasted files.
If multiple files are pasted, scroll to the first pasted file.

BUG: 315722
REVIEW: 109950
FIXED-IN: 4.11.0
2013-04-23 22:50:01 +02:00
Frank Reininghaus 7f381a34cb Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	plasma/applets/folderview/folderview.cpp

CCMAIL: ignat.semenov@blue-systems.com

@Ignat: We've been following a merge-based approach in kde-baseapps
for quite some time now, see

http://lists.kde.org/?t=134744909400005&r=1&w=1

It would be nice if you could merge KDE/4.10 into master after any
non-trivial changes in folderview to prevent that others have to
figure out how to resolve the merge conflicts. Thanks!
2013-04-23 19:40:42 +02:00
Frank Reininghaus 8f4d13dab8 Disable Find/Replace in the "rename inline" line edit
These actions do not work correctly because renaming is considered
finished as soon as the line edit loses focus, which happens when the
"Replace" dialog pops up.

BUG: 317772
FIXED-IN: 4.10.3
2013-04-23 19:31:08 +02:00
Frank Reininghaus 8a40b0ee4a Do not dereference null pointer in KItemListViewAccessible
BUG: 316285
FIXED-IN: 4.10.3
2013-04-23 19:25:52 +02:00
Frank Reininghaus 37e796522b Comment out assertion to fix a crash when filtering in Icons/Compat View
I'm not sure yet if there is a problem somewhere else in the code. For
the time being, I think it's better to replace the assert by a TODO
comment to prevent that users find out the hard way that there is
something that we're not quite sure about.

BUG: 317827
FIXED-IN: 4.10.3
2013-04-22 21:36:57 +02:00
Frank Reininghaus 151c8d8c42 Always determine icons for the visible items first
When entering a folder, KFileItemModelRolesUpdater has not yet been
informed about the visible index range by the view when it tries to
determine icons synchronously. This resulted in the problem that it
tried to determine icons for all items in random order, and some visible
icons were somtimes still unknown after the "synchronous icon loading"
timeout of 200 ms.

This commit tries to improve the situation by loading icons starting
with the first item in increasing order. This should make it less likely
that some visible items still have unknown icons after 200 ms.

BUG: 316129
FIXED-IN: 4.10.3
REVIEW: 109843
2013-04-22 21:21:31 +02:00
Script Kiddy 9b30145ac3 SVN_SILENT made messages (.desktop file) 2013-04-20 09:44:11 +02:00
Script Kiddy ee2d453f1f SVN_SILENT made messages (.desktop file) 2013-04-19 13:27:40 +02:00
Aurélien Gâteau 1cd7bfb991 Merge remote-tracking branch 'origin/KDE/4.10' 2013-04-12 16:31:03 +02:00
Aurélien Gâteau bf1b4b4881 Fix moving image while transitioning to hover pixmap
See: http://youtu.be/OMYO0U0kSL0

REVIEW: 109960
FIXED-IN: 4.10.3
2013-04-12 16:28:52 +02:00
Kai Uwe Broulik d8fede7cc6 Move Bluetooth places items to Device section of places list
REVIEW: 109622
BUG: 301276
2013-04-02 16:07:29 +02:00
Luca Beltrame 8cc479518b Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	plasma/applets/folderview/folderview.cpp
2013-03-27 16:50:22 +01:00
David Faure df8d439c55 Update icon if it couldn't be determined upfront (.desktop file on slow mount)
This requires an up-to-date kdelibs >= 4.10.

CCBUG: 290666
2013-03-27 15:19:09 +01:00
Frank Reininghaus f28ab78825 Improve grouping by name for non-ASCII file names
This commit prevents that all non-ASCII letters which are not umlauts
are grouped in a single group "Others", and that the joint group of
an ASCII letter and the associated umlaut in some locales is called
"Others" if there is only the umlaut in the group.

BUG: 315569
REVIEW: 109457
FIXED-IN: 4.10.2
2013-03-26 01:21:34 +01:00
Aurélien Gâteau 6dfcd7afd9 Merge remote-tracking branch 'origin/KDE/4.10'
@emmanuel: this merge includes your fix from
https://git.reviewboard.kde.org/r/109488/ . I assume this is not a
problem.

CCMAIL: emmanuelpescosta099@gmail.com
2013-03-21 14:14:55 +01:00
Aurélien Gâteau e2a89fc2e0 Fix transition between m_pixmap and m_hoverPixmap
The default SourceOver composition mode of QPainter cannot be used
to interpolate between two images, we must use intermediate buffers
to perform the interpolation and blend the result on the widget.

More details are available in the review request.

REVIEW: 109614
FIXED-IN: 4.10.2
2013-03-21 14:06:07 +01:00
Emmanuel Pescosta 7198437118 Refresh all expanded directories too, when reloading a directory.
BUG: 295300
FIXED-IN: 4.10.2
REVIEW: 109488
2013-03-17 20:13:55 +01:00
Weng Xuetian 5d75c7afc5 Merge remote-tracking branch 'origin/KDE/4.10' 2013-03-16 00:47:11 -04:00
Weng Xuetian 61ea42b353 use plain text for information panel
REVIEW: 109129
BUG: 315693
CCBUG: 262464
2013-03-16 00:43:22 -04:00
Script Kiddy 34f1ffd668 SVN_SILENT made messages (.desktop file) 2013-03-15 14:57:44 +01:00
Script Kiddy 382834e0fb SVN_SILENT made messages (.desktop file) 2013-03-15 10:09:23 +01:00
Frank Reininghaus 31b0b565fe Merge remote-tracking branch 'origin/KDE/4.10' 2013-03-15 00:28:40 +01:00
Frank Reininghaus 90dd897752 Improve handling of filtered items when folders are deleted/collapsed
If an expanded folder with filtered children is collapsed or removed,
and the parent-child relationship cannot be determined by parsing the
URLs, this patch makes sure that the filtered children do not reappear
when the filter bar is cleared.

REVIEW: 109455
2013-03-15 00:23:57 +01:00
Frank Reininghaus 4bcda6c7e7 Prevent accidental deletion of home directory in Terminal Panel
The protection against unwanted execution of "rm -rf" when changing the
directory while entering the command did not work if there was never any
automatic "cd" command sent to the terminal before.

This patch ensures that Terminal Panel's member m_clearTerminal is
false after the initialization of the panel, such that the protection is
effective after that.

BUG: 316300
FIXED-IN: 4.10.2
REVIEW: 109431
2013-03-15 00:12:49 +01:00
Script Kiddy 11e2974a9f SVN_SILENT made messages (.desktop file) 2013-03-14 17:08:18 +01:00
Script Kiddy 2fc248faed SVN_SILENT made messages (.desktop file) 2013-03-14 09:38:14 +01:00
Frank Reininghaus a97fe0c7ff Fix recent regressions when "Sort by Type" is used
This commit ensures that the mime types and icons are determined
synchronously for 200 ms when "Sort by Type" is enabled.

REVIEW: 109344
2013-03-12 19:26:36 +01:00
Frank Reininghaus 9ea5eb2164 Do not skip rows in when clicking the empty area of the scroll bar
The height of the header widget must be subtracted from the view's
height in Details View to determine the "pageStep" for the scroll bar.

BUG: 315619
FIXED-IN: 4.10.2
REVIEW: 109210
2013-03-11 18:18:44 +01:00
Frank Reininghaus f71e0881d2 Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	dolphin/src/kitemviews/kfileitemmodel.cpp
2013-03-10 18:31:23 +01:00
Frank Reininghaus 9dd728cb98 Remove filtered children if the parent folder is collapsed
This is analogous to commit e053ecdcd5,
which fixes the same problem for the case that the parent folder is
deleted.

BUG: 316335
FIXED-IN: 4.10.2
REVIEW: 109343
2013-03-10 18:26:37 +01:00
Frank Reininghaus a3b5656a16 Remove duplicated slot
The slot DolphinViewContainer::focusView(), introduced in commit
2f0114730d, is actually unnecessary
because DolphinViewContainer::requestFocus() provides the same
functionality already.
2013-03-07 22:58:48 +01:00
Daniel Kreuter 0ae259e098 Use a consistent way to group files by "Date"
Before this change, files were grouped by calendar weeks if they were
modified in the current month and ignoring the "first week day setting",
but by the actual distance measured in multiples of seven days if the
were modified last month.

This not only fixes the "ignores first week day" bug, but also the
problem that the inconsistencies in the algorithm could lead to a broken
grouping in the first days of a month (see screenshot in the review
request).

BUG: 181337
FIXED-IN: 4.11
REVIEW: 108667
2013-03-03 18:27:00 +01:00
Emmanuel Pescosta 4e4078c66a Removed everything related to m_expandedParentsCountRoot ->
This concept is not needed anymore because of the new "determine parents and
expansion levels" approach

Side effect:
Enables treeview for trash, ...

REVIEW: 109191
2013-02-27 19:56:55 +01:00
Emmanuel Pescosta f2d70693db Big Thanks to Frank Reininghaus, who helped me a lot with these
changes! :)

* Fixed the "Network browser" and "timeline" issues, by using the
KDirLister's itemsAdded(KUrl,KFileItemList) signal -> Use the
given Url to define the parent-child relationship.

* Changed the name of the slot "slotNewItems" to "slotItemsAdded"
for consistency with the signal.

* Use a QHash<KFileItem, ItemData*> instead of a QSet<KFileItem> to
store the filtered data (needed to keep the O(1) lookup for filtered
KFileItems in slotItemsDeleted + needed to fix bug 311912 "After
erasing a filter, some thumbnails randomly disappear")

* Made the determination of the "expandedParentsCount" slightly
simpler - just adding 1 to the parent's level (Also needed to fix the
"Network browser" and "timeline" issues)

FIXED-IN: 4.11.0
REVIEW: 109180
BUG: 304565
BUG: 311912
BUG: 312890
BUG: 315593
2013-02-27 13:35:20 +01:00
Script Kiddy 6b91e4e6b8 SVN_SILENT made messages (.desktop file) 2013-02-22 17:54:48 +01:00
Script Kiddy 36510e16f7 SVN_SILENT made messages (.desktop file) 2013-02-22 06:41:23 +01:00
Jens Rutschmann 0fee7ff266 Return the focus from the filter bar to the view if Enter is pressed
BUG: 297140
FIXED-IN: 4.11.0
REVIEW: 109020
2013-02-19 22:43:55 +01:00
Frank Reininghaus cc1455c0e6 Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	dolphin/src/tests/kfileitemmodeltest.cpp
	lib/konq/konq_operations.cpp
2013-02-19 15:45:44 +01:00
Frank Reininghaus 518b53feb4 Fix crash when clicking an action in context menu for a removed device
Devices can be added and removed while the context menu is open.
Sfter an action has clicked that needs to access a device, we therefore
have to check if its position in the model has changed, and more
importantly, if it is still there at all in order to prevent a crash.

BUG: 315298
FIXED-IN: 4.10.1
REVIEW: 108989
2013-02-18 23:58:31 +01:00
Frank Reininghaus 6938241ebc Remove items from m_filteredItems if their parent is deleted
Fixes the problem that filtered children of expanded deleted folders
reappear if the filter is cleared.

BUG: 315210
FIXED-IN: 4.10.1
REVIEW: 108976
2013-02-18 23:50:38 +01:00
Frank Reininghaus e6ef1eec3a Merge remote-tracking branch 'origin/KDE/4.10' 2013-02-17 12:17:01 +01:00
Frank Reininghaus ba31457911 Another fix for KItemListControllerTest::testMouseClickActivation()
One one machine, I see that changing the global "single click" setting
fails. I don't know why that is the case, but I think we should better
just skip the test in that case and not hang forever.
2013-02-17 12:12:52 +01:00
Frank Reininghaus eb88968baf Update Dolphin version to 2.2.60 2013-02-17 11:36:03 +01:00
Frank Reininghaus fc0c3f9d4e Prevent repeated re-layouting of all items while previews are generated
There was some code in KStandardItemListView::itemSizeHintUpdateRequired
already that was supposed to prevent an expensive re-layouting of all
items when a preview is received. However, it didn't quite work as
intended because also the "iconOverlays" role changed.

The new approach is to only re-layout if text of a visible role changes,
because this is the only way how the space needed by an item might
change (see KStandardItemListWidgetInformant::itemSizeHint()).

BUG: 315315
FIXED-IN: 4.10.1
REVIEW: 108984
2013-02-17 11:30:38 +01:00
Frank Reininghaus d82d92d7dd Improve the recently added test testMouseClickActivation
The method to make sure that the first item is visible turned out to be
less reliable than I thought. This could make the test hang forever.
Moreover, this commit removes some trailing whitespace that had been
added accidentally.
2013-02-13 17:56:03 +01:00
Aurélien Gâteau a7705b04dd Merge remote-tracking branch 'origin/KDE/4.10' 2013-02-11 10:53:52 +01:00
Aurélien Gâteau 66af7c390c Fix blinking when moving the mouse over an hidden item
The opacity of the unhovered pixmap must be gradually reduced while
animating otherwise the alpha channel saturates.

REVIEW: 108858
BUG: 299371
FIXED-IN: 4.10.1
2013-02-11 10:38:28 +01:00
Frank Reininghaus ced9de5b82 Merge remote-tracking branch 'origin/KDE/4.10' 2013-02-10 19:27:21 +01:00
Frank Reininghaus dc6322dc09 Re-organize the code that compares expanded items
The previous approach, which was based on comparing the URLs as
strings, was not only very complex, but also could lead to
inconsistencies in the model, namely, that not all children were
removed from the model when the dir lister reported the parent as
deleted. Later on, this could even lead to a crash.

BUG: 311947
FIXED-IN: 4.11
REVIEW: 108766
2013-02-10 18:09:07 +01:00
Frank Reininghaus 45450959ea Add benchmark for adding many child items in a tree structure 2013-02-10 18:07:55 +01:00
Frank Reininghaus 4f5a2eb943 Include parent-child relationships in KFileItemModel's consistency check 2013-02-10 18:06:07 +01:00
Frank Reininghaus ac6d3d8250 KFileItemModel::insertItems(): reserve sufficient space for m_items
This prevents expensive and unnecessary repeated rehashing when many
items are inserted into the model.
2013-02-06 18:58:54 +01:00
Frank Reininghaus ec628cfa09 Add unit test for bug 313342 2013-02-05 20:07:05 +01:00
Aniket Anvit 85ed71eb30 Apply changes of the KGlobalSettings::singleClick() setting immediately
Fixes a regression introduced by commit
7a364cbf48.

Patch reviewed and pushed by Frank Reininghaus.

BUG: 313342
FIXED-IN: 4.10.1
2013-02-05 19:58:06 +01:00
Frank Reininghaus 687d5145a2 Two small optimizations in KFileItemModel::removeItems()
1. It seems that it really can happen that KFileItems that we get from
   the dir lister's itemsDeleted signal are not in the model any more,
   e.g., if a folder where hidden files are shown is left and a folder
   where hidden files are not shown is entered. There is no need to
   output warnings then.
2. Remove the emptiness-check for the KFileItemList at the beginning.
   Even in the unlikely event that we do get an empty list, we return
   just a few lines later in the code.
2013-02-03 23:28:57 +01:00
Frank Reininghaus 01dc86f0df const QList<int> -> const QList<int>& 2013-02-03 23:19:58 +01:00
Frank Reininghaus 5f6f77d481 Remove unneeded #include 2013-02-03 23:12:55 +01:00
Frank Reininghaus 5d4d73ff08 Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	dolphin/src/tests/kfileitemmodeltest.cpp
2013-01-30 21:06:34 +01:00
Frank Reininghaus 89134d62c7 Add unit test for bug 314046
The regression happened in the master branch only, but I think it
doesn't hurt to add the test to the stable branch.

CCBUG: 314046
2013-01-30 21:02:43 +01:00
Frank Reininghaus 4396233d21 Update Dolphin version to 2.2 for KDE 4.10.0 2013-01-29 19:13:49 +01:00
Frank Reininghaus 8371fb6d75 Fix crashes in KFileItemModel::removeItems()
These crashes were caused by the recent commit
ff3267c6dc. It introduced two problems:

a) A logic error in the code that removes the ItemData pointers from
   m_itemData that could cause crashes if multiple item ranges are
   removed, and there were un-removed items behind the last one.
b) The implicit assumption that any call of removeItems() will actually
   result in items being removed in the model. This is incorrect if
   the model is first cleared and then the hidden-files setting is
   modified, which happens if "Save view properties for each folder" is
   enabled, and a folder where hidden files are shown is left. In that
   case, the dir lister emits itemsDeleted for the hidden items after
   they have been removed from the model due to the folder change.

I'll add a unit test covering these issues soon.

Many thanks to Romário Rios and Hrvoje Senjan for testing!

BUG: 314046
2013-01-29 19:08:28 +01:00
Weng Xuetian ef248162d0 Merge branch 'KDE/4.10' 2013-01-27 14:13:04 -05:00
Weng Xuetian 2045a64ec6 escape the existing text instead of set to plain text
@info indicates it's rich text and will be added <html> tag by kdelibs,
so just escape the text that will be set to label for KDE/4.10

REVIEW: 108584
BUG: 313992
2013-01-27 14:09:12 -05:00
Frank Reininghaus 1bd91417db Merge remote-tracking branch 'origin/KDE/4.10'
Conflicts:
	dolphin/src/tests/kfileitemmodeltest.cpp
2013-01-27 15:25:47 +01:00
Frank Reininghaus f76f3a1654 Move the consistency check for KFileItemModel from the test to the class
This makes it possible to check the model's consistency also in other
places, e.g., in KFileItemModel's benchmark.
2013-01-27 15:19:39 +01:00
Frank Reininghaus 891ee0c41a Add a unit test for a recently fixed crash
Before commit 90c7fd400c, adding a
KFileItem with an empty path caused a crash in
KFileItemModel::expandedParentsCountCompare().
2013-01-27 14:09:39 +01:00
Frank Reininghaus d1b75d1d64 Performance improvements in KFileItemModel::removeItems()
The performance of this method is improved by:
a) Not removing items one by one, but doing it in a way that minimizes
   the number of moves to prevent O(N^2) worst-case complexity.
b) Not sorting the removed items using the potentially extremely slow
   KFileItemModel::lessThan. We can get the indexes of the removed items
   very easily from the hash m_items, and sorting ints is a lot faster.
c) Preventing repeated rehashing of m_items when removing the deleted
   URLs by replacing remove() by erase().

REVIEW: 108540
2013-01-27 13:07:46 +01:00
Frank Reininghaus 71be8f2bee Add some benchmarks for KFileItemModel
The benchmark executable must be run manually. It is not run
automatically with the other unit tests to prevent waste of CPU cycles
in the not-so-uncommon situation that only test failures attract
attention.
2013-01-27 12:55:37 +01:00
Luca Beltrame dfa170cb49 Merge remote-tracking branch 'origin/KDE/4.10' 2013-01-24 23:49:59 +01:00
Vishesh Handa d27c16d751 KFileItemModelRolesUpdater: Avoid multiple updates for Nepomuk data
The Nepomuk ResourceWatcher emits 3 signals - propertyChanged,
propertyAdded and propertyRemoved. We should only listen to either the
propertyChanged signal or the propertyAdded + Removed signals. There is
no point in listening to all 3 signals. That will just result in
unnecessary updates.

Additionally, we do not need to listen to the resourceCreated signal.
That is only emitted when we are watching for a specific types, which we
are not.

REVIEW: 108543
2013-01-24 23:16:27 +05:30
Frank Reininghaus 6501092421 Merge remote-tracking branch 'origin/KDE/4.10' 2013-01-24 09:39:33 +01:00
Frank Reininghaus 20c3b45449 Make the "A folder cannot be dropped into itself" message less intrusive
Showing this message in the KMessageWidget above the view, which means
that the view contents are moved down, can be extremely annoying
according to user feedback. Just showing the message in the status bar
is probably enough.

BUG: 313466
REVIEW: 108483
FIXED-IN: 4.10.0
2013-01-22 07:17:35 +01:00
Script Kiddy 17cb90c470 SVN_SILENT made messages (.desktop file) 2013-01-18 08:05:47 +01:00
Script Kiddy c652cdc531 SVN_SILENT made messages (.desktop file) 2013-01-17 12:48:56 +01:00
Luca Beltrame ee2742f889 Merge remote-tracking branch 'origin/KDE/4.10' 2013-01-16 23:42:25 +01:00
Andrea Scarpino ce4498ea06 Allow Timeline-URLs as homepage
FEATURE: 313151
REVIEW: 108428
2013-01-16 23:16:10 +00:59
Andrea Scarpino 550da74b54 Allow Timeline-URLs as homepage
FEATURE: 313151
REVIEW: 108428
2013-01-16 23:04:47 +00:59
Kai Uwe Broulik 7c43fce8bf Use proper IconSize for PlacesItemEditDialog's KIconButton
REVIEW: 108443
2013-01-16 22:54:32 +01:00
Script Kiddy b8584c8c8b SVN_SILENT made messages (.desktop file) 2013-01-16 12:34:10 +01:00
Frank Reininghaus 48231488bd Remove incorrect comments about the sorting functions
In fact, we could use the sorting functions provided by Qt or the STL.
The reason why we have our own is that we want to support parallel
sorting because sorting many items naturally by name can be expensive.
2013-01-15 19:07:36 +01:00
Frank Reininghaus b47d582d35 Update Dolphin version to 2.1.98 for KDE 4.10 RC 3 2013-01-15 18:56:14 +01:00
Frank Reininghaus d9680ead80 Re-organise the sorting code
The KFileItemModel-specific parts are now separated from the generic
ones, like the parallel sorting implementation.

REVIEW: 108386
2013-01-15 18:50:37 +01:00
Frank Reininghaus 87ac18f031 Change the sort and merge functions to a more generic form.
This might make it easier to reuse the parallel sorting code. Moreover,
some the upperBound/lowerBound functions have been removed because
equivalents are provided by the STL.
2013-01-15 18:47:51 +01:00
Frank Reininghaus c652807a19 Use std::rotate, rather than reversing three times
We need less code now, and moreover, the STL implementation of rotate
should be more efficient than three reverse() calls.
2013-01-15 18:44:42 +01:00
Simeon Bird cad45e4150 The locking around the plugin access in actions doesn't seem to be
necessary, as actions is only called from the main thread.

Also it wasn't checked consistently; if the lock could not be taken, the
plugin was accessed anyway.
2013-01-15 11:12:09 -05:00
Simeon Bird 7fe1278b1e We don't need the mutex guarding m_itemStates in the
UpdateItemStatesThread, because m_itemStates is only accessed by the
when the thread is done, and set before the thread starts.

Also combine the setData function with the constructor.
2013-01-15 11:11:59 -05:00
Simeon Bird 72de114a94 Merge branch 'KDE/4.10' 2013-01-15 11:11:11 -05:00
Simeon Bird e7fe50bd3d A crash occurs if updateItemStates runs between the
UpdateItemStatesThread finishing and the finished() signal being
delivered.

In this case, a new thread was not created, because the old thread
still existed. However, pendingItemStatesUpdate was not set, because the
thread was not running. Instead, the old thread was restarted.

This meant that the finished() signal from the first run could be delivered
while the thread was running for a second time, causing the thread to be
deleted while still running and thus a crash.

Solution: set pendingItemStatesUpdate if the thread is non-null,
even if it is not running, knowing that slotThreadFinished has not yet run,
and will call updateItemStates itself.

BUG: 302264
FIXED-IN: 4.10
REVIEW: 107656
2013-01-15 11:10:58 -05:00