Paste P464

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Sep 13 2019, 8:53 PM.
From 869225a65d97533042d30fb8389464584f536695 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Fri, 13 Sep 2019 22:28:54 +0200
Subject: [PATCH] Avoid HTML in labels showing the device name
---
src/kcmodule/devices/devicedetails.ui | 5 ++++-
src/kded/helpers/requestauthorization.cpp | 4 ++--
src/kded/helpers/requestconfirmation.cpp | 4 ++--
src/kded/helpers/requestpin.cpp | 4 ++--
src/kded/receivefilejob.cpp | 4 ++--
src/sendfile/pages/connecting.ui | 6 +++++-
src/sendfile/pages/failpage.ui | 3 +++
src/wizard/pages/fail.ui | 3 +++
src/wizard/pages/pairing.ui | 6 +++++-
src/wizard/pages/success.ui | 3 +++
10 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/src/kcmodule/devices/devicedetails.ui b/src/kcmodule/devices/devicedetails.ui
index 651b29e3..d4e6b032 100644
--- a/src/kcmodule/devices/devicedetails.ui
+++ b/src/kcmodule/devices/devicedetails.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>341</width>
- <height>468</height>
+ <height>570</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@@ -97,6 +97,9 @@
</item>
<item>
<widget class="QLabel" name="remoteName">
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
diff --git a/src/kded/helpers/requestauthorization.cpp b/src/kded/helpers/requestauthorization.cpp
index eaf84210..5ef2839a 100644
--- a/src/kded/helpers/requestauthorization.cpp
+++ b/src/kded/helpers/requestauthorization.cpp
@@ -36,10 +36,10 @@ RequestAuthorization::RequestAuthorization(BluezQt::DevicePtr device, QObject *p
KNotification::Persistent, this);
notification->setComponentName(QStringLiteral("bluedevil"));
- notification->setTitle(QStringLiteral("%1 (%2)").arg(m_device->name(), m_device->address()));
+ notification->setTitle(QStringLiteral("%1 (%2)").arg(m_device->name().toHtmlEscaped(), m_device->address().toHtmlEscaped()));
notification->setText(i18nc("Show a notification asking to authorize or deny access to this computer from Bluetooth."
"The %1 is the name of the bluetooth device",
- "%1 is requesting access to this computer", m_device->name()));
+ "%1 is requesting access to this computer", m_device->name().toHtmlEscaped()));
QStringList actions;
actions.append(i18nc("Button to trust a bluetooth remote device and authorize it to connect", "Trust && Authorize"));
diff --git a/src/kded/helpers/requestconfirmation.cpp b/src/kded/helpers/requestconfirmation.cpp
index 3c4ecbaf..abbb0d26 100644
--- a/src/kded/helpers/requestconfirmation.cpp
+++ b/src/kded/helpers/requestconfirmation.cpp
@@ -35,10 +35,10 @@ RequestConfirmation::RequestConfirmation(BluezQt::DevicePtr device, const QStrin
KNotification::Persistent, this);
notification->setComponentName(QStringLiteral("bluedevil"));
- notification->setTitle(QStringLiteral("%1 (%2)").arg(m_device->name(), m_device->address()));
+ notification->setTitle(QStringLiteral("%1 (%2)").arg(m_device->name().toHtmlEscaped(), m_device->address()));
notification->setText(i18nc("The text is shown in a notification to know if the PIN is correct,"
"%1 is the remote bluetooth device and %2 is the pin",
- "%1 is asking if the PIN is correct: %2", m_device->name(), m_pin));
+ "%1 is asking if the PIN is correct: %2", m_device->name().toHtmlEscaped(), m_pin));
QStringList actions;
actions.append(i18nc("Notification button to know if the pin is correct or not", "PIN correct"));
diff --git a/src/kded/helpers/requestpin.cpp b/src/kded/helpers/requestpin.cpp
index 61ce46ba..507c4bd9 100644
--- a/src/kded/helpers/requestpin.cpp
+++ b/src/kded/helpers/requestpin.cpp
@@ -43,10 +43,10 @@ RequestPin::RequestPin(BluezQt::DevicePtr device, bool numeric, QObject *parent)
KNotification::Persistent, this);
m_notification->setComponentName(QStringLiteral("bluedevil"));
- m_notification->setTitle(QStringLiteral("%1 (%2)").arg(m_device->name(), m_device->address()));
+ m_notification->setTitle(QStringLiteral("%1 (%2)").arg(m_device->name().toHtmlEscaped(), m_device->address().toHtmlEscaped()));
m_notification->setText(i18nc("Shown in a notification to announce that a PIN is needed to accomplish a pair action,"
"%1 is the name of the bluetooth device",
- "PIN needed to pair with %1", m_device->name()));
+ "PIN needed to pair with %1", m_device->name().toHtmlEscaped()));
QStringList actions;
actions.append(i18nc("Notification button which once clicked, a dialog to introduce the PIN will be shown",
diff --git a/src/kded/receivefilejob.cpp b/src/kded/receivefilejob.cpp
index 75d2e7ec..8a959611 100644
--- a/src/kded/receivefilejob.cpp
+++ b/src/kded/receivefilejob.cpp
@@ -138,10 +138,10 @@ void ReceiveFileJob::showNotification()
KNotification *notification = new KNotification(QStringLiteral("IncomingFile"),
KNotification::Persistent, this);
- notification->setTitle(QStringLiteral("%1 (%2)").arg(m_deviceName, m_deviceAddress));
+ notification->setTitle(QStringLiteral("%1 (%2)").arg(m_deviceName.toHtmlEscaped(), m_deviceAddress));
notification->setText(i18nc(
"Show a notification asking to authorize or deny an incoming file transfer to this computer from a Bluetooth device.",
- "%1 is sending you the file %2", m_deviceName, m_transfer->name()));
+ "%1 is sending you the file %2", m_deviceName.toHtmlEscaped(), m_transfer->name()));
QStringList actions;
actions.append(i18nc("Button to accept the incoming file transfer and download it in the default download directory", "Accept"));
diff --git a/src/sendfile/pages/connecting.ui b/src/sendfile/pages/connecting.ui
index 1f2bff7b..199411d9 100644
--- a/src/sendfile/pages/connecting.ui
+++ b/src/sendfile/pages/connecting.ui
@@ -12,7 +12,11 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="connLabel"/>
+ <widget class="QLabel" name="connLabel">
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ </widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
diff --git a/src/sendfile/pages/failpage.ui b/src/sendfile/pages/failpage.ui
index abc8064f..d76a75d9 100644
--- a/src/sendfile/pages/failpage.ui
+++ b/src/sendfile/pages/failpage.ui
@@ -44,6 +44,9 @@
<property name="text">
<string/>
</property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
</widget>
</item>
</layout>
diff --git a/src/wizard/pages/fail.ui b/src/wizard/pages/fail.ui
index d8b731b5..672e84fe 100644
--- a/src/wizard/pages/fail.ui
+++ b/src/wizard/pages/fail.ui
@@ -47,6 +47,9 @@
<property name="text">
<string/>
</property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
</widget>
</item>
</layout>
diff --git a/src/wizard/pages/pairing.ui b/src/wizard/pages/pairing.ui
index 7790b7ce..0c771c95 100644
--- a/src/wizard/pages/pairing.ui
+++ b/src/wizard/pages/pairing.ui
@@ -12,7 +12,11 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="connectingLbl"/>
+ <widget class="QLabel" name="connectingLbl">
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ </widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
diff --git a/src/wizard/pages/success.ui b/src/wizard/pages/success.ui
index 7019ebd7..33f14d69 100644
--- a/src/wizard/pages/success.ui
+++ b/src/wizard/pages/success.ui
@@ -47,6 +47,9 @@
<property name="text">
<string/>
</property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
</widget>
</item>
</layout>
--
2.22.0
davidedmundson edited the content of this paste. (Show Details)Sep 13 2019, 8:53 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.