Fix breaking while using qmlRegisterSingletonInstance

pull/270/head
Chethan2k1 4 years ago
parent a27662dc08
commit 2b5deabbdc
  1. 4
      src/DeviceVerificationFlow.cpp
  2. 8
      src/timeline/TimelineViewManager.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(),

@ -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>>();

Loading…
Cancel
Save