[PoC] Make notifications work without a notifyrc file
Needs ReviewPublic

Authored by nicolasfella on May 4 2020, 1:15 PM.

Details

Reviewers
broulik
vkrause
Group Reviewers
Frameworks
Summary

In KNotificationManager when reading the actions default to Popup when no actions are found. In notifybypopup default to QGuiApplication::applicationDisplayName() when reading the app name. The logic for the icon is not changed, worst case we get empty which may get overridden by the user.

Other backends are still todo

Test Plan

Deleted notifyrc file from KDE Connect. Still get notifications. As a side effect the pairing notification now shows "KDE Connect Daemon" instead of "KDE Connect". This could be changed with a new setter or x-kde-display-appname

Diff Detail

Repository
R289 KNotifications
Branch
nonotifyrc
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26321
Build 26339: arc lint + arc unit
nicolasfella created this revision.May 4 2020, 1:15 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 4 2020, 1:15 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
nicolasfella requested review of this revision.May 4 2020, 1:15 PM
apol added a subscriber: apol.May 4 2020, 1:55 PM

What's the advantage?
Won't this make it harder to put together the notifications kcm?

We want to phase out notifyrc files for several reasons:

  • They are an overkill for many simple use cases
  • A common pitfall when using KNotifications are missing or incorrect notifyrc files
  • Most of the information in there is duplicate/overridden at runtime anyway
  • We want to reduce the level of detail of the configurability anyway since it currently is quite an overkill

See T11875 for some discussion

In D29405#662963, @apol wrote:

Won't this make it harder to put together the notifications kcm?

Good point, we use the notifyrc file to know which apps send notifications ahead of time. Maybe we need something similar to X-GNOME-UsesNotifications=true

Maybe we need something similar to X-GNOME-UsesNotifications=true

Or we just also use that :D