2 #include <QMaemo5InformationBox>
4 #include <libnotify/notify.h>
7 #include "genericnotify.h"
15 /* Init libnotify library */
16 notify_init(APPLICATION_NAME);
20 void notify::notify(const QString& msg)
23 QMaemo5InformationBox::information (0, msg);
25 /* Create notification */
26 NotifyNotification *notification = notify_notification_new(APPLICATION_NAME, qPrintable(msg), 0, 0);
29 int timeout = settings.value(SETUP_NOTIFICATION_TIMEOUT, SETUP_NOTIFICATION_TIMEOUT_DEFAULT).toInt();
32 notify_notification_set_timeout(notification, timeout);
34 /* Schedule notification for showing */
35 if (!notify_notification_show(notification, NULL)) {
36 qDebug("Failed to send notification");
39 /* Clean up the memory */
40 g_object_unref(notification);
43 qDebug(qPrintable(msg));