Commit fc443cce authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use icon name instead of pixmap in notification

Summary: It's both easier and better

Test Plan: builds

Reviewers: #plasma, jgrulich, ngraham

Reviewed By: jgrulich, ngraham

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D25385
parent cb8b854c
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <KNotification> #include <KNotification>
#include <KIconLoader>
#include <QDBusConnection> #include <QDBusConnection>
#include <QIcon> #include <QIcon>
...@@ -336,7 +335,7 @@ void Notification::stateChanged(NetworkManager::Device::State newstate, NetworkM ...@@ -336,7 +335,7 @@ void Notification::stateChanged(NetworkManager::Device::State newstate, NetworkM
connect(notify, &KNotification::closed, this, &Notification::notificationClosed); connect(notify, &KNotification::closed, this, &Notification::notificationClosed);
notify->setProperty("uni", device->uni()); notify->setProperty("uni", device->uni());
notify->setComponentName(QStringLiteral("networkmanagement")); notify->setComponentName(QStringLiteral("networkmanagement"));
notify->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(KIconLoader::SizeHuge)); notify->setIconName(QStringLiteral("dialog-warning"));
notify->setTitle(identifier); notify->setTitle(identifier);
notify->setText(text); notify->setText(text);
notify->sendEvent(); notify->sendEvent();
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
#include <NetworkManagerQt/WirelessSetting> #include <NetworkManagerQt/WirelessSetting>
#include <NetworkManagerQt/WirelessDevice> #include <NetworkManagerQt/WirelessDevice>
#include <KIconLoader>
#include <KLocalizedString> #include <KLocalizedString>
#include <KNotification> #include <KNotification>
#include <KServiceTypeTrader> #include <KServiceTypeTrader>
...@@ -465,7 +464,7 @@ void ConnectionEditorBase::replyFinished(QDBusPendingCallWatcher *watcher) ...@@ -465,7 +464,7 @@ void ConnectionEditorBase::replyFinished(QDBusPendingCallWatcher *watcher)
notification->setComponentName("networkmanagement"); notification->setComponentName("networkmanagement");
notification->setTitle(i18n("Failed to get secrets for %1", watcher->property("connection").toString())); notification->setTitle(i18n("Failed to get secrets for %1", watcher->property("connection").toString()));
notification->setText(reply.error().message()); notification->setText(reply.error().message());
notification->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(KIconLoader::SizeHuge)); notification->setIconName(QStringLiteral("dialog-warning"));
notification->sendEvent(); notification->sendEvent();
} }
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#include <KService> #include <KService>
#include <KServiceTypeTrader> #include <KServiceTypeTrader>
#include <KWindowSystem> #include <KWindowSystem>
#include <KIconLoader>
#include <KWallet> #include <KWallet>
#define AGENT_SERVICE "org.kde.kded5" #define AGENT_SERVICE "org.kde.kded5"
...@@ -126,7 +125,7 @@ void Handler::activateConnection(const QString& connection, const QString& devic ...@@ -126,7 +125,7 @@ void Handler::activateConnection(const QString& connection, const QString& devic
notification->setComponentName("networkmanagement"); notification->setComponentName("networkmanagement");
notification->setTitle(con->name()); notification->setTitle(con->name());
notification->setText(i18n("Missing VPN plugin")); notification->setText(i18n("Missing VPN plugin"));
notification->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(KIconLoader::SizeHuge)); notification->setIconName(QStringLiteral("dialog-warning"));
notification->sendEvent(); notification->sendEvent();
return; return;
} }
...@@ -641,7 +640,7 @@ void Handler::replyFinished(QDBusPendingCallWatcher * watcher) ...@@ -641,7 +640,7 @@ void Handler::replyFinished(QDBusPendingCallWatcher * watcher)
if (notification) { if (notification) {
notification->setComponentName("networkmanagement"); notification->setComponentName("networkmanagement");
notification->setText(error); notification->setText(error);
notification->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(KIconLoader::SizeHuge)); notification->setIconName(QStringLiteral("dialog-warning"));
notification->sendEvent(); notification->sendEvent();
} }
} else { } else {
...@@ -671,7 +670,7 @@ void Handler::replyFinished(QDBusPendingCallWatcher * watcher) ...@@ -671,7 +670,7 @@ void Handler::replyFinished(QDBusPendingCallWatcher * watcher)
if (notification) { if (notification) {
notification->setComponentName("networkmanagement"); notification->setComponentName("networkmanagement");
notification->setTitle(watcher->property("connection").toString()); notification->setTitle(watcher->property("connection").toString());
notification->setPixmap(QIcon::fromTheme("dialog-information").pixmap(KIconLoader::SizeHuge)); notification->setIconName(QStringLiteral("dialog-information"));
notification->sendEvent(); notification->sendEvent();
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment