register dbus applications

This commit is contained in:
Patrick von Reth 2010-08-10 11:23:27 +02:00
parent b750faf85e
commit 34a5c4beb3
2 changed files with 7 additions and 6 deletions

View File

@ -86,8 +86,13 @@ uint FreedesktopNotification_Frontend::Notify(const QString &app_name, uint repl
hints["image_data"].value<QDBusArgument>()>>image;
icon=getImagefromHint(image);
}
QSharedPointer<Notification> noti(new Notification(this,app_name,"",summary,body,icon,timeout==-1?Notification::DefaultTimeout:timeout/1000,replaces_id));
if(!snore()->aplications().contains(app_name)){
Application *a = new Application(app_name);
a->addAlert(new Alert("DBus Alert","DBus Alert"));
snore()->addApplication(a);
snore()->applicationIsInitialized(a);
}
QSharedPointer<Notification> noti(new Notification(this,app_name,"DBus Alert",summary,body,icon,timeout==-1?Notification::DefaultTimeout:timeout/1000,replaces_id));
return snore()->broadcastNotification(noti);
}

View File

@ -25,18 +25,14 @@ class FreedesktopNotification_Frontend:public Notification_Frontend{
public:
FreedesktopNotification_Frontend(class SnoreServer *snore=0);
~FreedesktopNotification_Frontend();
QString getImagefromHint(const class FreedesktopImageHint &img);
void actionInvoked(QSharedPointer<Notification>notification);
void notificationClosed(QSharedPointer<Notification>notification);
uint Notify(const QString &app_name, uint replaces_id, const QString &app_icon, const QString &summary, const QString &body, const QStringList &actions, const QVariantMap &hints, int timeout);
void CloseNotification( uint id );
QStringList GetCapabilities();
QString GetServerInformation(QString& vendor, QString& version, QString& specVersion);
signals: