Skip to content
Snippets Groups Projects
Verified Commit 84434433 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix wrong tags in context menu

parent 019bcf5f
No related branches found
No related tags found
No related merge requests found
Pipeline #2223 failed
......@@ -70,7 +70,7 @@ Page {
}
Instantiator {
model: Communities.tags
model: Communities.tagsWithDefault
onObjectAdded: roomContextMenu.insertItem(index + 2, object)
onObjectRemoved: roomContextMenu.removeItem(object)
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment