Commit e06e897f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Port away from KIconThemes

At least where trivially possible.

Differential Revision: https://phabricator.kde.org/D24757
parent 739014d9
......@@ -36,7 +36,6 @@
#include <KLocalizedString>
#include <kdialog.h>
#include <kmessagebox.h>
#include <kiconloader.h>
#include <kcombobox.h>
#include <kurlcompletion.h>
#include <kmessagewidget.h>
......
......@@ -32,7 +32,6 @@ target_link_libraries(kcm_keys
KF5::KCMUtils
KF5::GlobalAccel
KF5::I18n
KF5::IconThemes
KF5::KIOWidgets
KF5::XmlGui
KF5::ItemModels
......
......@@ -30,7 +30,6 @@
#include <QDebug>
#include <KGlobalAccel>
#include <KConfigGroup>
#include <KIconLoader>
#include <KMessageBox>
#include <KStringHandler>
#include <KLocalizedString>
......@@ -431,23 +430,22 @@ void KGlobalShortcutsEditor::addCollection(
editor = new KShortcutsEditor(this, d->actionTypes);
d->stack->addWidget(editor);
// try to find one appropriate icon ( allowing NULL pixmap to be returned)
QPixmap pixmap = KIconLoader::global()->loadIcon(id, KIconLoader::Small, 0,
KIconLoader::DefaultState, QStringList(), nullptr, true);
if (pixmap.isNull()) {
// try to find one appropriate icon
QIcon icon = QIcon::fromTheme(id);
if (icon.isNull()) {
KService::Ptr service = KService::serviceByStorageId(id);
if(service) {
pixmap = KIconLoader::global()->loadIcon(service->icon(), KIconLoader::Small, 0,
KIconLoader::DefaultState, QStringList(), nullptr, true);
if (service) {
icon = QIcon::fromTheme(service->icon());
}
}
// if NULL pixmap is returned, use the F.D.O "system-run" icon
if (pixmap.isNull()) {
pixmap = KIconLoader::global()->loadIcon(QStringLiteral("system-run"), KIconLoader::Small);
// if NULL icon is returned, use the F.D.O "system-run" icon
if (icon.isNull()) {
icon = QIcon::fromTheme(QStringLiteral("system-run"));
}
// Add to the component list
QStandardItem *item = new QStandardItem(pixmap, friendlyName);
QStandardItem *item = new QStandardItem(icon, friendlyName);
if (id.endsWith(QLatin1String(".desktop"))) {
item->setData(i18n("Application Launchers"), KCategorizedSortFilterProxyModel::CategoryDisplayRole);
item->setData(0, KCategorizedSortFilterProxyModel::CategorySortRole);
......
......@@ -13,7 +13,6 @@ target_link_libraries(kcm_plasmasearch
KF5::KCMUtils
KF5::Runner
KF5::I18n
KF5::IconThemes
Qt5::DBus
Qt5::Widgets
......
......@@ -28,7 +28,6 @@
#include <KRunner/RunnerManager>
#include <KCModuleInfo>
#include <KCModuleProxy>
#include <KIconLoader>
#include <KPluginSelector>
#include <QApplication>
......
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