Also factor out the code that transforms a sorted list of ints to a
KItemRangeList. This removes some duplicated code from KFileItemModel.
Note that overriding operator<<() in KItemRangeList was necessary
because it's not a typedef for QList<KItemRange>, but a class derived
from that now, and some code fails to compile if the return type of
that function is QList<KItemRange> and not KItemRangeList.
REVIEW: 112728
KFileItemListView notifies KFileItemModelRolesUpdater of changes of the
visible index range and the icon size with a delay, to prevent that
expensive operations are triggered repeatedly, and that scrolling feels
sluggish because the GUI thread is blocked by icon loading.
This patch ensures that the "long" delay of 300 ms is only used when
the zoom level is changed, and the "short" delay if only the visible
index range has changed.
Thanks to Christoph Feck for helping to analyze this problem!
BUG: 322093
FIXED-IN: 4.11.2
REVIEW: 112580
Take the style option vertical/horizontal margin into account
for the calculation of the new scroll offset.
Thanks to Frank for pointing out two other problems with "Page Up/Down" and providing
a better way to fix these problems. :)
BUG: 311099
FIXED-IN: 4.11.2
REVIEW: 112678
When sorting by, e.g., "Size", and the name is used as a fallback
because there are multiple files with the same size, the refreshItems
signal that is received when a file's name is changed either with the
dialog or outside the current view did not cause the view to be resorted
after commit d70a481180. This patch fixes
it.
BUG: 324713
FIXED-IN: 4.11.2
REVIEW: 112561
The most recent commit from the KDE/4.11 branch (new unit test) had to
be modified slightly due to the changed signal emission when resorting
the model changes only the groups, and not the order of the items
(groupsChaged instead of itemsMoved).
The idea is that we no longer assume that the "expandedParentsCount"
for each item will be stored in the QHash. It is only accessed for
items which are expanded, and which are not top-level items (i.e.,
which have an expandedParentsCount > 1).
Some unit tests are added to improve the coverage of the affected code.
REVIEW: 112562
Implemented setActive(bool active), isActive() and activated() signal
for DolphinSearchBox - similar to the KUrlNavigator implementation.
BUG: 296970
FIXED-IN: 4.11.2
REVIEW: 112534
This prevents that the GUI freezes if there are many files inside the
directory, or if the access to the directory is slow for some other
reason.
BUG: 318518
REVIEW: 111920
FIXED-IN: 4.12.0
Currently, KStandardItemListWidgetInformant::itemSizeHint() calls the
model's data(int) method for every single item, but the full data is
actually only needed for the size calculation in Compact View. In
Details View, no data is needed at all to determine the size required
for the item, and in Icons View, only the name is needed.
This patch makes it possible for subclasses of
KStandardItemListWidgetInformant to provide an alternative way to
obtain the "text", and implements this in the subclass
KFileItemListWidgetInformant.
The final goal is to achieve that the QHash which contains all data
for a file item is only created if it is really needed, e.g., because
the view needs access to the data for displaying the item on the
screen.
REVIEW: 112253
Removed all signal-slot-connections related to DolphinNewFileMenu->errorMessage(QString)
in DolphinMainWindow and DolphinContextMenu and replaced it by a better solution.
Now we make use of the already existing DolphinNewFileMenuObserver singleton class to achieve a better
error handling, because every newly created DolphinContextMenu instance registers himself by DolphinNewFileMenuObserver
and we use this to connect the errorMessage(QString) signal of every DolphinContextMenu instance to the errorMessage(QString)
signal of the DolphinNewFileMenuObserver singleton class.
So we need only one connection from DolphinNewFileMenuObserver to DolphinMainWindow (or to DolphinPart) to
collect all error messages thrown by every DolphinNewFileMenu instance.
REVIEW: 112178
When the name of a file is too long to be shown inside the maximum
number of lines, the last line is elided. However, there were several
problems before this commit:
(a) "lastTextLine", which contains the text to be elided, was not
assigned the complete remaining text, but only the part that would
be put into the last line if there were more lines following. This
may be less than what would fit into the line because we try to not
break the text at random points.
(b) QFontMetrics::elidedText() was not given the width that is available
for the last line (that would be maxWidth), but only the width that
would be occupied by the text if there were more lines following
(line.naturalTextWidth()).
(c) The variable "nameWidth", which is required to calculate the QRectF
that is reserved for the name, was not updated correctly.
The result is that the text was sometimes trucated too early (especially
if there would be a line break early in the text if we had more lines
available), that there may be insufficient space to show the "...", and
that the hover/selection rectangle might be too narrow.
BUG: 304558
BUG: 321882
FIXED-IN: 4.11.1
REVIEW: 112265
KFileItem::determineMimeType() not only determines the mime type, but
also the icon. For folders, it looks for a .directory file inside the
folder, where a custom icon might be stored. This can take quite a bit
of time and cause the problem that some folder's type still appears to
be "unknown" when the view is shown.
We can work around this problem by caching the folder mime type in a
static QString and applying to to all folders, which can be identified
easily with KFileItem::isDir(),
BUG: 321710
FIXED-IN: 4.11.1
REVIEW: 111830
This should prevent crashes that can be caused if the view is closed in
a nested event loop that is run from the role editor.
BUG: 322969
FIXED-IN: 4.11.1
REVIEW: 111988
to avoid too much expensive resorting calls, in case of many refresh items signals.
Followup to patch 111146
CCBUG: 303873
CCBUG: 299565
BUG: 323789
FIXED-IN: 4.11.1
REVIEW: 111195
This patch changes the status bar text dolphin shows when a folder is
hovered. It now shows full folder info, eg:
"mydir (folder, symlink to /opt/mydir")
instead of:
"mydir"
This is consistent with dolphin's behavior on regular files, and
DolphinPart already does that (DolphinPart::slotRequestItemInfo has no
special cases for folders).
CCBUG: 260717
REVIEW: 112106
The purpose of this change is to give the user a chance to see hover
file information if it doesn't fit in the status bar, by allowing to
click on the file and hover on the status bar.
As it's now possible to have status bar texts starting with "<qt>",
DolphinPart::updateStatusBar() must escape strings. Otherwise,
filenames such as "<qt>Tes<font color=red>t" would be rendered as HTML
data in konqueror's status bar when selected.
BUG: 260717
FIXED-IN: 4.12.0
REVIEW: 111934
KFileItemModel::setData() should not only cause a resorting when the
sort role is changed. The name is always used as a fallback if the sort
role of multiple files is equal, therefore, renaming a file can change
the correct order of the files even if the files are not sorted by
"name".
Unit test included.
BUG: 323518
FIXED-IN: 4.11.1
REVIEW: 111721
Storing values which are equivalent to default-constructed QVariants
does not make much sense because QHash::value returns the same value
even if the corresponding key is not found in the hash.
This commit reduces Dolphin's memory consumption in large folders by
up to 7.3% (tested a folder with 100,000 files in Details View) and
reduces the time required for loading a folder.
BUG: 323517
FIXED-IN: 4.11.1
REVIEW: 111922
The problem was that we drawed the overlays using KIconLoader, which can
be very slow, every time an item appeared on the screen. This commit
makes sure that not only the icon, but the icon including overlays is
cached in QPixmapCache. Therefore, the overlay drawing is done just once
for each icon+overlays combination.
For previews, the overlay drawing is done in KFileItemModelRolesUpdater
just after the preview is received.
BUG: 310662
BUG: 314339
FIXED-IN: 4.11.1
REVIEW: 111956
The problem was that items are removed from m_visibleGroups while
a QMutableHashIterator iterates over this hash, such that the iterator
can become invalid. The solution is to use a QHashIterator instead,
which takes a copy of the hash. Therefore, it is not affected if
m_visibleGroups is modified in any way.
BUG: 323248
FIXED-IN: 4.11.1
REVIEW: 111919
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
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/
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
- 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
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
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
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
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
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
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
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
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!
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
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
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
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
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
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
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
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
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
The slot DolphinViewContainer::focusView(), introduced in commit
2f0114730d, is actually unnecessary
because DolphinViewContainer::requestFocus() provides the same
functionality already.
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
This concept is not needed anymore because of the new "determine parents and
expansion levels" approach
Side effect:
Enables treeview for trash, ...
REVIEW: 109191
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
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
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.
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
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.
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
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
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.
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
@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
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
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.
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
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
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.
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.
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.
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.
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
Emmanuel has contributed a lot of useful patches to Dolphin. Thank you
very much for that! The Dolphin community is looking forward to further
contributions from you.
CCMAIL: emmanuelpescosta099@gmail.com
The intention of the tinting was to make it more obvious in icons view
which icons are selected. However, some icons and previews look quite
ugly with the current tinting value of 1.0 (i.e., the value passed to
KIconEffect::colorize). A slight reduction of this value to 0.8 makes
this a little less ugly. However, the real fix is to remove the tinting
altogether and find something better to indicate which items are
selected.
CCBUG: 309722
The reentrant natural comparison of strings is the only really
expensive operation. Other comparison functions are much cheaper and
might not be reentrant at all. Therefore, we disable parallel sorting
when not sorting by name to prevent crashes and other unpleasant
behaviour.
BUG: 312679
FIXED-IN: 4.10
REVIEW: 108309
Only fixes the most obvious file name, the other entries in the table
probably have to be fixed in the FileMetaDataWidget.
REVIEW: 108307
BUG: 262464
(cherry picked from commit 3d7d900d28)