From 7c8cd781693682bb755fb16ea8c37d8a166ed616 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Tue, 18 Feb 2014 13:02:02 +0100 Subject: [PATCH] correctly escape newline --- src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp b/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp index 340522871..603d608d8 100644 --- a/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp +++ b/src/infoplugins/generic/snorenotify/SnoreNotifyPlugin.cpp @@ -186,13 +186,13 @@ SnoreNotifyPlugin::nowPlaying( const QVariant& input ) // Remark: If using xml-based markup in notifications, the supplied strings need to be escaped. QString album; if ( !hash[ "album" ].isEmpty() ) - album = QString( "\n%1 %2" ).arg( tr( "on", "'on' is followed by an album name" ) ).arg( Qt::escape( hash[ "album" ] ) ); + album = QString( "
%1 %2" ).arg( tr( "on", "'on' is followed by an album name" ) ).arg( Qt::escape( hash[ "album" ] ) ); messageText = tr( "%1%4 %2%3.", "%1 is a title, %2 is an artist and %3 is replaced by either the previous message or nothing, %4 is the preposition used to link track and artist ('by' in english)" ) .arg( Qt::escape( hash[ "title" ] ) ) .arg( Qt::escape( hash[ "artist" ] ) ) .arg( album ) - .arg( QString( "\n%1" ).arg( tr( "by", "preposition to link track and artist" ) ) ); + .arg( QString( "
%1" ).arg( tr( "by", "preposition to link track and artist" ) ) ); // Dirty hack(TM) so that KNotify/QLabel recognizes the message as Rich Text messageText = QString( "%1" ).arg( messageText );