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

How to get real persistent notifications

Tags: None
(comma "," separated)
far_away
Registered Member
Posts
5
Karma
0
OS
Hello,

in a plasmoid I want to use KNotify. It works but the notification isn't persistent. My code looks like this:
Code: Select all
notify=new KNotification("newMessage");
notify->setComponentData(KComponentData("mail_plasmoid", "mail_plasmoid", KComponentData::RegisterAsMainComponent));
KNotification *notify->setText(generate_mail_string() + "nn" + QString(header.c_str()));
if (programm.isEmpty() == false) {
   notify->setActions(QStringList(QString("Launch ") + programm));
   connect(notify, SIGNAL(activated(unsigned int)), this , SLOT(launch_mailreader()));
      }
notify->setFlags(KNotification::Persistent);
notify->sendEvent();

Although I use setFlags(KNotification::Persistent) the notification disappears after a few seconds.
How can I change this?
And by the way: how can I add line feeds or other layouts (like italic) to the QString on the notification? n doesn't work.

Thanks

Last edited by far_away on Tue Feb 24, 2009 8:54 pm, edited 1 time in total.
User avatar
msoeken
Mentor
Posts
300
Karma
4
OS
I cannot answer your question, but I know that the notification when someone wants to talk to you is persistent. And AFAIK it has also multiline content. I took a quick look in websvn, but I cannot find the location in the source code.


Image
[size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell