diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-06-14 23:40:06 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-06-14 23:40:06 +0200 |
commit | 84434433f20dafdd7ea8b8c5bed242d3be8816de (patch) | |
tree | df312377546fec06b43b42a41348219c8c05b3f1 | |
parent | 019bcf5f5c719a4a024b150faf4e3dae971d08bf (diff) |
Fix wrong tags in context menu
-rw-r--r-- | resources/qml/RoomList.qml | 2 | ||||
-rw-r--r-- | src/timeline/CommunitiesModel.h | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index 76680b37..5845eb81 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -70,7 +70,7 @@ Page { } Instantiator { - model: Communities.tags + model: Communities.tagsWithDefault onObjectAdded: roomContextMenu.insertItem(index + 2, object) onObjectRemoved: roomContextMenu.removeItem(object) diff --git a/src/timeline/CommunitiesModel.h b/src/timeline/CommunitiesModel.h index c98b5955..66d6b21b 100644 --- a/src/timeline/CommunitiesModel.h +++ b/src/timeline/CommunitiesModel.h @@ -17,6 +17,7 @@ class CommunitiesModel : public QAbstractListModel Q_PROPERTY(QString currentTagId READ currentTagId WRITE setCurrentTagId NOTIFY currentTagIdChanged RESET resetCurrentTagId) Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged) + Q_PROPERTY(QStringList tagsWithDefault READ tagsWithDefault NOTIFY tagsChanged) public: enum Roles @@ -50,6 +51,15 @@ public slots: emit currentTagIdChanged(currentTagId_); } QStringList tags() const { return tags_; } + QStringList tagsWithDefault() const + { + QStringList tagsWD = tags_; + tagsWD.prepend("m.lowpriority"); + tagsWD.prepend("m.favourite"); + tagsWD.removeOne("m.server_notice"); + tagsWD.removeDuplicates(); + return tagsWD; + } void toggleTagId(QString tagId); signals: |