Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85973952
D388.1796457201.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D388.1796457201.diff
View Options
diff --git a/src/contents/ui/Main.qml b/src/contents/ui/Main.qml
--- a/src/contents/ui/Main.qml
+++ b/src/contents/ui/Main.qml
@@ -39,14 +39,17 @@
property bool loadingSession: false
- property var matrixSdk: MK.MatrixSdk {
- onSessionChanged: {
+ property var matrixSdk
+
+ Connections {
+ target: matrixSdk
+ function onSessionChanged() {
console.log('session changed');
reloadSdkVariables();
root.purgeTimer.start();
}
- onLoadSessionFinished: (sessionName, res) => {
+ function onLoadSessionFinished(sessionName, res) {
root.loadingSession = false;
if (res === MK.Constants.SessionLoadSuccess) {
console.log('load session successful');
diff --git a/src/main.cpp b/src/main.cpp
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -32,6 +32,7 @@
#include "kazv-path-config.hpp"
#include "kazv-version.hpp"
#include "kazv-log.hpp"
+#include "matrix-sdk.hpp"
using namespace Qt::Literals::StringLiterals;
#if KAZV_IS_ANDROID
@@ -111,6 +112,12 @@
if (!iconThemeToSet.isEmpty()) {
QIcon::setThemeName(iconThemeToSet);
}
+ auto matrixSdk = new MatrixSdk();
+
+ engine.setInitialProperties({
+ {u"matrixSdk"_s, QVariant::fromValue(matrixSdk)},
+ });
+
engine.loadFromModule(u"moe.kazv.mxc.kazvqml"_s, u"Main"_s);
if (engine.rootObjects().isEmpty()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 4, 11:53 PM (23 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1856841
Default Alt Text
D388.1796457201.diff (1 KB)
Attached To
Mode
D388: Provide MatrixSdk from outside of qml
Attached
Detach File
Event Timeline