replace all nbsp in previews (#142)

This commit is contained in:
Evgenii Alekseev 2020-04-18 16:51:52 +03:00
parent e525cb4742
commit 55319521b2
4 changed files with 6 additions and 4 deletions

View File

@ -340,7 +340,8 @@ QString AWKeys::parsePattern(QString _pattern) const
// main keys // main keys
for (auto &key : m_foundKeys) for (auto &key : m_foundKeys)
_pattern.replace(QString("$%1").arg(key), m_aggregator->formatter(m_values[key], key, true)); _pattern.replace(QString("$%1").arg(key),
m_aggregator->formatter(m_values[key], key, true));
// bars // bars
for (auto &bar : m_foundBars) { for (auto &bar : m_foundBars) {

View File

@ -55,7 +55,8 @@ void AWKeysAggregator::initFormatters()
} }
QString AWKeysAggregator::formatter(const QVariant &_data, const QString &_key, bool replaceSpace) const QString AWKeysAggregator::formatter(const QVariant &_data, const QString &_key,
bool replaceSpace) const
{ {
qCDebug(LOG_AW) << "Data" << _data << "for key" << _key; qCDebug(LOG_AW) << "Data" << _data << "for key" << _key;

View File

@ -92,7 +92,7 @@ Row {
} }
onShowMessage: { onShowMessage: {
compiledText.text = message.replace("&nbsp;", " ") compiledText.text = message.split("&nbsp;").join(" ") // replaceAll lols
compiledText.open() compiledText.open()
} }
} }

View File

@ -68,7 +68,7 @@ Row {
// generate message // generate message
var message = i18n("Tag: %1", tags.currentText) var message = i18n("Tag: %1", tags.currentText)
message += "<br>" message += "<br>"
message += i18n("Value: %1", backend.valueByKey(tags.currentText)) message += i18n("Value: %1", backend.valueByKey(tags.currentText).split("&nbsp;").join(" "))
message += "<br>" message += "<br>"
message += i18n("Info: %1", backend.infoByKey(tags.currentText)) message += i18n("Info: %1", backend.infoByKey(tags.currentText))
notifyBackend.sendNotification("tag", message) notifyBackend.sendNotification("tag", message)