Show maindisplay's songinfo even if album or artist props are missing.

This commit is contained in:
Daniel Svensson 2006-08-10 15:42:15 +02:00
parent 762d71df38
commit 49d1b6cf9c

View file

@ -126,15 +126,20 @@ void
MainDisplay::setMediainfo (const Xmms::PropDict &info) MainDisplay::setMediainfo (const Xmms::PropDict &info)
{ {
QString n; QString n;
if (info.contains ("artist") && info.contains ("album") && if (info.contains ("title")) {
info.contains ("title")) { if (info.contains ("artist")) {
n = QString::fromUtf8 (info.get<std::string> ("artist").c_str ()) n = QString::fromUtf8 (info.get<std::string> ("artist").c_str ()) + " - ";
+ " - " + }
QString::fromUtf8 (info.get<std::string> ("album").c_str ()) if (info.contains ("album")) {
+ " - " + n += QString::fromUtf8 (info.get<std::string> ("album").c_str ()) + " - ";
}
n += QString::fromUtf8 (info.get<std::string> ("title").c_str ());
} else if (info.contains ("channel")) {
n = QString::fromUtf8 (info.get<std::string> ("channel").c_str ()) + " - " +
QString::fromUtf8 (info.get<std::string> ("title").c_str ()); QString::fromUtf8 (info.get<std::string> ("title").c_str ());
} else { } else {
n = QString::fromUtf8 (info.get<std::string> ("url").c_str ()); n = QString::fromUtf8 (info.get<std::string> ("url").c_str ());
n = n.section ("/", -1);
} }
m_text->setText (n); m_text->setText (n);