mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
plasma: implement required features of org.freedesktop.Notifications v1.2
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
657856274f
commit
c121cc167f
1 changed files with 15 additions and 7 deletions
|
@ -35,6 +35,9 @@
|
|||
|
||||
#include <kiconloader.h>
|
||||
|
||||
// for reference:
|
||||
// https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html
|
||||
|
||||
NotificationsEngine::NotificationsEngine( QObject* parent, const QVariantList& args )
|
||||
: Plasma::DataEngine( parent, args ), m_nextId( 1 )
|
||||
{
|
||||
|
@ -195,18 +198,23 @@ uint NotificationsEngine::Notify(const QString &app_name, uint replaces_id,
|
|||
notificationData.insert("configurable", configurable);
|
||||
|
||||
QImage image;
|
||||
if (hints.contains("image_data")) {
|
||||
if (hints.contains("image_data")) { // v1.1
|
||||
QDBusArgument arg = hints["image_data"].value<QDBusArgument>();
|
||||
image = decodeNotificationSpecImageHint(arg);
|
||||
} else if (hints.contains("image_path")) {
|
||||
} else if (hints.contains("image-data")) { // v1.2
|
||||
QDBusArgument arg = hints["image-data"].value<QDBusArgument>();
|
||||
image = decodeNotificationSpecImageHint(arg);
|
||||
} else if (hints.contains("image_path")) { // v1.1
|
||||
QString path = findImageForSpecImagePath(hints["image_path"].toString());
|
||||
if (!path.isEmpty()) {
|
||||
image.load(path);
|
||||
}
|
||||
} else if (hints.contains("icon_data")) {
|
||||
// This hint was in use in version 1.0 of the spec but has been
|
||||
// replaced by "image_data" in version 1.1. We need to support it for
|
||||
// users of the 1.0 version of the spec.
|
||||
} else if (hints.contains("image-path")) { // v1.2
|
||||
QString path = findImageForSpecImagePath(hints["image-path"].toString());
|
||||
if (!path.isEmpty()) {
|
||||
image.load(path);
|
||||
}
|
||||
} else if (hints.contains("icon_data")) { // v1.0
|
||||
QDBusArgument arg = hints["icon_data"].value<QDBusArgument>();
|
||||
image = decodeNotificationSpecImageHint(arg);
|
||||
}
|
||||
|
@ -275,7 +283,7 @@ QString NotificationsEngine::GetServerInformation(QString& vendor, QString& vers
|
|||
{
|
||||
vendor = "KDE";
|
||||
version = "1.0"; // FIXME
|
||||
specVersion = "1.1";
|
||||
specVersion = "1.2";
|
||||
return "Plasma";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue