Commit graph

4174 commits

Author SHA1 Message Date
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
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
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
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 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 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
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
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
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
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
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 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 ee2d453f1f SVN_SILENT made messages (.desktop file) 2013-04-19 13:27:40 +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
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 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 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
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
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 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
Script Kiddy 36510e16f7 SVN_SILENT made messages (.desktop file) 2013-02-22 06:41:23 +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 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 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 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 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 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
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 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
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 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 c652cdc531 SVN_SILENT made messages (.desktop file) 2013-01-17 12:48:56 +01:00