Changeset View
Changeset View
Standalone View
Standalone View
src/kirigamiplugin.cpp
Show All 15 Lines | |||||
16 | #include "delegaterecycler.h" | 16 | #include "delegaterecycler.h" | ||
17 | #include "pagepool.h" | 17 | #include "pagepool.h" | ||
18 | #include "scenepositionattached.h" | 18 | #include "scenepositionattached.h" | ||
19 | #include "wheelhandler.h" | 19 | #include "wheelhandler.h" | ||
20 | #include "shadowedrectangle.h" | 20 | #include "shadowedrectangle.h" | ||
21 | #include "shadowedtexture.h" | 21 | #include "shadowedtexture.h" | ||
22 | #include "colorutils.h" | 22 | #include "colorutils.h" | ||
23 | #include "pagerouter.h" | 23 | #include "pagerouter.h" | ||
24 | #include "avatar.h" | ||||
24 | 25 | | |||
25 | #include <QQmlEngine> | 26 | #include <QQmlEngine> | ||
26 | #include <QQmlContext> | 27 | #include <QQmlContext> | ||
27 | #include <QQuickItem> | 28 | #include <QQuickItem> | ||
28 | #include <QQuickStyle> | 29 | #include <QQuickStyle> | ||
29 | #include <QGuiApplication> | 30 | #include <QGuiApplication> | ||
30 | #include <QClipboard> | 31 | #include <QClipboard> | ||
31 | 32 | | |||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 137 | #endif | |||
250 | qmlRegisterSingletonType<ColorUtils>(uri, 2, 12, "ColorUtils", [] (QQmlEngine*, QJSEngine*) -> QObject* { return new ColorUtils; }); | 251 | qmlRegisterSingletonType<ColorUtils>(uri, 2, 12, "ColorUtils", [] (QQmlEngine*, QJSEngine*) -> QObject* { return new ColorUtils; }); | ||
251 | 252 | | |||
252 | qmlRegisterUncreatableType<CornersGroup>(uri, 2, 12, "CornersGroup", QStringLiteral("Used as grouped property")); | 253 | qmlRegisterUncreatableType<CornersGroup>(uri, 2, 12, "CornersGroup", QStringLiteral("Used as grouped property")); | ||
253 | qmlRegisterType<PageRouter>(uri, 2, 12, "PageRouter"); | 254 | qmlRegisterType<PageRouter>(uri, 2, 12, "PageRouter"); | ||
254 | qmlRegisterType<PageRoute>(uri, 2, 12, "PageRoute"); | 255 | qmlRegisterType<PageRoute>(uri, 2, 12, "PageRoute"); | ||
255 | qmlRegisterUncreatableType<PageRouterAttached>(uri, 2, 12, "PageRouterAttached", QStringLiteral("PageRouterAttached cannot be created")); | 256 | qmlRegisterUncreatableType<PageRouterAttached>(uri, 2, 12, "PageRouterAttached", QStringLiteral("PageRouterAttached cannot be created")); | ||
256 | qmlRegisterType(componentUrl(QStringLiteral("RouterWindow.qml")), uri, 2, 12, "RouterWindow"); | 257 | qmlRegisterType(componentUrl(QStringLiteral("RouterWindow.qml")), uri, 2, 12, "RouterWindow"); | ||
257 | 258 | | |||
259 | qmlRegisterSingletonType<AvatarPrivate>("org.kde.kirigami.private", 2, 13, "AvatarPrivate", [] (QQmlEngine*, QJSEngine*) -> QObject* { return new AvatarPrivate; }); | ||||
mart: I don't like this, as even tough is called "private" is really public api as there isn't really… | |||||
the string manipulation used for generating initials isn't particularly feasible to do in javascript; especially the stuff that prods QChars cblack: the string manipulation used for generating initials isn't particularly feasible to do in… | |||||
260 | qmlRegisterType(componentUrl(QStringLiteral("Avatar.qml")), uri, 2, 13, "Avatar"); | ||||
261 | | ||||
258 | qmlProtectModule(uri, 2); | 262 | qmlProtectModule(uri, 2); | ||
259 | } | 263 | } | ||
260 | 264 | | |||
261 | void KirigamiPlugin::initializeEngine(QQmlEngine *engine, const char *uri) | 265 | void KirigamiPlugin::initializeEngine(QQmlEngine *engine, const char *uri) | ||
262 | { | 266 | { | ||
263 | Q_UNUSED(uri); | 267 | Q_UNUSED(uri); | ||
264 | connect(this, &KirigamiPlugin::languageChangeEvent, engine, &QQmlEngine::retranslate); | 268 | connect(this, &KirigamiPlugin::languageChangeEvent, engine, &QQmlEngine::retranslate); | ||
265 | } | 269 | } | ||
266 | 270 | | |||
267 | #include "kirigamiplugin.moc" | 271 | #include "kirigamiplugin.moc" |
I don't like this, as even tough is called "private" is really public api as there isn't really any way to make a c++ type not accessible.
nothing in that c++ class seems really to be necessary to be c++