Skip to content

Commit

Permalink
replace all nbsp in previews (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcan1s committed Apr 18, 2020
1 parent e525cb4 commit 5531952
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sources/awesome-widget/plugin/awkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ QString AWKeys::parsePattern(QString _pattern) const

// main keys
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
for (auto &bar : m_foundBars) {
Expand Down
3 changes: 2 additions & 1 deletion sources/awesome-widget/plugin/awkeysaggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion sources/qml/AWExtensions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Row {
}

onShowMessage: {
compiledText.text = message.replace("&nbsp;", " ")
compiledText.text = message.split("&nbsp;").join(" ") // replaceAll lols
compiledText.open()
}
}
2 changes: 1 addition & 1 deletion sources/qml/AWTagSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Row {
// generate message
var message = i18n("Tag: %1", tags.currentText)
message += "<br>"
message += i18n("Value: %1", backend.valueByKey(tags.currentText))
message += i18n("Value: %1", backend.valueByKey(tags.currentText).split("&nbsp;").join(" "))
message += "<br>"
message += i18n("Info: %1", backend.infoByKey(tags.currentText))
notifyBackend.sendNotification("tag", message)
Expand Down

0 comments on commit 5531952

Please sign in to comment.