X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=playlistmainwindow.cpp;h=4ce67a72987c0f897d608fa401be5e2add565fad;hb=503abed1e7cf3a8ae22cf4a89d13dd92b00d06d0;hp=4114ca5fbf655aa2544da3eedd83a50f08a2c07f;hpb=4faf919caf08cf7951a0a1bb1e9ceff02477c55c;p=vlc-remote diff --git a/playlistmainwindow.cpp b/playlistmainwindow.cpp index 4114ca5..4ce67a7 100644 --- a/playlistmainwindow.cpp +++ b/playlistmainwindow.cpp @@ -164,6 +164,10 @@ void PlayListMainWindow::parseXmlPlayList() { QDomNodeList nodes = docElem.elementsByTagName("node"); int depth = 0; + int currentLeafId = 0; + bool hasArt = false; + QString extension = ""; + int ct = nodes.count(); for (int idx = 0; idx < ct; ++idx) { QDomNode node = nodes.at(idx); @@ -205,6 +209,12 @@ void PlayListMainWindow::parseXmlPlayList() { it->type = "leaf"; current = item.attributes().namedItem("current").nodeValue(); it->playing = (0 < current.length()); + if (it->playing) { + currentLeafId = it->id; + QString art = item.toElement().namedItem("art_url").toElement().text(); + hasArt = (!art.isNull() && !art.isEmpty()); + extension = getExtension(it->path, NULL); + } this->mContents->append(*it); delete it; } @@ -226,8 +236,10 @@ void PlayListMainWindow::parseXmlPlayList() { mResponse.clear(); + emit this->idUpdated(currentLeafId, hasArt, extension); this->updateList(); + } QString PlayListMainWindow::getExtension(QString path, QString extension) {