From 08028d5c57d134fb3d0ca9004730f0b2c99e5e67 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 4 Jul 2020 04:24:28 +0200 Subject: Refactor UserProfile --- src/timeline/TimelineViewManager.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/timeline/TimelineViewManager.cpp') diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 0b732232..81c8d6d3 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -16,10 +16,9 @@ #include "dialogs/ImageOverlay.h" #include "emoji/EmojiModel.h" #include "emoji/Provider.h" -#include "src/ui/UserProfile.h" -#include "src/ui/UserProfileModel.h" Q_DECLARE_METATYPE(mtx::events::collections::TimelineEvents) +Q_DECLARE_METATYPE(std::vector) namespace msgs = mtx::events::msg; @@ -109,15 +108,28 @@ TimelineViewManager::TimelineViewManager(QSharedPointer userSettin 0, "MtxEvent", "Can't instantiate enum!"); + qmlRegisterUncreatableMetaObject(verification::staticMetaObject, + "im.nheko", + 1, + 0, + "VerificationStatus", + "Can't instantiate enum!"); + qmlRegisterType("im.nheko", 1, 0, "DelegateChoice"); qmlRegisterType("im.nheko", 1, 0, "DelegateChooser"); qmlRegisterType("im.nheko", 1, 0, "DeviceVerificationFlow"); - qmlRegisterType("im.nheko", 1, 0, "UserProfileModel"); - qmlRegisterType("im.nheko", 1, 0, "UserProfileList"); + qmlRegisterUncreatableType( + "im.nheko", + 1, + 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()); qRegisterMetaType(); + qRegisterMetaType>(); + qmlRegisterType("im.nheko.EmojiModel", 1, 0, "EmojiModel"); qmlRegisterType("im.nheko.EmojiModel", 1, 0, "EmojiProxyModel"); qmlRegisterUncreatableType( -- cgit 1.5.1