Commit 7e9c2dc3 authored by Volker Krause's avatar Volker Krause
Browse files

Port away from deprecated SmallIcon method

Reviewers: dfaure

Reviewed By: dfaure

Maniphest Tasks: T11654

Differential Revision: https://phabricator.kde.org/D25554
parent 8116f781
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
#include <kurllabel.h> #include <kurllabel.h>
#include <kprotocolinfo.h> #include <kprotocolinfo.h>
#include <QApplication>
#include <qstatusbar.h> #include <qstatusbar.h>
#include <QStyle>
using namespace Akregator; using namespace Akregator;
...@@ -139,7 +141,7 @@ void KonqFeedIcon::contextMenu() ...@@ -139,7 +141,7 @@ void KonqFeedIcon::contextMenu()
m_menu = new QMenu(m_part->widget()); m_menu = new QMenu(m_part->widget());
if (m_feedList.count() == 1) { if (m_feedList.count() == 1) {
m_menu->setTitle(m_feedList.first().title()); m_menu->setTitle(m_feedList.first().title());
m_menu->addAction(SmallIcon("bookmark-new"), i18n("Add Feed to Akregator"), this, SLOT(addAllFeeds())); m_menu->addAction(QIcon::fromTheme("bookmark-new"), i18n("Add Feed to Akregator"), this, SLOT(addAllFeeds()));
} else { } else {
m_menu->setTitle(i18n("Add Feeds to Akregator")); m_menu->setTitle(i18n("Add Feeds to Akregator"));
int id = 0; int id = 0;
...@@ -169,7 +171,7 @@ void KonqFeedIcon::addFeedIcon() ...@@ -169,7 +171,7 @@ void KonqFeedIcon::addFeedIcon()
m_feedIcon = new KUrlLabel(m_statusBarEx->statusBar()); m_feedIcon = new KUrlLabel(m_statusBarEx->statusBar());
// from khtmlpart's ualabel // from khtmlpart's ualabel
m_feedIcon->setFixedHeight(KIconLoader::global()->currentSize(KIconLoader::Small)); m_feedIcon->setFixedHeight(qApp->style()->pixelMetric(QStyle::PM_SmallIconSize));
m_feedIcon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); m_feedIcon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
m_feedIcon->setUseCursor(false); m_feedIcon->setUseCursor(false);
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <KSharedConfig> #include <KSharedConfig>
#include <KDesktopFile> #include <KDesktopFile>
#include <KPluginFactory> #include <KPluginFactory>
#include <KIconLoader>
#include <KActionCollection> #include <KActionCollection>
#include <KRun> #include <KRun>
#include <KMainWindow> #include <KMainWindow>
...@@ -258,7 +257,7 @@ void SearchBarPlugin::startSearch(const QString &search) ...@@ -258,7 +257,7 @@ void SearchBarPlugin::startSearch(const QString &search)
void SearchBarPlugin::setIcon() void SearchBarPlugin::setIcon()
{ {
if (m_searchMode == FindInThisPage) { if (m_searchMode == FindInThisPage) {
m_searchIcon = SmallIcon(QStringLiteral("edit-find")); m_searchIcon = QIcon::fromTheme(QStringLiteral("edit-find")).pixmap(qApp->style()->pixelMetric(QStyle::PM_SmallIconSize));
} else { } else {
const QString engine = (m_currentEngine.isEmpty() ? m_searchEngines.first() : m_currentEngine); const QString engine = (m_currentEngine.isEmpty() ? m_searchEngines.first() : m_currentEngine);
//kDebug() << "Icon Name:" << m_searchProviders.value(engine).iconName(); //kDebug() << "Icon Name:" << m_searchProviders.value(engine).iconName();
...@@ -266,7 +265,7 @@ void SearchBarPlugin::setIcon() ...@@ -266,7 +265,7 @@ void SearchBarPlugin::setIcon()
if (iconName.startsWith(QLatin1Char('/'))) { if (iconName.startsWith(QLatin1Char('/'))) {
m_searchIcon = QPixmap(iconName); m_searchIcon = QPixmap(iconName);
} else { } else {
m_searchIcon = SmallIcon(iconName); m_searchIcon = QIcon::fromTheme(iconName).pixmap(qApp->style()->pixelMetric(QStyle::PM_SmallIconSize));
} }
} }
......
...@@ -643,7 +643,8 @@ void KonqCombo::paintEvent(QPaintEvent *pe) ...@@ -643,7 +643,8 @@ void KonqCombo::paintEvent(QPaintEvent *pe)
QPainter p(this); QPainter p(this);
p.setClipRect(re); p.setClipRect(re);
QPixmap pix = SmallIcon(QLatin1String(m_pageSecurity == KonqMainWindow::Encrypted ? "security-high" : "security-medium")); const auto icon = QIcon::fromTheme(QLatin1String(m_pageSecurity == KonqMainWindow::Encrypted ? "security-high" : "security-medium"));
QPixmap pix = icon.pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize));
QRect r = edit->geometry(); QRect r = edit->geometry();
r.setRight(re.right() - pix.width() - 2); r.setRight(re.right() - pix.width() - 2);
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <QTextDocument> #include <QTextDocument>
#include <kcolorscheme.h> #include <kcolorscheme.h>
#include <kiconloader.h>
#include <QIcon> #include <QIcon>
#include <KLocalizedString> #include <KLocalizedString>
#include "konqdebug.h" #include "konqdebug.h"
...@@ -155,7 +154,7 @@ void KonqStatusBarMessageLabel::setMessage(const QString &text, ...@@ -155,7 +154,7 @@ void KonqStatusBarMessageLabel::setMessage(const QString &text,
break; break;
} }
d->m_pixmap = (iconName == nullptr) ? QPixmap() : SmallIcon(iconName); d->m_pixmap = (iconName == nullptr) ? QPixmap() : QIcon::fromTheme(iconName).pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize));
QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText())); QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
if (type == Error) { if (type == Error) {
......
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