[PATCH] Detecting notification popup server capabilities

Aurélien Gâteau aurelien.gateau at canonical.com
Mon Aug 31 08:47:33 BST 2009


Olivier Goffart wrote:
> Because the user may configure each notification not to show any popup, or to 
> do something else,  the programmer may never rely on the popup being show or 
> having all the action.
> 
> So what is the use case for this?
> 
> If the developper of an application whish to show a popup that will always be 
> seen, and expect always an action in return, KNotification is not the right 
> thing to use, and it is better to use the visual notification dirrectly to do 
> it. (But there is no such API)

Very true. What could be done is to add a member method like this:

bool KNotification::supportActions() const

This method would check whether the knotify plugins associated with this 
notification support actions. knotify would then do something like this:

for plugin in pluginSelectedForThisNotification:
     if plugin.supportActions():
         return True
return False

In the current implementation, all plugins would return False in 
supportActions(), except NotifyByPopup which would return True if the 
current popup server supports actions.

Would it make sense to implement this?

Aurelien




More information about the kde-core-devel mailing list