This can cause a crash when called with a single url and split view, or
when the last URL is not shown, because the iterator gets mutated in
the loop, so we need to make sure it hasn't gone out of bounds. This
check was erroneously removed in 1755380208
and needs to be brought back.
If Dolphin would be asked to open a location that is already open, don't
open it again in a new tab; instead switch to that view. Supports tabs
and split view.
BUG: 434911
FIXED-IN: 21.04
It concerns the detail view.
It can cause multiple preview to be generated for the same file.
This is visible for directories whose icons use a random value for their inner files thumbnails.
Only the view needs to be updated for this model change.
QSet<T>::erase(it) is the save way of erasing from a QSet while iterating
it. This saves creating a copy of the QSet, lookup of a node by value in
`QSet<T>::remove(item)`, and repeated rehashing caused by `remove`.
Reserve sufficient space to avoid reallocation later. Overallocating
actually requires less memory than growing and copying it, and it
is freed immediately after anyway.
The code below always adds the visible range, up to 5 pages before and
after the visible range (each capped to ResolveAllItemsLimit/2) and
the very first and last page (each up to m_maximumVisibleItems).
Use this number to avoid growing the list later.
In case the last and/or first page (a page being n=m_maximumVisibleItems
items) overlapped the already inserted items, one item for each range
would be inserted a second time, e.g. for the first page and last page:
`beginExtendedVisibleRange == 0` => `endFirstPage := 0` => `0 <= 0` is
inserted again.
`count == 100; endExtendedVisibleRange == 99; m_maximumVisibleItems == 20`
=> `beginLastPage := 99` => `99 < 100` is inserted again.
This commit removes an animation that happens when the view is
resized. Before this commit, whenever the geometry of the view
changed, the items in the view drifted towards their new position
in the layout after a 300 ms delay. It would look like the items
are slow to find their position.
This commit simply moves them to their new position in an instant
which will abort any ongoing move animations.
This commit replaces an error-prone usage of KIO::StatJob::exec() in
DolphinView with the recommended KIO::StatJob::start().
The containing method DolphinView::statusBarText() is changed to be a
method without return value: requestStatusBarText()
The new status bar text is instead returned through a new
setStatusBarText() signal that will be emitted asynchronously if
necessary.
The calling code that deals with status bar text is refactored to
correctly work despite the new asynchronicity. The helper method
calculateItemCount() is moved into requestStatusBarText() and some
other code from requestStatusBarText() is moved into a new helper
method emitStatusBarText().
The documentation of KIO::KJob::exec() explains why it should be
avoided. A reproducible crash is the reason for this commit.
show_information_panel is only created when building with baloo. only
access it when built with baloo, otherwise always report the panel as
off.
this fixes a nullptr deref because action() would return a nullptr since
show_information_panel isn't a thing in all build configurations
(full disclosure: I can't reproduce the crash, nor did I build without
baloo)
BUG: 431730
This makes more room for the new explanatory label for the zoom slider.
The zoom slider in particular was huge, and probably would have stood to
be reduced in width anyway even if we didn't add an explanaory label.
This is a backport of b1cadeba93
From b1cadeba93 Mon Sep 17 00:00:00 2001
From: Nate Graham <nate@kde.org>
Date: Tue, 15 Dec 2020 23:03:00 -0700
Subject: [PATCH] Show button to open knetattach inline with URL nav on
Remote:// view
In conjunction with
https://invent.kde.org/frameworks/kio/-/merge_requests/260,
the net result is to hide the knetattach launcher in the view, and show
it inline with Dolphin's URL navigator toolbar when viewing the
remote:// view, just like how we add an "Empty Trash" button when
viewing trash://.
The backport ensures that even with frameworks << 5.78 only one network
button is shown.
BUG: 431626
Don't show the label while still loading. Since there is no property in
`KDirLister` a dedicated `m_loading` is added for this purpose.
Also, I removed the explicit update on `urlChanged` as the view
probably won't change until the lister starts loading.
BUG: 430085
KFileItem::isSlow uses hardcoded logic that returns true if the
filesystem is Smb or Nfs. However,
KFileSystemType::determineFileSystemTypeImpl on Linux returns Nfs also
if the file system in question is a FUSE file system, which includes
NTFS, sshfs, and others.
BUG: 430778
BUG: 431106
KFileItem::isSlow uses hardcoded logic that returns true if the
filesystem is Smb or Nfs. However,
KFileSystemType::determineFileSystemTypeImpl on Linux returns Nfs also
if the file system in question is a FUSE file system, which includes
NTFS, sshfs, and others.
BUG: 430778
BUG: 431106
knetattach is part of plasma-desktop, so it doesn't necessarily have to be installed.
In that case, instead of showing a button that doesn't do anything, don't show it at all.