Commit fc1f2ad5 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[cuttlefish] Port away from KPackage

We typically don't use KPackage to ship QML files for apps. Instead we ship them via qrc

Do the same here

This also means that we don't generate appstream metadata for the KPackage any more, which fixes installing two sets of metadata
parent 5cf7d599
Pipeline #228633 passed with stage
in 2 minutes and 4 seconds
......@@ -3,9 +3,5 @@ if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
plasma_install_package(package org.kde.plasma.cuttlefish packages package)
install(FILES org.kde.plasma.cuttlefish.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.plasma.cuttlefish.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
......@@ -13,7 +13,6 @@ ecm_add_test(iconmodeltest.cpp ../src/iconmodel.cpp ../src/sortfiltermodel.cpp
KF5::KIOWidgets
KF5::ConfigCore
KF5::IconThemes
KF5::Package
KF5::Service
KF5::Plasma
KF5::ConfigWidgets
......
......@@ -4,6 +4,7 @@ set(cuttlefish_SRCS
iconmodel.cpp
colorschemes.cpp
sortfiltermodel.cpp
qml.qrc
)
add_executable(cuttlefish ${cuttlefish_SRCS})
......@@ -18,7 +19,6 @@ target_link_libraries(cuttlefish
KF5::ConfigWidgets
KF5::I18n
KF5::IconThemes
KF5::Package
Qt::DBus
)
......
......@@ -21,7 +21,6 @@
#include <KIO/OpenFileManagerWindowJob>
#include <KIconLoader>
#include <KIconTheme>
#include <KPackage/PackageLoader>
#include <KSharedConfig>
#include <algorithm>
......
......@@ -16,7 +16,6 @@
// Frameworks
#include <KConfigGroup>
#include <KLocalizedString>
#include <KPackage/PackageLoader>
#include <Plasma/Theme>
// Own
......@@ -93,14 +92,6 @@ int main(int argc, char **argv)
l10nContext->setTranslationDomain(QStringLiteral("cuttlefish"));
engine.rootContext()->setContextObject(l10nContext);
auto package = KPackage::PackageLoader::self()->loadPackage("Plasma/Generic");
package.setPath("org.kde.plasma.cuttlefish");
if (!package.isValid() || !package.metadata().isValid()) {
qWarning() << "Could not load package org.kde.plasma.cuttlefish:" << package.path();
return -1;
}
auto iconModel = new CuttleFish::IconModel(engine.rootContext());
auto proxyModel = new CuttleFish::SortFilterModel(engine.rootContext());
proxyModel->setSourceModel(iconModel);
......@@ -112,7 +103,7 @@ int main(int argc, char **argv)
engine.rootContext()->setContextProperty("pickerMode", parser.isSet("picker"));
engine.rootContext()->setContextProperty("colorSchemes", colorSchemes);
engine.load(QUrl::fromLocalFile(package.filePath("mainscript")));
engine.load(QUrl("qrc:/qml/cuttlefish.qml"));
if (engine.rootObjects().isEmpty()) {
return -1;
}
......
<RCC>
<qresource prefix="/">
<file>qml/Actions.qml</file>
<file>qml/Comparison.qml</file>
<file>qml/cuttlefish.qml</file>
<file>qml/GlobalMenuBar.qml</file>
<file>qml/IconGridDelegate.qml</file>
<file>qml/IconGrid.qml</file>
<file>qml/IconMontage.qml</file>
<file>qml/Menu.qml</file>
<file>qml/Preview.qml</file>
<file>qml/ResponsivePreview.qml</file>
<file>qml/Screenshot.qml</file>
<file>qml/Tools.qml</file>
<file>qml/ToolsResponsive.qml</file>
</qresource>
</RCC>
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