From 08d5a84cbdbb8937dbe4d43817e01d8ae00760cc Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 8 Oct 2020 17:26:07 +0200 Subject: Fix issues with old qt and bump to 5.10 --- src/timeline/TimelineViewManager.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/timeline') diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 18151173..b11c4965 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -125,11 +125,13 @@ TimelineViewManager::TimelineViewManager(QSharedPointer userSettin 0, "UserProfileModel", "UserProfile needs to be instantiated on the C++ side"); + + static auto self = this; qmlRegisterSingletonType( - "im.nheko", 1, 0, "TimelineManager", [this](QQmlEngine *, QJSEngine *) { return this; }); + "im.nheko", 1, 0, "TimelineManager", [](QQmlEngine *, QJSEngine *) { return self; }); qmlRegisterSingletonType( - "im.nheko", 1, 0, "Settings", [this](QQmlEngine *, QJSEngine *) { - return this->settings.data(); + "im.nheko", 1, 0, "Settings", [](QQmlEngine *, QJSEngine *) { + return self->settings.data(); }); qRegisterMetaType(); @@ -413,8 +415,8 @@ void TimelineViewManager::removeVerificationFlow(DeviceVerificationFlow *flow) { for (auto it = dvList.keyValueBegin(); it != dvList.keyValueEnd(); ++it) { - if (it->second == flow) { - dvList.remove(it->first); + if ((*it).second == flow) { + dvList.remove((*it).first); return; } } -- cgit 1.5.1