Improved some memory handling.
authordruid23 <usr@dru-id.co.uk>
Sun, 22 Aug 2010 13:08:08 +0000 (14:08 +0100)
committerdruid23 <usr@dru-id.co.uk>
Sun, 22 Aug 2010 13:08:08 +0000 (14:08 +0100)
modified:   playermainwindow.cpp
modified:   playlistmainwindow.cpp

playermainwindow.cpp
playlistmainwindow.cpp

index 9ee1480..5ffb274 100644 (file)
@@ -95,7 +95,6 @@
 
       connect(ui->playpauseButton,SIGNAL(clicked()),this,SLOT(playpause()));
       connect(ui->stopButton,SIGNAL(clicked()),this,SLOT(stop()));
-      //connect(ui->pauseButton,SIGNAL(clicked()),this,SLOT(playpause()));
       connect(ui->previousButton,SIGNAL(clicked()),this,SLOT(previous()));
       connect(ui->nextButton,SIGNAL(clicked()),this,SLOT(next()));
       connect(ui->fullscreenButton,SIGNAL(clicked()),this,SLOT(fullscreen()));
 
   void PlayerMainWindow::askStatus()
   {
-      qDebug() << "Status requested. at:" << QTime::currentTime().toString("hh::mm:ss");
+      //qDebug() << "Status requested. at:" << QTime::currentTime().toString("hh::mm:ss");
       QNetworkReply * reply =  mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml")));
       connect(reply,SIGNAL(readyRead()),this,SLOT(parseXmlStatus()));
   }
       QString album = metaInfoNode.namedItem("album").toElement().text();
       QString now_playing = metaInfoNode.namedItem("now_playing").toElement().text();
       QString art_url = metaInfoNode.namedItem("art_url").toElement().text();
+      //metaInfoNode.clear();
+      //infoNode.clear();
+      //docElem.clear();
+      //doc.clear();
       // Populate the current status structure
       // now would be a good time to work out if we are a new track / file or not.
       // key if we are going to look for album art later
       }
 
 
-      if (mCurrentStatus.position >= 0 && mCurrentStatus.position <= 100)
+      if (mCurrentStatus.position >= 0 && mCurrentStatus.position <= 100) {
+          ui->slider->blockSignals(true);
           ui->slider->setValue(mCurrentStatus.position);
+          ui->slider->blockSignals(false);
+      }
 
       ui->labelTitle->setText(mCurrentStatus.title);
       ui->labelArtist->setText(mCurrentStatus.artist);
     this->setCoverArt(mResponse);
     // only interested in finished signals
     disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+    delete reply;
   }
   void PlayerMainWindow::getCoverArt(int id) {
       qDebug() << "getCoverArt id=!" << id;
         ui->labelArtPortrait->setVisible(false);
         ui->labelArtLandscape->setVisible(false);
     }
+    delete image;
   }
   void PlayerMainWindow::setCoverArtFromPixmap(QPixmap image) {
     mHasImage = true;
index fd2569a..15789d6 100644 (file)
@@ -185,6 +185,7 @@ void PlayListMainWindow::finished(QNetworkReply * reply) {
 #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
   this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
 #endif
+  delete reply;
 }
 
 void PlayListMainWindow::parseXmlPlayList() {