Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/declarative/notificationmanagerplugin.cpp
Show All 19 Lines | |||||
20 | 20 | | |||
21 | #include "notificationmanagerplugin.h" | 21 | #include "notificationmanagerplugin.h" | ||
22 | 22 | | |||
23 | #include "notifications.h" | 23 | #include "notifications.h" | ||
24 | #include "job.h" | 24 | #include "job.h" | ||
25 | #include "server.h" | 25 | #include "server.h" | ||
26 | #include "serverinfo.h" | 26 | #include "serverinfo.h" | ||
27 | #include "settings.h" | 27 | #include "settings.h" | ||
28 | #include "watchednotificationsmodel.h" | ||||
28 | 29 | | |||
29 | #include <QQmlEngine> | 30 | #include <QQmlEngine> | ||
30 | 31 | | |||
31 | using namespace NotificationManager; | 32 | using namespace NotificationManager; | ||
32 | 33 | | |||
33 | void NotificationManagerPlugin::registerTypes(const char *uri) | 34 | void NotificationManagerPlugin::registerTypes(const char *uri) | ||
34 | { | 35 | { | ||
35 | Q_ASSERT(uri == QLatin1String("org.kde.notificationmanager")); | 36 | Q_ASSERT(uri == QLatin1String("org.kde.notificationmanager")); | ||
36 | 37 | | |||
37 | qmlRegisterType<Notifications>(uri, 1, 0, "Notifications"); | 38 | qmlRegisterType<Notifications>(uri, 1, 0, "Notifications"); | ||
38 | qmlRegisterUncreatableType<Job>(uri, 1, 0, "Job", QStringLiteral("Can only access Job via JobDetailsRole of JobsModel")); | 39 | qmlRegisterUncreatableType<Job>(uri, 1, 0, "Job", QStringLiteral("Can only access Job via JobDetailsRole of JobsModel")); | ||
39 | qmlRegisterType<Settings>(uri, 1, 0, "Settings"); | 40 | qmlRegisterType<Settings>(uri, 1, 0, "Settings"); | ||
40 | qmlRegisterSingletonType<Server>(uri, 1, 0, "Server", [](QQmlEngine *, QJSEngine *) -> QObject* { | 41 | qmlRegisterSingletonType<Server>(uri, 1, 0, "Server", [](QQmlEngine *, QJSEngine *) -> QObject* { | ||
41 | QQmlEngine::setObjectOwnership(&Server::self(), QQmlEngine::CppOwnership); | 42 | QQmlEngine::setObjectOwnership(&Server::self(), QQmlEngine::CppOwnership); | ||
42 | return &Server::self(); | 43 | return &Server::self(); | ||
43 | }); | 44 | }); | ||
44 | qmlRegisterUncreatableType<ServerInfo>(uri, 1, 0, "ServerInfo", QStringLiteral("Can only access ServerInfo via Server")); | 45 | qmlRegisterUncreatableType<ServerInfo>(uri, 1, 0, "ServerInfo", QStringLiteral("Can only access ServerInfo via Server")); | ||
46 | qmlRegisterType<WatchedNotificationsModel>(uri, 1, 1, "WatchedNotificationsModel"); | ||||
45 | } | 47 | } |