Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement