Normally you wouldn't see this because a copy job has a `destUrl`
(which is why I didn't notice) but when removing the filename to "go up"
we need to strip the trailing slash, too.
This ensures that the first `update()` call with the summary will be shown
atomically to the user rather than show an empty job popup briefly.
Also handle the delay on a per-job basis, previously there was a common
timer, which made no sense.
There is no conceivable use case for turning this off, and the UI is
being removed in https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/447.
So let's remove the backend code too, or else anyone who for some reason
had turned it off would be left without a GUI method of turning it back
on again.
Also keep `created()` with the original notification.
As per spec a notification must be replaced atomically with no visual cues.
Transfer over properties that might cause this, such as unread showing the bell again.
xdg-desktop-portal forwards appId only for sandboxed apps it can trust,
essentially blocking us from posting an inhibition from xdg-desktop-portal
as we wouldn't have an app.
This allows a client to mark a notification as "resident" which means it will
not be closed by the sever when expired or an action is invoked, thus transferring
full control over notification life time to the client.
A notification popup still times out as normal (unless persistent, of course)
but the notification remains alive until the client revokes it or a user
explicitly closes it.
It is opt-in so that a client can expect the notification lifetime to be
indefinite and explicitly close it when an action is invoked on its end.
It's dest*url* after all. Makes it easier to debug why it's not displaying correctly.
According to Qt `/foo/bar` is a child of `stfp://foo`, which completely throws
off `KFilePlacesModel`...
Ensures that a file or destination named `<h1>foo.txt` doesn't break the layout.
It still goes through the normal HTML text filter, so remote file access isn't
possible, merely screwing up the layout.
This ensures that an error message the app might have sent in response to the
cancel request is still shown.
Also, while at it deduplicate code by calling into `terminate` from the
service watcher.
This got removed in d82513ce88 as I thought a user would
always have a "Root" entry, leading to "Root/foo" paths.
However, if you hide a place, it will naturally not be considered for `closestItem`
resulting in the final `QUrl::toDisplayString` being hit, giving us a not so
nice `file:///` URL.
While this was in principle a good idea to keep active jobs at the top of the
history, it can cause unwanted dialog shifts and dialog recreation when there
are two jobs and the first one finishes and then the second one finishes.
When removing a notification, it is removed from the model, which will cause the
view to update and move up an older notification, if any. If you now delete a bunch
of notifications in quick succession we will create a dialog every time which then
gets deleted again, causing another notification to move up, etc causing high CPU
spikes and plasma freezes.
This patch compresses removing notifications and tries to announce consecuetive
ranges of notifications to be removed in one go.
BUG: 423594
FIXED-IN: 5.21.0
In case no application name is set but we found a service, use the service name.
Also prefer the service name when the application name just looks like the desktop
entry, e.g. VLC just sets "vlc" as application name, which we would then override
to "VLC media player" from the vlc.desktop we might have found.
This is actually mostly just preparation for should we add a look up of the desktop
entry through the process CGroup.
We do this sometimes, but not consistenly.
The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
This changes the displayed destination of a file operation in the summary
to be relative to the closest user's place, similar to how the KUrlNavigator
(address bar) does it in Dolphin, for example:
* /tmp: Root/tmp
* /home/user/Documents: Documents
* /home/user/Documents/foo/bar: Documents/foo/bar
* ftp://example.com/var/www/clients/user/blog/uploads: My Blog/uploads
* sftp://192.168.0.123/home/user/stuff/kf5/plasma-workspace: Build Server/stuff/kf5/plasma-workspace
Especially for remote locations the user has bookmarked this can tremendously
clean up the displayed address, showing a nice name rather than the full URL.
The other logic about showing local paths and replacement of $HOME by tilde has been
removed as both Root and Home are default places that are likely to be present.
This unit is neutral, it doesn't distinguish between e.g. file and dirs,
just counting items. Useful in e.g. notifications of batch rename jobs.
CCBUG: 422098