Playlist tweaks. remove dead / orphaned nodes that vlc doesn't clean up in teh xml.
authordruid23 <usr@dru-id.co.uk>
Sat, 21 Aug 2010 20:46:58 +0000 (21:46 +0100)
committerdruid23 <usr@dru-id.co.uk>
Sat, 21 Aug 2010 20:46:58 +0000 (21:46 +0100)
modified:   playermainwindow.cpp
modified:   playlistmainwindow.cpp

playermainwindow.cpp
playlistmainwindow.cpp

index acaed45..a7c284e 100644 (file)
 
   }
   void PlayerMainWindow::setCoverArt(const QByteArray data) {
-      qDebug() << "set cover art called! data.length" << data.length();
     QPixmap* image = new QPixmap();
     if (image->loadFromData(data)) {
-        qDebug() << "image loaded!";
         mHasImage = true;
         ui->labelArtLandscape->setPixmap(image->scaledToHeight(120, Qt::SmoothTransformation));
         ui->labelArtPortrait->setPixmap(image->scaledToHeight(310, Qt::SmoothTransformation));
     }
     else {
         qDebug() << "image load failed!";
+        qDebug() << "data.length" << data.length();
         ui->labelArtPortrait->setVisible(false);
         ui->labelArtLandscape->setVisible(false);
     }
index 965098d..61a4717 100644 (file)
@@ -298,7 +298,10 @@ void PlayListMainWindow::parsePlayListItem(QDomNode *node, QString *extension, b
         else {
             el->type = "node";
             el->extension = getExtension(el->path, NULL);
-            this->mContents->append(*el);
+            // empty nodes appear in the playlist when they can't be played!
+            if (node->hasChildNodes()) {
+                this->mContents->append(*el);
+            }
             delete el;
             // now parse the child nodes as leaf.
             if (node->hasChildNodes()) {