void myapp::notificationSend(QString summary, QString body)
{
QDBusInterface notifyCall("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "");
QVariantHash hints;
hints.insert("x-nemo-preview-summary", summary);
QList<QVariant> args;
args.append("myapp");
args.append(ssNotifyReplacesId);
args.append("icon-m-notifications");
args.append(summary);
args.append(body);
args.append((QStringList() << "default" << ""));
args.append(hints);
args.append(-1);
QDBusMessage notifyCallReply = notifyCall.callWithArgumentList(QDBus::AutoDetect, "Notify", args);
QList<QVariant> outArgs = notifyCallReply.arguments();
ssNotifyReplacesId = outArgs.at(0).toInt();
printf("Notification sent, got id %d\n", ssNotifyReplacesId);
}
Comments