Commit a492b8ca authored by Alexander Lohnau's avatar Alexander Lohnau
Browse files

Port to KIconProvider from KIconThemes instead of KDeclarative::setupEngine

This way we can get rid of the KDeclarative dependency.

Task: https://phabricator.kde.org/T15750
parent 910fb88d
Pipeline #237541 passed with stage
in 9 minutes and 28 seconds
......@@ -15,7 +15,6 @@ Dependencies:
- 'on': ['Linux', 'FreeBSD', 'Windows']
'require':
'frameworks/kdeclarative': '@stable'
'frameworks/kdoctools': '@stable'
'frameworks/kio': '@stable'
'frameworks/kfilemetadata': '@stable'
......
......@@ -14,7 +14,7 @@ project(elisa
VERSION ${RELEASE_SERVICE_VERSION}
LANGUAGES CXX)
set(REQUIRED_KF5_VERSION "5.90.0")
set(REQUIRED_KF5_VERSION "5.98.0")
find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH})
......
......@@ -173,12 +173,6 @@ if (KF5XmlGui_FOUND AND KF5KCMUtils_FOUND)
Qt::Test elisaLib
)
if (KF5Declarative_FOUND)
target_link_libraries(elisaapplicationtest
KF5::Declarative
)
endif()
target_include_directories(elisaapplicationtest PRIVATE ${CMAKE_SOURCE_DIR}/src)
endif()
......
......@@ -2,8 +2,6 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#cmakedefine01 KF5Declarative_FOUND
#cmakedefine01 KF5Baloo_FOUND
#cmakedefine01 KF5XmlGui_FOUND
......
......@@ -485,14 +485,6 @@ if (Qt5Quick_FOUND AND Qt5Widgets_FOUND)
)
endif()
if (KF5Declarative_FOUND)
target_link_libraries(elisa
LINK_PRIVATE
KF5::Declarative
KF5::QuickAddons
)
endif()
if (NOT APPLE AND NOT WIN32)
set_target_properties(elisa PROPERTIES
INSTALL_RPATH "${KDE_INSTALL_FULL_LIBDIR}/elisa;${CMAKE_INSTALL_RPATH}"
......
......@@ -14,10 +14,6 @@
//#define QT_QML_DEBUG
#if KF5Declarative_FOUND
#include <KDeclarative/KDeclarative>
#endif
#include <KLocalizedString>
#include <KLocalizedContext>
......@@ -27,7 +23,7 @@
#include <KCrash>
#endif
#include <KQuickIconProvider>
#include <QIcon>
#include <QApplication>
......@@ -140,12 +136,8 @@ int main(int argc, char *argv[])
engine.addImportPath(QStringLiteral("qrc:/imports"));
QQmlFileSelector selector(&engine);
#if KF5Declarative_FOUND
KDeclarative::KDeclarative decl;
decl.setDeclarativeEngine(&engine);
decl.setupEngine(&engine); // FIXME: removing this line breaks various icons
decl.setupContext();
#endif
// Allow image:// icon URLs to be loaded as images im QML
engine.addImageProvider(QStringLiteral("icon"), new KQuickIconProvider);
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
......
Supports Markdown
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