Commit 51961a87 authored by Volker Krause's avatar Volker Krause
Browse files

Prefer giving KNotification icons rather than fixed-size pixmaps

Summary:
This lets KNotification pick and appropriate size for however it wants
to display the icon.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D24796
parent f23d8476
......@@ -36,7 +36,6 @@ target_link_libraries(akonadi_mailfilter_agent
KF5::DBusAddons
KF5::Notifications
KF5::WindowSystem
KF5::IconThemes
KF5::Libkdepim
KF5::I18n
)
......
......@@ -37,7 +37,6 @@
#include <KLocalizedString>
#include <KNotification>
#include <QIcon>
#include <KIconLoader>
#include <kmime/kmime_message.h>
#include <MailCommon/FilterImporterExporter>
#include <MailCommon/FilterLog>
......@@ -62,7 +61,6 @@ public:
, mCurrentProgressCount(0)
, mInboundFiltersExist(false)
{
pixmapNotification = QIcon::fromTheme(QStringLiteral("view-filter")).pixmap(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
}
void itemsFetchJobForFilterDone(KJob *job);
......@@ -81,7 +79,6 @@ public:
FilterManager *q;
QVector<MailCommon::MailFilter *> mFilters;
QMap<QString, SearchRule::RequiredPart> mRequiredParts;
QPixmap pixmapNotification;
SearchRule::RequiredPart mRequiredPartsBasedOnAll;
int mTotalProgressCount = 0;
int mCurrentProgressCount = 0;
......@@ -232,7 +229,7 @@ void FilterManager::Private::showNotification(const QString &errorMsg, const QSt
{
KNotification *notify = new KNotification(QStringLiteral("mailfilterjoberror"));
notify->setComponentName(QStringLiteral("akonadi_mailfilter_agent"));
notify->setPixmap(pixmapNotification);
notify->setIconName(QStringLiteral("view-filter"));
notify->setText(errorMsg + QLatin1Char('\n') + jobErrorString);
notify->sendEvent();
}
......
......@@ -39,7 +39,6 @@
#include <KLocalizedString>
#include <QIcon>
#include "mailfilteragent_debug.h"
#include <KIconLoader>
#include <KMime/Message>
#include <KNotification>
#include <KWindowSystem>
......@@ -112,10 +111,9 @@ MailFilterAgent::MailFilterAgent(const QString &id)
if (config->hasGroup("FilterLog")) {
KConfigGroup group(config, "FilterLog");
if (group.readEntry("Enabled", false)) {
const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("view-filter")).pixmap(KIconLoader::SizeSmall, KIconLoader::SizeSmall);
KNotification *notify = new KNotification(QStringLiteral("mailfilterlogenabled"));
notify->setComponentName(QApplication::applicationDisplayName());
notify->setPixmap(pixmap);
notify->setIconName(QStringLiteral("view-filter"));
notify->setText(i18nc("Notification when the filter log was enabled", "Mail Filter Log Enabled"));
notify->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