From 732462135f56453c009a9e3c455b4827b9c0ea12 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 11 Jul 2017 23:26:14 +0200 Subject: [PATCH] Show no notification icon if there is no Summary: I think it looks nicer than the kind of angry default icon and is the expected behaviour Reviewers: #kde_connect, albertvaka Reviewed By: #kde_connect, albertvaka Subscribers: albertvaka, apol, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D6089 --- plugins/notifications/notification.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp index 6d0483dde..3f4d29ff2 100644 --- a/plugins/notifications/notification.cpp +++ b/plugins/notifications/notification.cpp @@ -102,7 +102,8 @@ KNotification* Notification::createKNotification(bool update, const NetworkPacka } if (!mHasIcon) { - mNotification->setIconName(QStringLiteral("preferences-desktop-notification")); + //HACK The only way to display no icon at all is trying to load a non-existant icon + mNotification->setIconName(QString("not_a_real_icon")); show(); } else { QString filename = mPayloadHash; @@ -117,11 +118,11 @@ KNotification* Notification::createKNotification(bool update, const NetworkPacka connect(job, &FileTransferJob::result, this, &Notification::applyIconAndShow); } } - + if(!mRequestReplyId.isEmpty()) { mNotification->setActions( QStringList(i18n("Reply")) ); connect(mNotification, &KNotification::action1Activated, this, &Notification::reply); - } + } connect(mNotification, &KNotification::closed, this, &Notification::closed); @@ -151,4 +152,3 @@ void Notification::parseNetworkPackage(const NetworkPackage &np) mPayloadHash = np.get(QStringLiteral("payloadHash")); mRequestReplyId = np.get(QStringLiteral("requestReplyId"), QString()); } -