Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 178bbdcd authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Remove the declarative plugin and just instantiate it from the main object

No need to make something flexible if nobody is going to use it
parent f400d426
......@@ -3,20 +3,19 @@ add_subdirectory(autotests)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..)
set(plasma_discover_SRCS
qt5_add_resources(plasma_discover_SRCS resources.qrc)
qt5_add_resources(plasma_discover_SRCS assets.qrc)
add_executable(plasma-discover ${plasma_discover_SRCS}
main.cpp
DiscoverMainWindow.cpp
DiscoverDeclarativePlugin.cpp
FeaturedModel.cpp
PaginateModel.cpp
SystemFonts.cpp
UnityLauncher.cpp
)
qt5_add_resources(plasma_discover_SRCS resources.qrc)
qt5_add_resources(plasma_discover_SRCS assets.qrc)
add_executable(plasma-discover ${plasma_discover_SRCS})
add_executable(Plasma::Discover ALIAS plasma-discover)
set_target_properties(plasma-discover PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/plasma-discover)
......
......@@ -28,7 +28,7 @@ class DiscoverDeclarativePlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void initializeEngine(QQmlEngine* engine, const char* uri) override;
void registerTypes(const char* /*uri*/) override;
void registerTypes(const char* uri) override;
};
#endif
......@@ -23,6 +23,7 @@
#include "UnityLauncher.h"
#include "FeaturedModel.h"
#include "CachedNetworkAccessManager.h"
#include "DiscoverDeclarativePlugin.h"
// Qt includes
#include <QAction>
......@@ -117,6 +118,12 @@ DiscoverMainWindow::DiscoverMainWindow(CompactMode mode)
connect(m_engine, &QQmlApplicationEngine::objectCreated, this, &DiscoverMainWindow::integrateObject);
m_engine->load(QUrl(QStringLiteral("qrc:/qml/DiscoverWindow.qml")));
auto uri = "org.kde.discover";
DiscoverDeclarativePlugin* plugin = new DiscoverDeclarativePlugin;
plugin->setParent(this);
plugin->initializeEngine(m_engine, uri);
plugin->registerTypes(uri);
}
DiscoverMainWindow::~DiscoverMainWindow()
......
include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ..)
add_library(discoverdeclarativeplugin DiscoverDeclarativePlugin.cpp)
target_link_libraries(discoverdeclarativeplugin Qt5::Core Qt5::Qml Discover::Common)
install(TARGETS discoverdeclarativeplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/discover)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/discover)
module org.kde.discover
plugin discoverdeclarativeplugin
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