Felix Ernst [Fri, 20 Nov 2020 15:17:08 +0000 (16:17 +0100)]
Select last visited folder when going up/back
This commit fixes a regression introduced by ad5d3367c7fef4c3c11188a768f21a2ee2b3c025. A lot of connections were
changed there and at least one of them was wrong. The connections can
be separated into GUI connections and internal ones. This commit makes
it so the GUI stuff is connected to m_urlNavigatorConnected and
everything else to m_urlNavigator.
Felix Ernst [Thu, 19 Nov 2020 21:22:27 +0000 (21:22 +0000)]
Allow having the UrlNavigators below the tab bar
This commit restores the possibility to have the UrlNavigators below
the tab bar. This will happen automatically whenever the UrlNavigator
is removed from the toolbar.
It is also now again possible to have the toolbar on the side. This
option is disabled while the toolbar contains the UrlNavigators.
This commit makes no changes to the new default which is having the
UrlNavigators in the toolbar but makes sure that upgrading users won't
be affected.
Alexander Lohnau [Thu, 12 Nov 2020 09:01:08 +0000 (10:01 +0100)]
Fix qrc icon
Apparently the icon was not null, because the mimetype was known.
But there was no icon associated with it and we got an
icon which is not null, but has a null pixmap.
Felix Ernst [Thu, 5 Nov 2020 22:30:07 +0000 (23:30 +0100)]
Adress most of the second round of Angelaccio's review comments
This commit applies most suggestions which were made on the MR.
Most notably the DolphinUrlNavigator class is split up which leads to
the creation of a DolphinUrlNavigatorsController class.
Additionally some minor coding style and const correctness changes are
included.
The error value of cached integers is changed from -1 to INT_MIN
because situations could come up in which -1 would be a valid value.
Felix Ernst [Wed, 28 Oct 2020 16:52:29 +0000 (17:52 +0100)]
Fix a crash and extract unrelated changes
The secondary UrlNavigator is now created when and only when:
- split view mode is activated for the active tab
OR
- switching to a tab that has split view already enabled.
This fixes a crash that occurs when the setting to always start in
split view mode is enabled.
An animation for activating split view is also removed from this and
moved into a separate MR. Another unrelated name change left over from
a previous commit (viewContainers() -> activeViewContainers()) is
dropped.
Felix Ernst [Sun, 20 Sep 2020 16:53:59 +0000 (18:53 +0200)]
Make UrlNavigators in the toolbar the only option
The UrlNavigators will be automatically added to the toolbar. The Sort By
action is removed from the default toolbar to make space.
Remove all options to have UrlNavigators outside the toolbar and remove
those code paths.
Make it so the new NavigatorsWidgetAction contains two UrlNavigators when
in split view mode. Spacing was also added to align these UrlNavigators
with the ViewContainers when enough space is available.
Force the toolbar to be either at the top or bottom of the window.
Set a sane sizeHint for DolphinUrlNavigator. It would be better to do this
in KUrlNavigator in the future.
This commit also contains a changes which should be moved to a separate
merge requests before this gets merged:
- Add an expansion animation when split view is enabled by the user
Felix Ernst [Thu, 27 Aug 2020 16:55:18 +0000 (18:55 +0200)]
Add the UrlNavigator to the toolbar automatically if needed
This commit adds the DolphinUrlNavigatorWidgetAction::addToToolbarAndSave()
method which changes the users toolbar configuration to contain an
Url Navigator. This way the user doesn't need to do anything manually.
Aside from that a bunch of minor fixes like renaming and reordering
Felix Ernst [Wed, 12 Aug 2020 18:45:17 +0000 (20:45 +0200)]
Adress the first round of Angelaccio's review comments
- Split the viewContainers(bool includeInActive) into two methods
without parameters
- Prevent users from accidently hiding all Url Navigators by
preventing the dangerous action and then displaying a helpful
message instead
Unrelated to review comments: Remove a useless line of code
Felix Ernst [Sun, 14 Jun 2020 14:20:02 +0000 (16:20 +0200)]
Add an option to use an UrlNavigator in the toolbar instead
This commit adds a locationInToolbar KToggleAction to switch between
using a location bar to navigate or using a new custom QWidgetAction
in the toolbar.
A big portion of this MR is refactoring because until now the
UrlNavigator was tightly intertwined with the DolphinViewContainer.
With this MR an UrlNavigator for controlling a View can be freely
connected or disconnected with a single method call.
A DolphinUrlNavigator class is created in the process which contains all
Dolphin-specific UrlNavigator code which did previously reside in the
DolphinViewContainer class. Other application parts that belong to
UrlNavigator-management are also moved here.
Elvis Angelaccio [Tue, 18 Aug 2020 21:47:53 +0000 (23:47 +0200)]
Add support for KUserFeedback
This commit introduces KUserFeedback in dolphin with some basic data
sources and with a settings page to configure the telemetry values.
There are also a couple custom data sources as proof of concept: a bunch
of settings and the count of available network shares as listed by Solid.
The settings page is shown only if the user feedback framework is
enabled, but currently in Plasma we don't have a global kill switch to
disable it.
At the moment we never show an encouragement message. We need to connect
to the `Provider::showEncouragementMessage()` signal, but first we
should agree to a common way to show a non-annoying message to the users.
Chris Holland [Thu, 1 Aug 2019 01:46:53 +0000 (21:46 -0400)]
Only check if place url is mount point once during polish event.
The capacity bars will no longer update when capacity changes. It only
checks the size on init.
Updating during polish event is only a temporarily solution just to
draft code flow for seperating logic from painting. Eventually this
logic update should be in a worker thread detached from blocking the
rendering thread that blocks launching the dolphin window.
Chris Holland [Mon, 20 May 2019 17:47:48 +0000 (13:47 -0400)]
Draw 2 Rectangles below mount points to represent a disk capacity bar
Draws overtop text that's goes below the baseline like a 'j'. It's
fairly difficult to add extra space below the text as the places view
is a "details" view, so the text is vertically centered in the
widget's "row" as you'd desire it to in the main file view.
We can make the widget 8px taller, adding 4px above and below so
there's adequate room for the capacitybar, but that wastes 4px for
each mount point.
Ideally we'd use the "compact" view, which displays the text/size in a
column beside the icon. However the compact view was not designed to
take up the entire width of the viewport. It's also designed to
overflow with a horizontal scrollbar.
Méven Car [Sat, 31 Oct 2020 11:40:57 +0000 (12:40 +0100)]
FolderPanel: prevents scanning directory tree recursively
KFileItemListView contents are periodically scanned by KFileItemModelRolesUpdater.
It uses then KDirectoryContentsCounter to scan directories to determine their size possibly recursively.
Introduce a scanDirectories setting to disable directory scanning by KFileItemModelRolesUpdater.
Lothar Paltins [Tue, 27 Oct 2020 14:54:03 +0000 (15:54 +0100)]
Fix wrong parameter in function call
In KDirectoryContentsCounterWorker::CountResult, the first parameter in
the call of walkDir was wrong. It should be path without conversion,
because the conversion is done in the called function.
Nate Graham [Tue, 13 Oct 2020 19:37:11 +0000 (13:37 -0600)]
Don't session-restore invalid paths
When session restore is populating the main window, it's unconditional;
you'll get whatever was there before. This can be a problem if any of
those things are now missing. For example, maybe you were browsing files
on a removable disk, then quit Dolphin, and finally removed the disk. The
next time you launch Dolphin again, it will try to show you the
view from the now-missing removable disk.
To prevent this, we now look at all the URLs in all of the view
containers that were created after session-restore has finished doing
its thing; if any of them are invalid local URLs, we change the URL to
the home folder instead to avoid showing the user a view with an invalid
location in it.
Nate Graham [Tue, 13 Oct 2020 17:51:59 +0000 (11:51 -0600)]
Show home folder if needed after unmounting mounted disk
Right now, when you unmount a device that any active view containers are
displaying, nothing in the view changes. As a result, it's possible to
try to navigate to files or folders in that view, which cannot be done
because the disk that the files or folders are located on has been
unmounted!
With this commit, we detect that case and switch the view containers
to show the home folder after the disk whose contents they are displaying
gets unmounted.
Nate Graham [Sat, 17 Oct 2020 00:35:54 +0000 (18:35 -0600)]
Fix DolphinMainWindow::viewContainers() to take into account split views
The function was previously assuming that each tab view has exactly one
view container, which is not necessarily accurate; some could have a
split view open.
Henri Chain [Wed, 21 Oct 2020 10:20:56 +0000 (10:20 +0000)]
D-Bus activation systemd service
Correctly scopes dolphin in systemd service `app-org.kde.dolphin.service` when dbus-activated (while still working if systemd is not present), as per https://systemd.io/DESKTOP_ENVIRONMENTS/
uses new ECM modules:
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/5 to simplify the systemd service templating + install
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/17 to generate the dbus service file automatically
We know that that variants will be either ints (for `count`) or longs (for `size`),
so just convert them to longs (to avoid overflows) and compare those.
```
The QLabel changes to the pixmap/picture getters provide the following
migration path:
QPixmap *ppix = l->pixmap(); // up to 5.15, warns in 5.15
QPixmap pval = l->pixmap(Qt::ReturnByValue); // new in 5.15, works in 6
QPixmap pixmap = l->pixmap(); // from Qt 6 on
```
Since we can't require 5.15 yet in dolphin, the port is done only when
building with Qt >= 5.15
Nate Graham [Tue, 6 Oct 2020 18:16:25 +0000 (12:16 -0600)]
When restoring former window state, append any URLs passed as args
Before, when Dolphin was closed but opened with any URLs, it would open
a new window with only those URLs, rather than restoring any window
state (if the user has this feature enabled).
Now, Dolphin will first restore state (if enabled) and then append any
URLs, rather than replacing the existing set of URLs.
The "new instance" case was previously handled automatically and now
needs to be explictly handled by checking for it, to make sure that new
instances give you a clean window rather than a state-restored window.
Ahmad Samir [Thu, 1 Oct 2020 16:21:18 +0000 (18:21 +0200)]
Don't trigger rubberband with back/foward mouse buttons
Right now the back/foward mouse buttons work, but also if you hold either
of them and move the mouse the rubberband selection is triggered.
This is the correct fix (instead of commit d0c71a1435bc9d), to match the
original code before the touch events patches, we need to check the
back/foward buttons after mouseButtonPressed is emitted and before
triggering the rubberbad selection.
Nate Graham [Sat, 3 Oct 2020 15:39:16 +0000 (09:39 -0600)]
Don't warn when closing multiple tabs if restoring window state
When we're using the "restore window state" feature, there's no need to
warn when closing multiple tabs, because they're saved and you can just
re-open the window.
Jonathan Marten [Wed, 23 Sep 2020 11:07:29 +0000 (11:07 +0000)]
Select/Unselect dialogue: Retain a history of entries made there
It's a very useful facilitity, and having a history of entries and being
able to recall earlier ones makes it even more useful for repetitive
operations.
Nate Graham [Fri, 18 Sep 2020 00:34:11 +0000 (18:34 -0600)]
Make "Show hidden files" action follow HIG
The action is a toggle action, for which the HIG prescribes that the
text should describe the action's checked state, and neither the text
nor the icon should change when the action is checked. Other toggle
actions in Dolphin follow these rules, but this one does not.