From 0278c9d5fb57c9aa703ab10361fdb17186b2ddd1 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 19 Jun 2023 20:30:27 +0200 Subject: Fix UserSettingsModel and Communities singleton instantiation --- src/InviteesModel.h | 3 +++ src/MemberList.h | 3 +++ src/UserSettingsPage.h | 1 + src/timeline/CommunitiesModel.h | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/InviteesModel.h b/src/InviteesModel.h index 3f417bd1..b9b4b862 100644 --- a/src/InviteesModel.h +++ b/src/InviteesModel.h @@ -6,6 +6,7 @@ #define INVITEESMODEL_H #include +#include #include #include "timeline/TimelineModel.h" @@ -34,6 +35,8 @@ private: class InviteesModel final : public QAbstractListModel { Q_OBJECT + QML_ELEMENT + QML_UNCREATABLE("") Q_PROPERTY(int count READ rowCount NOTIFY countChanged) Q_PROPERTY(TimelineModel *room READ room CONSTANT) diff --git a/src/MemberList.h b/src/MemberList.h index ceaa9c14..f1d39336 100644 --- a/src/MemberList.h +++ b/src/MemberList.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include @@ -79,6 +80,8 @@ private: class MemberList final : public QSortFilterProxyModel { Q_OBJECT + QML_ELEMENT + QML_UNCREATABLE("") Q_PROPERTY(QString roomName READ roomName NOTIFY roomNameChanged) Q_PROPERTY(int memberCount READ memberCount NOTIFY memberCountChanged) diff --git a/src/UserSettingsPage.h b/src/UserSettingsPage.h index 301a1b67..34dae2ea 100644 --- a/src/UserSettingsPage.h +++ b/src/UserSettingsPage.h @@ -456,6 +456,7 @@ class UserSettingsModel : public QAbstractListModel { Q_OBJECT QML_ELEMENT + QML_SINGLETON enum Indices { diff --git a/src/timeline/CommunitiesModel.h b/src/timeline/CommunitiesModel.h index d0841f4b..7af6d050 100644 --- a/src/timeline/CommunitiesModel.h +++ b/src/timeline/CommunitiesModel.h @@ -154,7 +154,7 @@ public: void restoreCollapsed(); }; - CommunitiesModel(QObject *parent = nullptr); + CommunitiesModel(QObject *parent); static CommunitiesModel *create(QQmlEngine *qmlEngine, QJSEngine *) { -- cgit 1.4.1