From d5ad7202ea77e8a512073f9ce09b6c07e37d6305 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Sun, 6 Feb 2022 20:42:01 +0100 Subject: 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. --- main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 57334a4..fb7cded 100644 --- a/main.cpp +++ b/main.cpp @@ -2,6 +2,7 @@ #include #include #include +//#include #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", 1, 0, "DcNotifications") == -1) + { + QCoreApplication::exit(-1); + } if (qmlRegisterType("DeltaChat", 1, 0, "DcAccountsEventEmitter") == -1) { QCoreApplication::exit(-1); } + + DcNotifications* KNotif = new DcNotifications(); qRegisterMetaType("size_t"); qRegisterMetaType("uint32_t"); qRegisterMetaType>("QVector"); 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) { -- cgit v1.2.3-70-g09d2