Commit graph

4542 commits

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