![]() Registered Member ![]()
|
Hi.
I am trying to use KNotification::event() from a plasmoid (C++) with custom notification events defined in a .notifyrc file, and I'm failing rather miserably. If I use the default notification event it all works, so I don't think it's a problem with my code as such. If I go to the notification configuration section in systemsettings I can see my plasmoid's custom events, so the .notifyrc file is being found and read properly. I have of course done the whole
What I'm guessing is that it's to do with KDE not being able to associate my .notifyrc file with the plasmoid in question. According to the KNotification docs:
Well, so what would be appname as far as my applet is concerned? If mine were a full-blown app, I would define that in KApplication, but being a plasmoid, I don't have any calls to it in my code. Any help would be much appreciated--I've been banging my head against the keyboard for hours with this. |
![]() Registered Member ![]()
|
Just replying to myself.
Sure enough, having spent hours on this, 90 seconds after posting, I have come across the solution by looking at the source code of plasma_pastebin. Turns out I could use KComponentData, like this:
Then I would have /usr/share/kde4/apps/my-plasma-applet/my-plasma-applet.notifyrc Sorry for the noise. I'll leave my post up though, in case someone else ever runs into the same problem. |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft