Commit 864a6923 authored by Nicolas Fella's avatar Nicolas Fella

Port away from KIconThemes

Use QIcon and QStyle API where appropriate
parent 11109c42
......@@ -41,7 +41,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
DBusAddons
KIO
I18n
IconThemes
NetworkManagerQt
Notifications
Plasma
......
......@@ -45,7 +45,6 @@ target_link_libraries(kded_networkmanagement
KF5::ConfigCore
KF5::DBusAddons
KF5::I18n
KF5::IconThemes
KF5::Notifications
KF5::Service
KF5::Solid
......
......@@ -32,7 +32,6 @@
#include <KServiceTypeTrader>
#include <KLocalizedString>
#include <KIconLoader>
#include <QIcon>
#include <QPushButton>
......@@ -66,7 +65,7 @@ void PasswordDialog::initializeUi()
m_ui = new Ui::PasswordDialog;
m_ui->setupUi(this);
// TODO fix this for high DPI
m_ui->labelIcon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-password")).pixmap(KIconLoader::SizeHuge));
m_ui->labelIcon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-password")).pixmap(64));
m_ui->labelHeadline->setText(i18n("Authenticate %1", m_connectionSettings->id()));
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &PasswordDialog::accept);
......
......@@ -26,7 +26,6 @@
#include <QIcon>
#include <KWindowSystem>
#include <KIconLoader>
#include <KLocalizedString>
#include <ModemManagerQt/manager.h>
......@@ -68,7 +67,7 @@ PinDialog::PinDialog(ModemManager::Modem *modem, const Type type, QWidget *paren
pixmapLabel = new QLabel(this);
pixmapLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
ui->gridLayout->addWidget(pixmapLabel, 0, 0);
pixmapLabel->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-password")).pixmap(KIconLoader::SizeMedium));
pixmapLabel->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-password")).pixmap(32));
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &PinDialog::accept);
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &PinDialog::reject);
......
......@@ -25,7 +25,6 @@ PUBLIC
${NETWORKMANAGER_LIBRARIES}
PRIVATE
KF5::I18n
KF5::IconThemes
KF5::Notifications
KF5::Service
KF5::Wallet
......
......@@ -99,7 +99,6 @@ PUBLIC
KF5::WidgetsAddons
Qt5::Widgets
PRIVATE
KF5::IconThemes
KF5::I18n
KF5::KIOWidgets
KF5::Notifications
......
......@@ -25,7 +25,6 @@
#include <QVBoxLayout>
#include <KLocalizedString>
#include <KIconLoader>
#include <Solid/Device>
#include <NetworkManagerQt/ModemDevice>
......@@ -508,7 +507,7 @@ QWizardPage * MobileConnectionWizard::createPlansPage()
QHBoxLayout *layout2 = new QHBoxLayout();
label = new QLabel();
label->setPixmap(KIconLoader::global()->loadIcon("dialog-warning", KIconLoader::Dialog));
label->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(32));
layout2->addWidget(label, 0, Qt::AlignTop);
label = new QLabel(i18nc("Mobile Connection Wizard", "Warning: Selecting an incorrect plan may result in billing issues for your broadband account or may prevent connectivity.\n\nIf you are unsure of your plan please ask your provider for your plan's APN."));
label->setWordWrap(true);
......
......@@ -49,7 +49,6 @@ if (OPENCONNECT_FOUND)
${NETWORKMANAGERQT5_LDFLAGS}
KF5::CoreAddons
KF5::I18n
KF5::IconThemes
KF5::KIOWidgets
KF5::WidgetsAddons
Qt5::Xml
......
......@@ -43,7 +43,6 @@
#include <QTimer>
#include <QPointer>
#include <KIconLoader>
#include <KLocalizedString>
#include "nm-openconnect-service.h"
......@@ -498,7 +497,8 @@ void OpenconnectAuthWidget::addFormInfo(const QString &iconName, const QString &
text->setWordWrap(true);
layout->addWidget(text);
icon->setPixmap(QIcon::fromTheme(iconName).pixmap(KIconLoader::SizeSmall));
const int iconSize = icon->style()->pixelMetric(QStyle::PixelMetric::PM_SmallIconSize);
icon->setPixmap(QIcon::fromTheme(iconName).pixmap(iconSize));
text->setText(message);
d->ui.loginBoxLayout->addLayout(layout);
......@@ -639,7 +639,8 @@ void OpenconnectAuthWidget::validatePeerCert(const QString &fingerprint,
verticalLayout->addWidget(certificate);
icon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(KIconLoader::SizeLarge));
const int iconSize = icon->style()->pixelMetric(QStyle::PixelMetric::PM_LargeIconSize);
icon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(iconSize));
infoText->setText(i18n("Check failed for certificate from VPN server \"%1\".\n"
"Reason: %2\nAccept it anyway?", openconnect_get_hostname(d->vpninfo),reason));
infoText->setWordWrap(true);
......
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