From 1667ad761994e4e215f07fc6b997092f6c6377f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Fri, 1 Feb 2013 17:03:00 +0100 Subject: [PATCH] Minimally building core plugin All classes are disabled currently, and the plugin macros as well. --- declarativeimports/core/CMakeLists.txt | 28 +++--- .../core/corebindingsplugin.cpp | 91 ++++++++++--------- declarativeimports/core/corebindingsplugin.h | 10 +- 3 files changed, 65 insertions(+), 64 deletions(-) diff --git a/declarativeimports/core/CMakeLists.txt b/declarativeimports/core/CMakeLists.txt index 5c41fd0db..8723292f2 100644 --- a/declarativeimports/core/CMakeLists.txt +++ b/declarativeimports/core/CMakeLists.txt @@ -1,19 +1,19 @@ project(corebindings) set(corebindings_SRCS - declarativeitemcontainer.cpp +# declarativeitemcontainer.cpp corebindingsplugin.cpp - dataengineconsumer.cpp - theme.cpp - datamodel.cpp - datasource.cpp - runnermodel.cpp - svgitem.cpp - framesvgitem.cpp - dialog.cpp - tooltip.cpp - dataenginebindings.cpp - iconitem.cpp +# dataengineconsumer.cpp +# theme.cpp +# datamodel.cpp +# datasource.cpp +# runnermodel.cpp +# svgitem.cpp +# framesvgitem.cpp +# dialog.cpp +# tooltip.cpp +# dataenginebindings.cpp +# iconitem.cpp ) INCLUDE_DIRECTORIES( @@ -28,9 +28,9 @@ qt4_automoc(${corebindings_SRCS}) add_library(corebindingsplugin SHARED ${corebindings_SRCS}) -target_link_libraries(corebindingsplugin ${KDE4_PLASMA_LIBS} ${QT_QTSCRIPT_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${KDECLARATIVE_LIBRARIES}) +target_link_libraries(corebindingsplugin ${KDE4_PLASMA_LIBS} ${QT_QTSCRIPT_LIBRARY} ${Qt5Quick_LIBRARIES} ${Qt5Qml_LIBRARIES} ${KDECLARATIVE_LIBRARIES}) install(TARGETS corebindingsplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/core) install(FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/core) -add_subdirectory(tests) +#add_subdirectory(tests) diff --git a/declarativeimports/core/corebindingsplugin.cpp b/declarativeimports/core/corebindingsplugin.cpp index 169fd35ee..61a8152ed 100644 --- a/declarativeimports/core/corebindingsplugin.cpp +++ b/declarativeimports/core/corebindingsplugin.cpp @@ -21,33 +21,33 @@ #include "corebindingsplugin.h" -#include -#include +//#include +#include #include #include -#include -#include -#include +// #include +// #include +// #include -#include "datasource.h" -#include "datamodel.h" -#include "framesvgitem.h" -#include "runnermodel.h" -#include "svgitem.h" -#include "theme.h" -#include "dialog.h" -#include "iconitem.h" -#include "tooltip.h" -#include "dataenginebindings_p.h" +// // #include "datasource.h" +// // #include "datamodel.h" +// #include "framesvgitem.h" +// #include "runnermodel.h" +// #include "svgitem.h" +// #include "theme.h" +// #include "dialog.h" +// #include "iconitem.h" +// #include "tooltip.h" +// #include "dataenginebindings_p.h" -void CoreBindingsPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) +void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) { - QDeclarativeExtensionPlugin::initializeEngine(engine, uri); - - QDeclarativeContext *context = engine->rootContext(); + QQmlExtensionPlugin::initializeEngine(engine, uri); + QQmlContext *context = engine->rootContext(); +/* ThemeProxy *theme = new ThemeProxy(context); context->setContextProperty("theme", theme); @@ -63,38 +63,39 @@ void CoreBindingsPlugin::initializeEngine(QDeclarativeEngine *engine, const char } registerDataEngineMetaTypes(scriptEngine); + */ } void CoreBindingsPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.plasma.core")); - qmlRegisterType(uri, 0, 1, "Svg"); - qmlRegisterType(uri, 0, 1, "FrameSvg"); - qmlRegisterType(uri, 0, 1, "SvgItem"); - qmlRegisterType(uri, 0, 1, "FrameSvgItem"); - - qmlRegisterType(uri, 0, 1, "Theme"); - - qmlRegisterType(uri, 0, 1, "DataSource"); - qmlRegisterType(uri, 0, 1, "DataModel"); - qmlRegisterType(uri, 0, 1, "SortFilterModel"); - - qmlRegisterType(uri, 0, 1, "Dialog"); - qmlRegisterType(uri, 0, 1, "ToolTip"); - - qmlRegisterInterface("Service"); - qRegisterMetaType("Service"); - qmlRegisterInterface("ServiceJob"); - qRegisterMetaType("ServiceJob"); - qmlRegisterType(); - - qmlRegisterType(uri, 0, 1, "RunnerModel"); - qmlRegisterInterface("QueryMatch"); - qRegisterMetaType("QueryMatch"); - - qmlRegisterType(); - qmlRegisterType(uri, 0, 1, "IconItem"); +// qmlRegisterType(uri, 0, 1, "Svg"); +// qmlRegisterType(uri, 0, 1, "FrameSvg"); +// qmlRegisterType(uri, 0, 1, "SvgItem"); +// qmlRegisterType(uri, 0, 1, "FrameSvgItem"); +// +// qmlRegisterType(uri, 0, 1, "Theme"); +// +// qmlRegisterType(uri, 0, 1, "DataSource"); +// qmlRegisterType(uri, 0, 1, "DataModel"); +// qmlRegisterType(uri, 0, 1, "SortFilterModel"); +// +// qmlRegisterType(uri, 0, 1, "Dialog"); +// qmlRegisterType(uri, 0, 1, "ToolTip"); +// +// qmlRegisterInterface("Service"); +// qRegisterMetaType("Service"); +// qmlRegisterInterface("ServiceJob"); +// qRegisterMetaType("ServiceJob"); +// qmlRegisterType(); +// +// qmlRegisterType(uri, 0, 1, "RunnerModel"); +// qmlRegisterInterface("QueryMatch"); +// qRegisterMetaType("QueryMatch"); +// +// qmlRegisterType(); +// qmlRegisterType(uri, 0, 1, "IconItem"); /*qmlRegisterInterface("DataSource"); qRegisterMetaType("DataSource");*/ diff --git a/declarativeimports/core/corebindingsplugin.h b/declarativeimports/core/corebindingsplugin.h index fd4a75e04..f3854c785 100644 --- a/declarativeimports/core/corebindingsplugin.h +++ b/declarativeimports/core/corebindingsplugin.h @@ -22,20 +22,20 @@ #ifndef COREBINDINGSPLUGIN_H #define COREBINDINGSPLUGIN_H -#include -#include +#include +#include #include -class CoreBindingsPlugin : public QDeclarativeExtensionPlugin +class CoreBindingsPlugin : public QQmlExtensionPlugin { Q_OBJECT public: - void initializeEngine(QDeclarativeEngine *engine, const char *uri); + void initializeEngine(QQmlEngine *engine, const char *uri); void registerTypes(const char *uri); }; -Q_EXPORT_PLUGIN2(corebindingsplugin, CoreBindingsPlugin) +//Q_EXPORT_PLUGIN2(corebindingsplugin, CoreBindingsPlugin) #endif