diff options
author | Miquel Lionel <lionel@les-miquelots.net> | 2022-02-06 20:42:01 +0100 |
---|---|---|
committer | Miquel Lionel <lionel@les-miquelots.net> | 2022-02-06 20:57:27 +0100 |
commit | d5ad7202ea77e8a512073f9ce09b6c07e37d6305 (patch) | |
tree | 167141728086401a50a125a20997b61df41a2d2e /main.cpp | |
parent | a01f8091c01889d7ca90938f56ae176a74da5590 (diff) | |
download | kdeltachat-d5ad7202ea77e8a512073f9ce09b6c07e37d6305.tar.gz kdeltachat-d5ad7202ea77e8a512073f9ce09b6c07e37d6305.zip |
Move notifications to own header file
- also make a skel for files in /usr/, useful
for sounds and notifyrc
- build.sh use plain simple cp -r to copy the skel.
also copies the knotifications5 in the current directory
for qml.qrc embedding in case the app is used on android.
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include <QQmlApplicationEngine> #include <QMetaType> #include <QtWebEngine> +//#include <QScopedPointer> #include "accounts.h" #include "message.h" @@ -10,6 +11,7 @@ #include "context.h" #include "contact.h" #include "eventemitter.h" +#include "notifications.h" int main(int argc, char *argv[]) { @@ -52,15 +54,22 @@ int main(int argc, char *argv[]) { QCoreApplication::exit(-1); } + if (qmlRegisterType<DcNotifications>("DcNotifications", 1, 0, "DcNotifications") == -1) + { + QCoreApplication::exit(-1); + } if (qmlRegisterType<DcAccountsEventEmitter>("DeltaChat", 1, 0, "DcAccountsEventEmitter") == -1) { QCoreApplication::exit(-1); } + + DcNotifications* KNotif = new DcNotifications(); qRegisterMetaType<size_t>("size_t"); qRegisterMetaType<uint32_t>("uint32_t"); qRegisterMetaType<QVector<uint32_t>>("QVector<uint32_t>"); QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("KNotif", KNotif); const QUrl url(QStringLiteral("qrc:/qml/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { |