Stefano Crocco [Sun, 14 Jan 2024 09:36:32 +0000 (09:36 +0000)]
Never emit the fileMiddleClickActivated signal if isTabsForFilesEnabled is true
Commit d27ee07d makes it impossible for applications embedding Dolphin part (for example, Konqueror) to react to middle mouse click on a file. If I understand correctly (I'm not familiar with Dolphin code) the `fileMiddleClickActivated` signal is connected with a slot in `DolphinViewContainer`, which is only used by Dolphin itself and not by `DolphinPart`. The result is that middle clicking on a file (except archives) from a Dolphin part has no effect.
To avoid this situation, I removed the check for `!archiveProtocolIsEmpty()` in the `else if` condition. This way, if `isTabsForFilesEnabled()` is `true`, which should be true if and only if the view is inside a `DolphinPart`, the `activeTabRequested` or `tabRequested` signal will be emitted, allowing the embedding application to respond however it wants. When the view is inside the Dolphin application, instead, `isTabsForFilesEnabled()` will always be `false`, so the new behavior will be used.
Amol Godbole [Thu, 9 Nov 2023 17:05:48 +0000 (11:05 -0600)]
DolphinMainWindow: autosave session
Currently, the session is saved only when the app quits normally. Save
the session after a fixed time interval from the last state change i.e.
anytime the url is changed, or a tab is opened or closed, or the active
view is changed.
Akseli Lahtinen [Wed, 10 Jan 2024 09:22:46 +0000 (09:22 +0000)]
terminalpanel.cpp: Set m_konsolePart to nullptr during exit signal
If Dolphin terminal is open, and one types `exit` there and then closes Dolphin, Dolphin crashes due to a dangling pointer.
Konsole KPart is deleting itself when Konsole session exits, but Dolphin tracks it as a child of the Terminal Panel.
The Terminal Panel doesn't get destroyed when Konsole KPart does, and it tries to double free during children clean up.
(Thanks @sitter !)
Setting `m_konsolePart` to `nullptr` during exit signal fixes this, since there is already check in place for that in the destructor.
Marius P [Thu, 28 Dec 2023 01:36:41 +0000 (03:36 +0200)]
org.kde.dolphin.appdata.xml add launchable
Fix "appstreamcli validate --explain" issue
"I: org.kde.dolphin.desktop:~: desktop-app-launchable-omitted
This `desktop-application` component has no `desktop-id` launchable tag,
however it contains all
the necessary information to display the application. The omission of the
launchable entry means
that this application can not be launched directly from installers or
software centers. If this
is intended, this information can be ignored, otherwise it is strongly
recommended to add a
launchable tag as well.".
In short:
> The above change moves the `m_view->setFocus()` towards a point in time in
> which `DolphinViewContainer`'s selection mode state is consistent again.
Akseli Lahtinen [Fri, 15 Dec 2023 13:07:12 +0000 (13:07 +0000)]
Resort directory size count after refreshing
After refreshing the view when
size count is selected as the sortRole,
count is 0 at first. When the actual count is loaded,
the sorting is done according to the count being 0.
This can break the sort order and cause view and model
to be out of sync.
Making sure we always resort all items
when the directory size/item count is changed fixes this
Akseli Lahtinen [Fri, 8 Dec 2023 10:59:19 +0000 (10:59 +0000)]
Do not reset expandability when loading previews
Fixes a weird bug with the treeview if one has
```
[PreviewSettings]
Plugins=audiothumbnail
```
in their `dolphinrc`. It can be any PreviewSettings plugin, as long as there it at least one.
Check the bug report for more, but in short, the bug is reproducible like this:
The path to the bug is: `KFileItemModelRolesUpdater::slotPreviewFailed` -> `KFileItemModelRolesUpdater::applyResolvedRoles` -> `KFileItemModelRolesUpdater::rolesData` -> `KFileItemModelRolesUpdater::startDirectorySizeCounting`.
This causes Dolphin with preview plugins enabled trying to count the directories again, and the data gets reset even if there is something there. This then resets the `isExpandable` flag and that breaks the treeview, causing all kinds of issues, like being able to expand non-directories and makes things out of sync.
David Edmundson [Thu, 7 Dec 2023 11:14:45 +0000 (12:14 +0100)]
Do not cache indexes across async tasks
Capturing an index is unsafe as it could be out of date when this is
processed. The user could have changed directory inserted a file or
changed sorting order.
Felix Ernst [Fri, 24 Nov 2023 11:18:19 +0000 (12:18 +0100)]
Reduce status bar minimum width
This is to make sure that when the window is resized it is less
likely that the places panel will be resized only because the
status bar doesn't want to become very narrow in width.
Felix Ernst [Sat, 18 Nov 2023 11:31:00 +0000 (12:31 +0100)]
Turn free space label into a flat button
The usage of a label to show this space information is problematic
because there are features/actions hidden behind clicking the
label. A button makes this clear. It also fixes the accessibility
of this control because previously this info would never be read
out by screen readers as it couldn't get keyboard focus.
A side-effect of this change is that the free disk space bar looks
more normal with non-Breeze styles. This had been a long-standing
issue.
Felix Ernst [Mon, 13 Nov 2023 16:50:24 +0000 (17:50 +0100)]
Make main view react to context menu events
Before this commit, Dolphin's main view would not react to any
context menu events. It only showed context menus based on
hard-coded mouse or keyboard events i.e. mouse right-click and
presses of the "Menu" key.
This commit removes those hard-coded reactions and instead makes it
so the view shows a context menu whenever a QContextMenuEvent is
received. Therefore, a context menu will now be opened when any
platform- or system-specific context menu triggers are invoked e.g.
the Shift+F10 keyboard shortcut.
Aside from this, the only side-effect is a partial removal of an
unrelated bug: Previously, the hover highlight on items was never
cleared when the header column in details view mode was hovered.
With this commit, the hover is now correctly cleared most of the
time.