Commit 31d36ad8 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

less KIconThemes usages

parent 7875018d
find_package(KF5IconThemes ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5IconThemes PROPERTIES PURPOSE "Required to build the close-except-like addon")
if(NOT KF5IconThemes_FOUND)
return()
endif()
add_library(katecloseexceptplugin MODULE "")
target_compile_definitions(katecloseexceptplugin PRIVATE TRANSLATION_DOMAIN="katecloseexceptplugin")
target_link_libraries(
katecloseexceptplugin
katecloseexceptplugin
PRIVATE
KF5::TextEditor
KF5::IconThemes
)
ki18n_wrap_ui(UI_SOURCES close_confirm_dialog.ui)
......
......@@ -28,13 +28,13 @@
// Standard includes
#include <KConfig>
#include <KConfigGroup>
#include <KIconLoader>
#include <KLocalizedString> /// \todo Where is \c i18n() defined?
#include <KSharedConfig>
#include <QBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QPushButton>
#include <QStyle>
#include <cassert>
......@@ -68,7 +68,7 @@ CloseConfirmDialog::CloseConfirmDialog(QList<KTextEditor::Document *> &docs, KTo
setModal(true);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
icon->setPixmap(KIconLoader::global()->loadIcon(QStringLiteral("dialog-warning"), KIconLoader::Desktop, KIconLoader::SizeLarge));
icon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(style()->pixelMetric(QStyle::PM_LargeIconSize, nullptr, this)));
text->setText(i18nc("@label:listbox", "You are about to close the following documents:"));
......
......@@ -26,7 +26,6 @@ find_package(
REQUIRED
COMPONENTS
TextEditor
IconThemes
WindowSystem
DBusAddons
Crash
......@@ -38,7 +37,6 @@ target_link_libraries(
kate-lib
PUBLIC
KF5::TextEditor
KF5::IconThemes
KF5::WindowSystem
KF5::DBusAddons
KF5::Crash
......
......@@ -23,7 +23,6 @@
#include "katedocmanager.h"
#include "katemainwindow.h"
#include <KIconLoader>
#include <KLocalizedString>
#include <KMessageBox>
#include <KProcess>
......@@ -32,9 +31,9 @@
#include <QHeaderView>
#include <QLabel>
#include <QPushButton>
#include <QStyle>
#include <QTemporaryFile>
#include <QTextStream>
#include <QTreeWidget>
#include <QTreeWidgetItem>
......@@ -80,7 +79,7 @@ KateMwModOnHdDialog::KateMwModOnHdDialog(DocVector docs, QWidget *parent, const
// dialog text
QLabel *icon = new QLabel(this);
hb->addWidget(icon);
icon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(KIconLoader::SizeLarge));
icon->setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(style()->pixelMetric(QStyle::PM_LargeIconSize, nullptr, this)));
QLabel *t = new QLabel(i18n("<qt>The documents listed below have changed on disk.<p>Select one "
"or more at once, and press an action button until the list is empty.</p></qt>"),
......
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