Skip to content

kcms/notifications: Set the config paths in the right order

Reason for the change

QStandardPaths finds the paths following the order of precedence given by `$XDG_DATA_DIRS, that is, more priority goes first.

It is the opposite for KConfig::addConfigSources(), which goes from more global first to more specific (the latter override the previous ones), so we need to reverse the order.

This is a niche issue mostly just for dev sessions, but let's better have it correctly.

Test plan

  • On a dev session, with an $XDG_DATA like: /home/isma/kde/usr/share:/usr/local/share:/usr/share
    have two slightly different plasma_workspace.notifyrc in the ~/kde/usr/share/knotifications6 and in the /usr/share/knotifications6 path
  • Open the Notifications KCM -> System Notifications
~  echo $XDG_DATA_DIRS
/home/isma/kde/usr/share:/home/isma/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
~  head -n 3 ~/kde/usr/share/knotifications6/plasma_workspace.notifyrc /usr/share/knotifications6/plasma_workspace.notifyrc
==> /home/isma/kde/usr/share/knotifications6/plasma_workspace.notifyrc <==
[Global]
IconName=start-here-kde-plasma
Comment=System Notifications

==> /usr/share/knotifications6/plasma_workspace.notifyrc <==
[Global]
IconName=start-here-kde-plasma
Comment=Plasma Workspace

Screenshots or screen recordings

BEFORE AFTER
Screenshot_20240726_102521 Screenshot_20240726_090854

Bugs fixed

Issue found by @cwo in frameworks/frameworkintegration!41 (merged)

Merge request reports

Loading