Only strip '&' from D-Bus OSD messages

This commit is contained in:
Jonas Kvinge 2020-11-08 13:46:17 +01:00
parent c76d63d1d9
commit 9cc4ffdf6e
2 changed files with 6 additions and 3 deletions

View File

@ -146,8 +146,7 @@ void OSDBase::ShowPlaying(const Song &song, const QUrl &cover_url, const QImage
message_parts << tr("track %1").arg(song.track());
}
summary = summary.remove('&').simplified();
QString message = message_parts.join(", ").remove('&').simplified();
QString message = message_parts.join(", ");
if (show_art_) {
ShowMessage(summary, message, "notification-audio-play", image);

View File

@ -141,6 +141,10 @@ void OSDDBus::ShowMessageNative(const QString &summary, const QString &message,
if (!interface_) return;
QVariantMap hints;
QString summary_stripped = summary;
QString message_stripped = message;
summary_stripped = summary_stripped.remove('&').simplified();
message_stripped = message_stripped.remove('&').simplified();
if (!image.isNull()) {
if (version_ >= QVersionNumber(1, 2)) {
@ -163,7 +167,7 @@ void OSDDBus::ShowMessageNative(const QString &summary, const QString &message,
id = notification_id_;
}
QDBusPendingReply<uint> reply = interface_->Notify(app_name(), id, icon, summary, message, QStringList(), hints, timeout_msec());
QDBusPendingReply<uint> reply = interface_->Notify(app_name(), id, icon, summary_stripped, message_stripped, QStringList(), hints, timeout_msec());
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(CallFinished(QDBusPendingCallWatcher*)));