From b3d78d6d078e4550470893e9b095ef2162d93a39 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 5 Apr 2020 15:42:58 +0200 Subject: [PATCH] [notifications] Drop no icon hack --- plugins/kdeconnect.notifyrc | 1 - plugins/notifications/notification.cpp | 8 -------- plugins/notifications/notification.h | 1 - 3 files changed, 10 deletions(-) diff --git a/plugins/kdeconnect.notifyrc b/plugins/kdeconnect.notifyrc index 55584e164..023d40b6c 100644 --- a/plugins/kdeconnect.notifyrc +++ b/plugins/kdeconnect.notifyrc @@ -1,5 +1,4 @@ [Global] -IconName=kdeconnect Name=KDE Connect Name[ar]=كدي المتّصل Name[ast]=KDE Connect diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp index 5442d8a44..27be5ad28 100644 --- a/plugins/notifications/notification.cpp +++ b/plugins/notifications/notification.cpp @@ -135,7 +135,6 @@ void Notification::createKNotification(const NetworkPacket& np) m_hasIcon = m_hasIcon && !m_payloadHash.isEmpty(); if (!m_hasIcon) { - applyNoIcon(); show(); } else { m_iconPath = m_imagesDir.absoluteFilePath(m_payloadHash); @@ -169,7 +168,6 @@ void Notification::loadIcon(const NetworkPacket& np) s_downloadsInProgress.remove(m_iconPath); if (fileTransferJob->error()) { qCDebug(KDECONNECT_PLUGIN_NOTIFICATION) << "Error in FileTransferJob: " << fileTransferJob->errorString(); - applyNoIcon(); } else { applyIcon(); } @@ -184,12 +182,6 @@ void Notification::applyIcon() m_notification->setPixmap(icon); } -void Notification::applyNoIcon() -{ - //HACK The only way to display no icon at all is trying to load a non-existent icon - m_notification->setIconName(QStringLiteral("not_a_real_icon")); -} - void Notification::reply() { Q_EMIT replyRequested(); diff --git a/plugins/notifications/notification.h b/plugins/notifications/notification.h index 52dff4917..e0f0d9485 100644 --- a/plugins/notifications/notification.h +++ b/plugins/notifications/notification.h @@ -96,7 +96,6 @@ private: void parseNetworkPacket(const NetworkPacket& np); void loadIcon(const NetworkPacket& np); void applyIcon(); - void applyNoIcon(); static QMap s_downloadsInProgress; };