mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Fix wrong tags in context menu
This commit is contained in:
parent
019bcf5f5c
commit
84434433f2
2 changed files with 11 additions and 1 deletions
|
@ -70,7 +70,7 @@ Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Instantiator {
|
Instantiator {
|
||||||
model: Communities.tags
|
model: Communities.tagsWithDefault
|
||||||
onObjectAdded: roomContextMenu.insertItem(index + 2, object)
|
onObjectAdded: roomContextMenu.insertItem(index + 2, object)
|
||||||
onObjectRemoved: roomContextMenu.removeItem(object)
|
onObjectRemoved: roomContextMenu.removeItem(object)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ class CommunitiesModel : public QAbstractListModel
|
||||||
Q_PROPERTY(QString currentTagId READ currentTagId WRITE setCurrentTagId NOTIFY
|
Q_PROPERTY(QString currentTagId READ currentTagId WRITE setCurrentTagId NOTIFY
|
||||||
currentTagIdChanged RESET resetCurrentTagId)
|
currentTagIdChanged RESET resetCurrentTagId)
|
||||||
Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged)
|
Q_PROPERTY(QStringList tags READ tags NOTIFY tagsChanged)
|
||||||
|
Q_PROPERTY(QStringList tagsWithDefault READ tagsWithDefault NOTIFY tagsChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Roles
|
enum Roles
|
||||||
|
@ -50,6 +51,15 @@ public slots:
|
||||||
emit currentTagIdChanged(currentTagId_);
|
emit currentTagIdChanged(currentTagId_);
|
||||||
}
|
}
|
||||||
QStringList tags() const { return tags_; }
|
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);
|
void toggleTagId(QString tagId);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
Loading…
Reference in a new issue