Commit graph

4321 commits

Author SHA1 Message Date
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 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
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