Commit graph

4318 commits

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