From 49d1b6cf9c9da389b44b2b2d8721d29fd9f1754b Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 10 Aug 2006 15:42:15 +0200 Subject: [PATCH] Show maindisplay's songinfo even if album or artist props are missing. --- MainDisplay.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/MainDisplay.cpp b/MainDisplay.cpp index 62b0abe..56743cb 100644 --- a/MainDisplay.cpp +++ b/MainDisplay.cpp @@ -126,15 +126,20 @@ void MainDisplay::setMediainfo (const Xmms::PropDict &info) { QString n; - if (info.contains ("artist") && info.contains ("album") && - info.contains ("title")) { - n = QString::fromUtf8 (info.get ("artist").c_str ()) - + " - " + - QString::fromUtf8 (info.get ("album").c_str ()) - + " - " + + if (info.contains ("title")) { + if (info.contains ("artist")) { + n = QString::fromUtf8 (info.get ("artist").c_str ()) + " - "; + } + if (info.contains ("album")) { + n += QString::fromUtf8 (info.get ("album").c_str ()) + " - "; + } + n += QString::fromUtf8 (info.get ("title").c_str ()); + } else if (info.contains ("channel")) { + n = QString::fromUtf8 (info.get ("channel").c_str ()) + " - " + QString::fromUtf8 (info.get ("title").c_str ()); } else { n = QString::fromUtf8 (info.get ("url").c_str ()); + n = n.section ("/", -1); } m_text->setText (n);