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
This enables some basic grouping when pointing a list at the group parents instead of the individual child elements.
Effectively unused right now (popups don't group and history only shows the application name for sections)
but this is in preparation for being able to have groups in the popup as well.
Differential Revision: https://phabricator.kde.org/D27130
Notification spec says, when replacing a notification:
> The server must atomically (ie with no flicker or other visual cues) replace the given notification with this one.
Notifications shifting about is a "visual cue".
Differential Revision: https://phabricator.kde.org/D29771
WatchedNotificationsModel is a unstable API and does not provide any
API/ABI gurantee, look and feel developers or application developers
should not use this API for time being.
Summary: This allows one to subscribe to notifications from notification server.
Test Plan:
tested using very simple QML
```
import QtQuick 2.0
import org.kde.notificationmanager 1.1 as Notifications
...
Notifications.NotificationWatchedModel {
id: model
}
```
Reviewers: #plasma, broulik, davidedmundson
Reviewed By: #plasma, broulik
Subscribers: nicolasfella, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28509
Apparently by default it only considers "out of range" indices invalid but an invalid one as valid.
CCBUG: 418347
Differential Revision: https://phabricator.kde.org/D29297
Summary: Some applications, e.g. pamac, don't send an app_name, which is legal according to the fd.o spec. In this case try to read it from the desktop file before falling back to the process name.
Test Plan: I get a better appname for pamac notifications now
Reviewers: #plasma, broulik, mart
Reviewed By: #plasma, mart
Subscribers: crossi, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27786
QML needs it on the model it uses (Notifications) where they used to be but GammaRay seems to be taking them from the source (NotificationsModel).
This has both models (and jobs model) return the roleNames() and moves them to Utils so they're shared.
Differential Revision: https://phabricator.kde.org/D28657
This ensures that newer notification popups don't push old ones out.
Some applications are notorious for spamming the user which right now results in a firework
of notification popups. With this patch only the number that fits on screen is displayed and
everything beyond that is off screen until there's enough room for new popups which are
then gradually lowered.
It also reduces the likelihood of the notification the user is interacting with being shifted
away by an incoming notification. Furthermore, since notifications that are off screen will
have their timeout reset, it can happen that you have a bunch of recent notifications at the
bottom but then get some old ones that were off screen sliding back in because some middle ones
have expired already, leading to awkward results.
Notification scoring (e.g. critical before normal) is untouched, so a "battery is critical" notification
will show up even if it's still chugging through the backlog of browser notifications.
Differential Revision: https://phabricator.kde.org/D28646
Allows to control the behavior of those applications rather than flat-out ignoring them.
Adjust default configuration to blacklist them, though.
Differential Revision: https://phabricator.kde.org/D26160
This adds a quick reply feature with a text field inline in the notification popup.
An action named "inline-reply" will spawn the text field and a NotificationReplied signal is emitted then.
There's additional kde hints for changing the placeholder text (defaults to "Type a reply..."),
submit button text (defaults to "Send") and submit button icon name (defaults to "document-send",
that paper aeroplane icon).