Treat device names as plaintext, not rich text

Summary:
Notifications, QML Text and QLabel accept a HTML subset,
which does not make sense for device names.

BUG: 382243

Test Plan:
Sent a pair request and accepted it, device name
now shown as plain text everywhere.

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: #kde_connect

Differential Revision: https://phabricator.kde.org/D6640
This commit is contained in:
Fabian Vogt 2017-07-12 10:51:09 +02:00
parent ef1bee54e0
commit 5641d818dc
3 changed files with 5 additions and 1 deletions

View file

@ -46,7 +46,7 @@ public:
KNotification* notification = new KNotification(QStringLiteral("pairingRequest"));
notification->setIconName(QStringLiteral("dialog-information"));
notification->setComponentName(QStringLiteral("kdeconnect"));
notification->setText(i18n("Pairing request from %1", getDevice(d->deviceLink()->deviceId())->name()));
notification->setText(i18n("Pairing request from %1", getDevice(d->deviceLink()->deviceId())->name()).toHtmlEscaped());
notification->setActions(QStringList() << i18n("Accept") << i18n("Reject"));
connect(notification, &KNotification::ignored, d, &PairingHandler::rejectPairing);
connect(notification, &KNotification::action1Activated, d, &PairingHandler::acceptPairing);

View file

@ -156,6 +156,9 @@
<property name="text">
<string>Device</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>

View file

@ -44,6 +44,7 @@ PlasmaComponents.ListItem
elide: Text.ElideRight
text: display
Layout.fillWidth: true
textFormat: Text.PlainText
}
//Find my phone