From 33bb42e8bebd179ca30815135f2bc768343172e8 Mon Sep 17 00:00:00 2001 From: Tobias Rundstrom Date: Wed, 23 Aug 2006 20:43:30 -0400 Subject: [PATCH] Updates for listing DAAP shares --- BrowseModel.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/BrowseModel.cpp b/BrowseModel.cpp index e57cf47..563fc51 100644 --- a/BrowseModel.cpp +++ b/BrowseModel.cpp @@ -74,21 +74,28 @@ BrowseModel::list_cb (const Xmms::List< Xmms::Dict > &res) } for (res.first (); res.isValid (); ++res) { - const char *tmp; Xmms::Dict d = *res; if (!d.contains ("path")) continue; - tmp = xmmsc_result_decode_url (NULL, d.get ("path").c_str ()); - QString path = QString::fromUtf8 (tmp); - free ((char *)tmp); + QString path = QString::fromStdString (d.get ("path")); QString name; if (d.contains ("name")) { name = QString::fromStdString ((*res).get ("name")); } else { - name = path.mid (path.lastIndexOf ("/")+1); + if (d.contains ("title") && d.contains ("artist")) { + name += QString::fromStdString (d.get ("artist")); + name += " - "; + name += QString::fromStdString (d.get ("title")); + } else { + const char *tmp; + QString tmp2 = path.mid (path.lastIndexOf ("/")+1); + tmp = xmmsc_result_decode_url (NULL, tmp2.toAscii ()); + name = QString::fromUtf8 (tmp); + free ((char *)tmp); + } } bool isdir = (*res).get ("isdir");