Tweaked some directory handling code.
authordruid23 <usr@dru-id.co.uk>
Sun, 22 Aug 2010 14:47:38 +0000 (15:47 +0100)
committerdruid23 <usr@dru-id.co.uk>
Sun, 22 Aug 2010 14:47:38 +0000 (15:47 +0100)
modified:   browsemainwindow.cpp
modified:   playermainwindow.cpp

browsemainwindow.cpp
playermainwindow.cpp

index e960cab..2c7582f 100644 (file)
@@ -123,7 +123,7 @@ void BrowseMainWindow::onListSelectionChanged() {
         }
         else {
             // can we browse?
-            if (0 == QString::compare("directory", mCurrentElement.type)) {
+            if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
                 ui->browseButton->setDisabled(false);
             }
             else {
@@ -148,7 +148,7 @@ VlcBrowseElement BrowseMainWindow::getElementFromText(QString text) {
 
 void BrowseMainWindow::onBrowse() {
     // check for directory
-    if (0 == QString::compare("directory", mCurrentElement.type)) {
+    if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
         // call browseDirectory
         mCurrentDir = mCurrentElement.path;
         browseDirectory(mCurrentDir);
@@ -204,6 +204,7 @@ void BrowseMainWindow::finished(QNetworkReply * reply) {
 #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
     this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
 #endif
+    delete reply;
 }
 void BrowseMainWindow::parseXmlDirectory() {
     QDomDocument doc;
@@ -226,7 +227,7 @@ void BrowseMainWindow::parseXmlDirectory() {
             dir->name = node.attributes().namedItem("name").nodeValue();
             dir->extension = getExtension(dir->path, node.attributes().namedItem("extension").nodeValue());
             ++idx;
-            if (0 != QString::compare("directory", dir->type)) {
+            if (0 != QString::compare("directory", dir->type) && 0 != QString::compare("dir", dir->type)) {
                 files->append(*dir);
             }
             else if (0 == QString::compare("..", dir->name)) {
@@ -286,7 +287,7 @@ void BrowseMainWindow::updateList() {
             VlcBrowseElement dir = mContents->at(idx);
             QListWidgetItem* item;
             bool item_good = false;
-            if (0 == QString::compare("directory", dir.type)) {
+            if (0 == QString::compare("directory", dir.type) || 0 == QString::compare("dir", dir.type)) {
                 if (0 == QString::compare("..", dir.name)) {
                     item = new QListWidgetItem(icon_up, dir.name, ui->listWidget, 0);
                     item_good = true;
index 5ffb274..41e8b26 100644 (file)
       else {
           ui->labelArtLandscape->setVisible(false);
           ui->labelArtPortrait->setVisible(false);
-          // could use a default graphic here!
+          // could use a default graphic from extension here!
           // setCoverArtFromPixmap();
       }
   }