summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorChethan2k1 <40890937+Chethan2k1@users.noreply.github.com>2020-09-10 14:50:10 +0530
committerChethan2k1 <40890937+Chethan2k1@users.noreply.github.com>2020-09-10 14:50:10 +0530
commit2b5deabbdc72f278ea112139999f6e91b8e571b7 (patch)
tree576789239aaaf3ae04bccd3f47773587d820b5bf /src
parentMaking sure Verification Objects are deleted properly (diff)
downloadnheko-2b5deabbdc72f278ea112139999f6e91b8e571b7.tar.xz
Fix breaking while using qmlRegisterSingletonInstance
Diffstat (limited to 'src')
-rw-r--r--src/DeviceVerificationFlow.cpp4
-rw-r--r--src/timeline/TimelineViewManager.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/DeviceVerificationFlow.cpp b/src/DeviceVerificationFlow.cpp

index 70cc0baf..96fed55a 100644 --- a/src/DeviceVerificationFlow.cpp +++ b/src/DeviceVerificationFlow.cpp
@@ -41,9 +41,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *, this->deleteLater(); }); - connect(this,&DeviceVerificationFlow::deleteFlow,this,[this](){ - this->deleteLater(); - }); + connect(this, &DeviceVerificationFlow::deleteFlow, this, [this]() { this->deleteLater(); }); connect( ChatPage::instance(), diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index f199578f..97c119bf 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp
@@ -140,8 +140,12 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin 0, "UserProfileModel", "UserProfile needs to be instantiated on the C++ side"); - qmlRegisterSingletonInstance("im.nheko", 1, 0, "TimelineManager", this); - qmlRegisterSingletonInstance("im.nheko", 1, 0, "Settings", settings.data()); + qmlRegisterSingletonType<TimelineViewManager>( + "im.nheko", 1, 0, "TimelineManager", [this](QQmlEngine *, QJSEngine *) { return this; }); + qmlRegisterSingletonType<UserSettings>( + "im.nheko", 1, 0, "Settings", [this](QQmlEngine *, QJSEngine *) { + return this->settings.data(); + }); qRegisterMetaType<mtx::events::collections::TimelineEvents>(); qRegisterMetaType<std::vector<DeviceInfo>>();