From b033be12719dd6fc507fa68dbb24cd5b809cb596 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Tue, 17 Jun 2014 16:58:23 +0000 Subject: [PATCH] Use same trans for with and without markup --- mpd/song.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mpd/song.cpp b/mpd/song.cpp index 196d77a1e..8c9e69889 100644 --- a/mpd/song.cpp +++ b/mpd/song.cpp @@ -594,17 +594,18 @@ QString Song::describe(bool withMarkup) const { QString albumText=album.isEmpty() ? name() : displayAlbum(album, Song::albumYear(*this)); - return withMarkup - ? title.isEmpty() - ? QLatin1String("")+albumText+QLatin1String("") - : artist.isEmpty() + if (title.isEmpty()) { + return withMarkup ? albumText : (QLatin1String("")+albumText+QLatin1String("")); + } + QString descr=artist.isEmpty() ? i18nc("Song on Album", "%1 on %2", title, albumText) - : i18nc("Song by Artist on Album", "%1 by %2 on %3", title, artist, albumText) - : title.isEmpty() - ? albumText - : artist.isEmpty() - ? i18nc("Song on Album", "%1 on %2", title, albumText) - : i18nc("Song by Artist on Album", "%1 by %2 on %3", title, artist, albumText); + : i18nc("Song by Artist on Album", "%1 by %2 on %3", title, artist, albumText); + + if (!withMarkup) { + descr=descr.replace("", ""); + descr=descr.replace("", ""); + } + return descr; } //QString Song::basicDescription() const