Advertisement
kimmoli

Untitled

May 4th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. void myapp::notificationSend(QString summary, QString body)
  2. {
  3.  
  4. QDBusInterface notifyCall("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "");
  5.  
  6. QVariantHash hints;
  7. hints.insert("x-nemo-preview-summary", summary);
  8.  
  9. QList<QVariant> args;
  10. args.append("myapp");
  11. args.append(ssNotifyReplacesId);
  12. args.append("icon-m-notifications");
  13. args.append(summary);
  14. args.append(body);
  15. args.append((QStringList() << "default" << ""));
  16. args.append(hints);
  17. args.append(-1);
  18.  
  19. QDBusMessage notifyCallReply = notifyCall.callWithArgumentList(QDBus::AutoDetect, "Notify", args);
  20.  
  21. QList<QVariant> outArgs = notifyCallReply.arguments();
  22.  
  23. ssNotifyReplacesId = outArgs.at(0).toInt();
  24.  
  25. printf("Notification sent, got id %d\n", ssNotifyReplacesId);
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement