Commit a253a993 authored by Volker Krause's avatar Volker Krause
Browse files

Port away from deprecated icon methods, or remove unnecessary ones

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Maniphest Tasks: T11654

Differential Revision: https://phabricator.kde.org/D24797
parent e3327f7e
......@@ -32,7 +32,6 @@
#include <QMap>
#include <KLocalizedString>
#include <KIconLoader>
#include <QIcon>
#include <KConfig>
#include <QFileDialog>
......@@ -129,7 +128,6 @@ ConfigureAggregationsDialog::ConfigureAggregationsDialog(QWidget *parent)
d->mNewAggregationButton = new QPushButton(i18n("New Aggregation"), base);
d->mNewAggregationButton->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
d->mNewAggregationButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
g->addWidget(d->mNewAggregationButton, 0, 1);
connect(d->mNewAggregationButton, &QPushButton::clicked, this, [this]() {
......@@ -138,7 +136,6 @@ ConfigureAggregationsDialog::ConfigureAggregationsDialog(QWidget *parent)
d->mCloneAggregationButton = new QPushButton(i18n("Clone Aggregation"), base);
d->mCloneAggregationButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
d->mCloneAggregationButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
g->addWidget(d->mCloneAggregationButton, 1, 1);
connect(d->mCloneAggregationButton, &QPushButton::clicked, this, [this]() {
......@@ -170,7 +167,6 @@ ConfigureAggregationsDialog::ConfigureAggregationsDialog(QWidget *parent)
d->mDeleteAggregationButton = new QPushButton(i18n("Delete Aggregation"), base);
d->mDeleteAggregationButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
d->mDeleteAggregationButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
g->addWidget(d->mDeleteAggregationButton, 6, 1);
connect(d->mDeleteAggregationButton, &QPushButton::clicked, this, [this]() {
......
......@@ -34,7 +34,6 @@
#include <KMessageBox>
#include <KLocalizedString>
#include <KIconLoader>
#include <KConfigGroup>
#include <QIcon>
#include <KConfig>
......@@ -125,7 +124,6 @@ ConfigureThemesDialog::ConfigureThemesDialog(QWidget *parent)
d->mNewThemeButton = new QPushButton(i18n("New Theme"), base);
d->mNewThemeButton->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
d->mNewThemeButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
g->addWidget(d->mNewThemeButton, 0, 1);
connect(d->mNewThemeButton, &QPushButton::clicked, this, [this]() {
......@@ -134,7 +132,6 @@ ConfigureThemesDialog::ConfigureThemesDialog(QWidget *parent)
d->mCloneThemeButton = new QPushButton(i18n("Clone Theme"), base);
d->mCloneThemeButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
d->mCloneThemeButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
g->addWidget(d->mCloneThemeButton, 1, 1);
connect(d->mCloneThemeButton, &QPushButton::clicked, this, [this]() {
......@@ -166,7 +163,6 @@ ConfigureThemesDialog::ConfigureThemesDialog(QWidget *parent)
d->mDeleteThemeButton = new QPushButton(i18n("Delete Theme"), base);
d->mDeleteThemeButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
d->mDeleteThemeButton->setIconSize(QSize(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
g->addWidget(d->mDeleteThemeButton, 6, 1);
connect(d->mDeleteThemeButton, &QPushButton::clicked, this, [this]() {
......
......@@ -38,7 +38,6 @@
#include "messagelist_debug.h"
#include <QIcon>
#include <KIconLoader>
#include <KLocalizedString>
#include <QMenu>
#include <KXMLGUIClient>
......@@ -505,9 +504,9 @@ void Widget::viewStartDragRequest()
// Set pixmap
QPixmap pixmap;
if (selection.size() == 1) {
pixmap = QPixmap(DesktopIcon(QStringLiteral("mail-message"), KIconLoader::SizeSmall));
pixmap = QIcon::fromTheme(QStringLiteral("mail-message")).pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize));
} else {
pixmap = QPixmap(DesktopIcon(QStringLiteral("document-multiple"), KIconLoader::SizeSmall));
pixmap = QIcon::fromTheme(QStringLiteral("document-multiple")).pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize));
}
// Calculate hotspot (as in Konqueror)
......
......@@ -48,7 +48,6 @@
#include <KStandardAction>
#include <QAction>
#include <QIcon>
#include <KIconTheme>
#include <QShortcut>
#include <QVBoxLayout>
......@@ -148,9 +147,6 @@ void MailSourceViewTextBrowser::contextMenuEvent(QContextMenuEvent *event)
popup->addSeparator();
popup->addAction(KStandardAction::find(this, &MailSourceViewTextBrowser::findText, this));
//Code from KTextBrowser
KIconTheme::assignIconsToContextMenu(isReadOnly() ? KIconTheme::ReadOnlyText
: KIconTheme::TextEditor,
popup->actions());
if (mTextToSpeechInterface->isReady()) {
popup->addSeparator();
popup->addAction(QIcon::fromTheme(QStringLiteral(
......
......@@ -51,9 +51,7 @@ target_link_libraries(KF5TemplateParser
KF5::IdentityManagement
KF5::MessageCore
KF5::XmlGui
KF5::IconThemes
KF5::Completion
KF5::Libkleo
KF5::I18n
KF5::SonnetUi
KF5::SyntaxHighlighting
......
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