Use plaintext in devtools room selection combo
This commit is contained in:
@@ -208,6 +208,9 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
|
|||||||
if (role == DisplayNameRole) {
|
if (role == DisplayNameRole) {
|
||||||
return room->displayName();
|
return room->displayName();
|
||||||
}
|
}
|
||||||
|
if (role == EscapedDisplayNameRole) {
|
||||||
|
return room->displayName().toHtmlEscaped();
|
||||||
|
}
|
||||||
if (role == AvatarRole) {
|
if (role == AvatarRole) {
|
||||||
return room->avatarMediaId();
|
return room->avatarMediaId();
|
||||||
}
|
}
|
||||||
@@ -282,6 +285,7 @@ QHash<int, QByteArray> RoomListModel::roleNames() const
|
|||||||
{
|
{
|
||||||
QHash<int, QByteArray> roles;
|
QHash<int, QByteArray> roles;
|
||||||
roles[DisplayNameRole] = "displayName";
|
roles[DisplayNameRole] = "displayName";
|
||||||
|
roles[EscapedDisplayNameRole] = "escapedDisplayName";
|
||||||
roles[AvatarRole] = "avatar";
|
roles[AvatarRole] = "avatar";
|
||||||
roles[CanonicalAliasRole] = "canonicalAlias";
|
roles[CanonicalAliasRole] = "canonicalAlias";
|
||||||
roles[TopicRole] = "topic";
|
roles[TopicRole] = "topic";
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
enum EventRoles {
|
enum EventRoles {
|
||||||
DisplayNameRole = Qt::DisplayRole, /**< The display name of the room. */
|
DisplayNameRole = Qt::DisplayRole, /**< The display name of the room. */
|
||||||
|
EscapedDisplayNameRole, /**< HTML-Escaped display name of the room. */
|
||||||
AvatarRole, /**< The source URL for the room's avatar. */
|
AvatarRole, /**< The source URL for the room's avatar. */
|
||||||
CanonicalAliasRole, /**< The room canonical alias. */
|
CanonicalAliasRole, /**< The room canonical alias. */
|
||||||
TopicRole, /**< The room topic. */
|
TopicRole, /**< The room topic. */
|
||||||
|
|||||||
@@ -23,8 +23,9 @@ ColumnLayout {
|
|||||||
FormCard.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
id: roomComboBox
|
id: roomComboBox
|
||||||
text: i18n("Room")
|
text: i18n("Room")
|
||||||
textRole: "displayName"
|
textRole: "escapedDisplayName"
|
||||||
valueRole: "roomId"
|
valueRole: "roomId"
|
||||||
|
displayText: roomListModel.data(roomListModel.index(currentIndex, 0), RoomListModel.DisplayNameRole)
|
||||||
model: RoomListModel {
|
model: RoomListModel {
|
||||||
id: roomListModel
|
id: roomListModel
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
|
|||||||
Reference in New Issue
Block a user