summary refs log tree commit diff
path: root/src/timeline/TimelineViewManager.cpp
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/timeline/TimelineViewManager.cpp
parentMaking sure Verification Objects are deleted properly (diff)
downloadnheko-2b5deabbdc72f278ea112139999f6e91b8e571b7.tar.xz
Fix breaking while using qmlRegisterSingletonInstance
Diffstat (limited to 'src/timeline/TimelineViewManager.cpp')
-rw-r--r--src/timeline/TimelineViewManager.cpp8
1 files changed, 6 insertions, 2 deletions
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>>();