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 @@
#include <kurllabel.h>
#include <kprotocolinfo.h>
#include <QApplication>
#include <qstatusbar.h>
#include <QStyle>
using namespace Akregator;
......@@ -139,7 +141,7 @@ void KonqFeedIcon::contextMenu()
m_menu = new QMenu(m_part->widget());
if (m_feedList.count() == 1) {
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 {
m_menu->setTitle(i18n("Add Feeds to Akregator"));
int id = 0;
......@@ -169,7 +171,7 @@ void KonqFeedIcon::addFeedIcon()
m_feedIcon = new KUrlLabel(m_statusBarEx->statusBar());
// 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->setUseCursor(false);
......
......@@ -29,7 +29,6 @@
#include <KSharedConfig>
#include <KDesktopFile>
#include <KPluginFactory>
#include <KIconLoader>
#include <KActionCollection>
#include <KRun>
#include <KMainWindow>
......@@ -258,7 +257,7 @@ void SearchBarPlugin::startSearch(const QString &search)
void SearchBarPlugin::setIcon()
{
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 {
const QString engine = (m_currentEngine.isEmpty() ? m_searchEngines.first() : m_currentEngine);
//kDebug() << "Icon Name:" << m_searchProviders.value(engine).iconName();
......@@ -266,7 +265,7 @@ void SearchBarPlugin::setIcon()
if (iconName.startsWith(QLatin1Char('/'))) {
m_searchIcon = QPixmap(iconName);
} 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)
QPainter p(this);
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();
r.setRight(re.right() - pix.width() - 2);
......
......@@ -23,7 +23,6 @@
#include <QTextDocument>
#include <kcolorscheme.h>
#include <kiconloader.h>
#include <QIcon>
#include <KLocalizedString>
#include "konqdebug.h"
......@@ -155,7 +154,7 @@ void KonqStatusBarMessageLabel::setMessage(const QString &text,
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()));
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