Minimally building core plugin

All classes are disabled currently, and the plugin macros as well.
This commit is contained in:
Sebastian Kügler 2013-02-01 17:03:00 +01:00
parent 5e71196632
commit 1667ad7619
3 changed files with 65 additions and 64 deletions

View File

@ -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)

View File

@ -21,33 +21,33 @@
#include "corebindingsplugin.h"
#include <QtDeclarative/qdeclarative.h>
#include <QDeclarativeContext>
//#include <QtDeclarative/qdeclarative.h>
#include <QQmlContext>
#include <QScriptEngine>
#include <kdeclarative.h>
#include <Plasma/FrameSvg>
#include <Plasma/Svg>
#include <Plasma/QueryMatch>
// #include <Plasma/FrameSvg>
// #include <Plasma/Svg>
// #include <Plasma/QueryMatch>
#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<Plasma::Svg>(uri, 0, 1, "Svg");
qmlRegisterType<Plasma::FrameSvg>(uri, 0, 1, "FrameSvg");
qmlRegisterType<Plasma::SvgItem>(uri, 0, 1, "SvgItem");
qmlRegisterType<Plasma::FrameSvgItem>(uri, 0, 1, "FrameSvgItem");
qmlRegisterType<ThemeProxy>(uri, 0, 1, "Theme");
qmlRegisterType<Plasma::DataSource>(uri, 0, 1, "DataSource");
qmlRegisterType<Plasma::DataModel>(uri, 0, 1, "DataModel");
qmlRegisterType<Plasma::SortFilterModel>(uri, 0, 1, "SortFilterModel");
qmlRegisterType<DialogProxy>(uri, 0, 1, "Dialog");
qmlRegisterType<ToolTipProxy>(uri, 0, 1, "ToolTip");
qmlRegisterInterface<Plasma::Service>("Service");
qRegisterMetaType<Plasma::Service*>("Service");
qmlRegisterInterface<Plasma::ServiceJob>("ServiceJob");
qRegisterMetaType<Plasma::ServiceJob*>("ServiceJob");
qmlRegisterType<QAbstractItemModel>();
qmlRegisterType<RunnerModel>(uri, 0, 1, "RunnerModel");
qmlRegisterInterface<Plasma::QueryMatch>("QueryMatch");
qRegisterMetaType<Plasma::QueryMatch *>("QueryMatch");
qmlRegisterType<QDeclarativePropertyMap>();
qmlRegisterType<IconItem>(uri, 0, 1, "IconItem");
// qmlRegisterType<Plasma::Svg>(uri, 0, 1, "Svg");
// qmlRegisterType<Plasma::FrameSvg>(uri, 0, 1, "FrameSvg");
// qmlRegisterType<Plasma::SvgItem>(uri, 0, 1, "SvgItem");
// qmlRegisterType<Plasma::FrameSvgItem>(uri, 0, 1, "FrameSvgItem");
//
// qmlRegisterType<ThemeProxy>(uri, 0, 1, "Theme");
//
// qmlRegisterType<Plasma::DataSource>(uri, 0, 1, "DataSource");
// qmlRegisterType<Plasma::DataModel>(uri, 0, 1, "DataModel");
// qmlRegisterType<Plasma::SortFilterModel>(uri, 0, 1, "SortFilterModel");
//
// qmlRegisterType<DialogProxy>(uri, 0, 1, "Dialog");
// qmlRegisterType<ToolTipProxy>(uri, 0, 1, "ToolTip");
//
// qmlRegisterInterface<Plasma::Service>("Service");
// qRegisterMetaType<Plasma::Service*>("Service");
// qmlRegisterInterface<Plasma::ServiceJob>("ServiceJob");
// qRegisterMetaType<Plasma::ServiceJob*>("ServiceJob");
// qmlRegisterType<QAbstractItemModel>();
//
// qmlRegisterType<RunnerModel>(uri, 0, 1, "RunnerModel");
// qmlRegisterInterface<Plasma::QueryMatch>("QueryMatch");
// qRegisterMetaType<Plasma::QueryMatch *>("QueryMatch");
//
// qmlRegisterType<QDeclarativePropertyMap>();
// qmlRegisterType<IconItem>(uri, 0, 1, "IconItem");
/*qmlRegisterInterface<Plasma::DataSource>("DataSource");
qRegisterMetaType<Plasma::DataSource*>("DataSource");*/

View File

@ -22,20 +22,20 @@
#ifndef COREBINDINGSPLUGIN_H
#define COREBINDINGSPLUGIN_H
#include <QDeclarativeEngine>
#include <QDeclarativeExtensionPlugin>
#include <QQmlEngine>
#include <QQmlExtensionPlugin>
#include <Plasma/Service>
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