This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KNotification help

Tags: None
(comma "," separated)
User avatar
kernco
Registered Member
Posts
29
Karma
0
OS

KNotification help

Thu Jan 14, 2010 8:14 pm
I'm trying to use KNotification to show popup notifications in my program. Here is my notifyrc file:
Code: Select all
kuru.notifyrc:
[Global]
Comment=Kuru

[Event/newTweet]
Name=Tweet
Comment=Received a new tweet
Action=Popup


And then here's the code where I'm trying to create a notification:
Code: Select all
KNotification *notification = new KNotification("newTweet");
notification->setTitle("Twitter");
notification->setText(tweet.toMap()["text"].toString());
notification->setActions(QStringList() << "Reply" << "Retweet");
notification->sendEvent();
qDebug() << tweet.toMap()["text"].toString();

I see the output from that qDebug() call, but no notification. I get no error messages, though, so I'm not sure how to begin looking for the problem.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KNotification help

Fri Jan 15, 2010 12:23 am
Have you installed the notifyrc file?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
kernco
Registered Member
Posts
29
Karma
0
OS

Re: KNotification help

Fri Jan 15, 2010 12:53 am
bcooksley wrote:Have you installed the notifyrc file?

Yeah, it got installed into /share/apps/kuru/kuru.notifyrc by make install, but since I didn't see any other program's files there, I also copied it into /usr/share/kde4/apps/kuru/kuru.notifyrc which is where the notifyrc files for all the KDE apps are, but that still didn't fix it.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KNotification help  Topic is solved

Fri Jan 15, 2010 1:00 am
Try killing knotify4 as it may not have detected your application's notifyrc file. Also try running kbuildsycoca4.

Also try adding Icon and Name properties in the [Global] section.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
kernco
Registered Member
Posts
29
Karma
0
OS

Re: KNotification help

Fri Jan 15, 2010 2:24 am
bcooksley wrote:Try killing knotify4

That did it. Thanks!


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]