Move units from PlasmaComponents into PlasmaCore

This commit is contained in:
Sebastian Kügler 2014-01-23 00:06:43 +01:00
parent 7e5604cc56
commit e10b77f236
6 changed files with 7 additions and 11 deletions

View File

@ -27,6 +27,7 @@ set(corebindings_SRCS
serviceoperationstatus.cpp
dataenginebindings.cpp
iconitem.cpp
units.cpp
windowthumbnail.cpp
)

View File

@ -43,6 +43,7 @@
#include "serviceoperationstatus.h"
#include "tooltip.h"
#include "units.h"
#include "windowthumbnail.h"
// #include "dataenginebindings_p.h"
@ -59,6 +60,10 @@ void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
Plasma::Theme *theme = new Plasma::Theme(engine);
context->setContextProperty("theme", theme);
Units *units = new Units(context);
context->setContextProperty("units", units);
if (!engine->rootContext()->contextObject()) {
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine);
@ -71,6 +76,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
Q_ASSERT(uri == QLatin1String("org.kde.plasma.core"));
qmlRegisterUncreatableType<Plasma::Types>(uri, 2, 0, "Types", "");
qmlRegisterUncreatableType<Units>(uri, 2, 0, "Units", "");
qmlRegisterType<Plasma::Svg>(uri, 2, 0, "Svg");
qmlRegisterType<Plasma::FrameSvg>(uri, 2, 0, "FrameSvg");
@ -105,7 +111,6 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qRegisterMetaType<Plasma::DataSource*>("DataSource");
qmlRegisterType<Plasma::WindowThumbnail>(uri, 2, 0, "WindowThumbnail");
}

View File

@ -10,7 +10,6 @@ set(plasmacomponents_SRCS
enums.cpp
qmenu.cpp
qmenuitem.cpp
units.cpp
)
add_library(plasmacomponentsplugin SHARED ${plasmacomponents_SRCS})

View File

@ -33,10 +33,6 @@
#include "enums.h"
#include "qmenu.h"
#include "qmenuitem.h"
//#include "fullscreensheet.h"
#include "units.h"
//Q_EXPORT_PLUGIN2(plasmacomponentsplugin, PlasmaComponentsPlugin)
class BKSingleton
{
@ -83,10 +79,6 @@ void PlasmaComponentsPlugin::initializeEngine(QQmlEngine *engine, const char *ur
{
QQmlExtensionPlugin::initializeEngine(engine, uri);
EngineBookKeeping::self()->insertEngine(engine);
QQmlContext *context = engine->rootContext();
Units *units = new Units(context);
context->setContextProperty("units", units);
}
void PlasmaComponentsPlugin::registerTypes(const char *uri)
@ -107,7 +99,6 @@ void PlasmaComponentsPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<DialogStatus>(uri, 2, 0, "DialogStatus", "");
qmlRegisterUncreatableType<PageOrientation>(uri, 2, 0, "PageOrientation", "");
qmlRegisterUncreatableType<PageStatus>(uri, 2, 0, "PageStatus", "");
qmlRegisterUncreatableType<Units>(uri, 2, 0, "Units", "");
}