Commit 39ce0e82 authored by Volker Krause's avatar Volker Krause
Browse files

Port away from KIconThemes

Summary: This was only using the deprecated IconSize() method.

Reviewers: apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D26072
parent 2471fa7d
...@@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) ...@@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets DBus) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets DBus)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED WidgetsAddons CoreAddons I18n Config ConfigWidgets KCMUtils KIO IconThemes Auth) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED WidgetsAddons CoreAddons I18n Config ConfigWidgets KCMUtils KIO Auth)
find_package(PWQuality REQUIRED) find_package(PWQuality REQUIRED)
include(FeatureSummary) include(FeatureSummary)
......
...@@ -50,7 +50,6 @@ target_link_libraries(user_manager ...@@ -50,7 +50,6 @@ target_link_libraries(user_manager
KF5::ConfigWidgets KF5::ConfigWidgets
KF5::KCMUtils KF5::KCMUtils
KF5::KIOCore KF5::KIOCore
KF5::IconThemes
${PWQUALITY_LIBRARY} ${PWQUALITY_LIBRARY}
) )
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "user_manager_debug.h" #include "user_manager_debug.h"
#include <KJob> #include <KJob>
#include <KIO/CopyJob> #include <KIO/CopyJob>
#include <KIconLoader>
#include <KUser> #include <KUser>
#include <KI18n/klocalizedstring.h> #include <KI18n/klocalizedstring.h>
...@@ -78,7 +77,7 @@ AccountInfo::AccountInfo(AccountModel* model, QWidget* parent, Qt::WindowFlags f ...@@ -78,7 +77,7 @@ AccountInfo::AccountInfo(AccountModel* model, QWidget* parent, Qt::WindowFlags f
menu->addAction(openAvatar); menu->addAction(openAvatar);
menu->addAction(editClear); menu->addAction(editClear);
int iconSizeX = IconSize(KIconLoader::Dialog); int iconSizeX = style()->pixelMetric(QStyle::PM_LargeIconSize);
QSize iconSize(iconSizeX, iconSizeX); QSize iconSize(iconSizeX, iconSizeX);
m_info->face->setIconSize(iconSize); m_info->face->setIconSize(iconSize);
m_info->face->setMinimumSize(iconSize); m_info->face->setMinimumSize(iconSize);
...@@ -458,7 +457,6 @@ void AccountInfo::avatarModelChanged(KJob* job) ...@@ -458,7 +457,6 @@ void AccountInfo::avatarModelChanged(KJob* job)
void AccountInfo::clearAvatar() void AccountInfo::clearAvatar()
{ {
QSize icon(IconSize(KIconLoader::Dialog), IconSize(KIconLoader::Dialog));
m_info->face->setIcon(QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(48, 48)); m_info->face->setIcon(QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(48, 48));
m_infoToSave.insert(AccountModel::Face, QString()); m_infoToSave.insert(AccountModel::Face, QString());
Q_EMIT changed(true); Q_EMIT changed(true);
......
...@@ -23,11 +23,12 @@ ...@@ -23,11 +23,12 @@
#include "accounts_interface.h" #include "accounts_interface.h"
#include "user_interface.h" #include "user_interface.h"
#include <QApplication>
#include <QIcon> #include <QIcon>
#include <QStyle>
#include "user_manager_debug.h" #include "user_manager_debug.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <kiconloader.h>
#include <KAuth/KAuthActionReply> #include <KAuth/KAuthActionReply>
#include <KAuth/KAuthExecuteJob> #include <KAuth/KAuthExecuteJob>
...@@ -145,7 +146,7 @@ QVariant AccountModel::data(const QModelIndex& index, int role) const ...@@ -145,7 +146,7 @@ QVariant AccountModel::data(const QModelIndex& index, int role) const
case Qt::DecorationRole || AccountModel::Face: case Qt::DecorationRole || AccountModel::Face:
{ {
QFile file(acc->iconFile()); QFile file(acc->iconFile());
int size = IconSize(KIconLoader::Dialog); int size = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize);
if (!file.exists()) { if (!file.exists()) {
return QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(size, size); return QIcon::fromTheme(QStringLiteral("user-identity")).pixmap(size, size);
} }
...@@ -297,7 +298,7 @@ QVariant AccountModel::newUserData(int role) const ...@@ -297,7 +298,7 @@ QVariant AccountModel::newUserData(int role) const
case Qt::DisplayRole || AccountModel::FriendlyName: case Qt::DisplayRole || AccountModel::FriendlyName:
return i18n("New User"); return i18n("New User");
case Qt::DecorationRole || AccountModel::Face: case Qt::DecorationRole || AccountModel::Face:
return QIcon::fromTheme(QStringLiteral("list-add-user")).pixmap(IconSize(KIconLoader::Dialog), IconSize(KIconLoader::Dialog)); return QIcon::fromTheme(QStringLiteral("list-add-user"));
case AccountModel::Created: case AccountModel::Created:
return false; return false;
} }
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <kpluginfactory.h> #include <kpluginfactory.h>
#include <KLocalizedString> #include <KLocalizedString>
#include <KMessageBox> #include <KMessageBox>
#include <KIconLoader>
K_PLUGIN_FACTORY(UserManagerFactory, registerPlugin<UserManager>();) K_PLUGIN_FACTORY(UserManagerFactory, registerPlugin<UserManager>();)
...@@ -54,7 +53,8 @@ UserManager::UserManager(QWidget* parent, const QVariantList& args) ...@@ -54,7 +53,8 @@ UserManager::UserManager(QWidget* parent, const QVariantList& args)
m_ui->userList->setModel(m_model); m_ui->userList->setModel(m_model);
m_ui->userList->setSelectionModel(m_selectionModel); m_ui->userList->setSelectionModel(m_selectionModel);
m_ui->userList->setIconSize(QSize(IconSize(KIconLoader::Dialog), IconSize(KIconLoader::Dialog))); const auto iconSize = style()->pixelMetric(QStyle::PM_LargeIconSize);
m_ui->userList->setIconSize(QSize(iconSize, iconSize));
ModelTest* test = new ModelTest(m_model, nullptr); ModelTest* test = new ModelTest(m_model, nullptr);
Q_UNUSED(test) Q_UNUSED(test)
......
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