Nate Graham [Fri, 23 Apr 2021 00:06:06 +0000 (18:06 -0600)]
Set initial size corectly
The resize() that we do to set the initial size is working around a
bug in frameworks that is going to be fixed soon. See
https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/53.
Nate Graham [Fri, 9 Apr 2021 19:29:30 +0000 (13:29 -0600)]
Increase default window size
The current default window size of 750x500 is quite small on today's
screens, and results in an initial user experience of a very cramped app
window. The very first action that I see from new users interacting with
Dolphin is to make the window bigger.
So let's do it for them by making the default window size a bit bigger
ourselves.
Before this patch when !m_sortDirsFirst and DetailsModeSettings::directorySizeCount() == true, the ordering of folders before files would be affected by the sortOrder. I.e descending order would put the folders after the files.
The loader looks for the plugins in ${QT_PLUGIN_PATH}/dolphin/vcs.
The old method of loading the plugins is kept around for now, to support
external, legacy plugins.
Nate Graham [Tue, 30 Mar 2021 19:30:27 +0000 (13:30 -0600)]
Fix crash calling openDirectories() in various cases
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 175538020824355115cd98637ce83ecc53badd44
and needs to be brought back.
Nate Graham [Thu, 18 Mar 2021 19:42:59 +0000 (13:42 -0600)]
Don't re-open already-open URLs when using session-restore feature
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.
Méven Car [Fri, 19 Feb 2021 14:04:23 +0000 (15:04 +0100)]
KFileItemModelRolesUpdater: Avoid refreshing items when we receive their content count
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.
Stefan Brüns [Mon, 15 Feb 2021 16:40:17 +0000 (17:40 +0100)]
[FileItemRolesUpdater] Use STL-style iterator instead of iterating a copy
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`.
Stefan Brüns [Mon, 15 Feb 2021 16:34:01 +0000 (17:34 +0100)]
[FileItemRolesUpdater] Reserve space in two temporary lists
Reserve sufficient space to avoid reallocation later. Overallocating
actually requires less memory than growing and copying it, and it
is freed immediately after anyway.
Stefan Brüns [Mon, 15 Feb 2021 10:25:28 +0000 (11:25 +0100)]
[FileItemRolesUpdater] Fix reservation size
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).
Stefan Brüns [Mon, 15 Feb 2021 10:16:32 +0000 (11:16 +0100)]
[FileItemRolesUpdater] Fix calculation of requested indexes
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:
Felix Ernst [Mon, 8 Feb 2021 17:40:55 +0000 (18:40 +0100)]
Remove item move animation on view resize
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.
Felix Ernst [Mon, 8 Feb 2021 21:32:10 +0000 (21:32 +0000)]
Avoid KJob::exec() in DolphinView
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.
Nate Graham [Thu, 10 Dec 2020 16:28:50 +0000 (09:28 -0700)]
Make zoom slider and free space bar a little smaller by default
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.
From b1cadeba939155282a9fadf7d7b025d6529c489e 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.
Ilia Kats [Tue, 12 Jan 2021 18:24:31 +0000 (19:24 +0100)]
fix folder size calculation on FUSE and network file systems
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.
Ilia Kats [Tue, 12 Jan 2021 18:24:31 +0000 (19:24 +0100)]
fix folder size calculation on FUSE and network file systems
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.
Antonio Rojas [Fri, 15 Jan 2021 17:02:03 +0000 (18:02 +0100)]
Don't show "Add network folder" button if knetattach is not available
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.
Stefan Brüns [Mon, 28 Dec 2020 02:23:23 +0000 (03:23 +0100)]
[BalooRolesProvider] Use Property IDs instead of string matching
Instantiating KFileMetaDataInfo for each file and property, even when
the role is not used, is somewhat expensive and unnecessary. Use the
numeric Property ID to map it to a role, and only instantiate the used
PropertyInfo's.
Remove the properties provided by KFM::UserMetaData from the map, as
these will newer match.
Stefan Brüns [Mon, 28 Dec 2020 00:07:52 +0000 (01:07 +0100)]
[BalooRolesProvider] Reduce number of XAttr reads
Typically most of the extended attributes are not set for a file. Instead
of trying to fetch each attribute individually check which attributes
exist first.
Kai Uwe Broulik [Wed, 6 Jan 2021 19:16:31 +0000 (20:16 +0100)]
Emit "itemMiddleClicked" when Ctrl-clicking a view in single selection mode
When Ctrl can't cause a change in selection, so instead emit `itemMiddleClicked`.
This way one can Ctrl-click a Place or folder in Folders panel to open it in
a new tab, similar to what web browsers.
Nate Graham [Wed, 16 Dec 2020 06:03:00 +0000 (23:03 -0700)]
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://.