From 1838d485921625ac370fb4de93e185cae95fb341 Mon Sep 17 00:00:00 2001 From: druid23 Date: Tue, 17 Aug 2010 02:18:09 +0100 Subject: [PATCH] Fixed playlist disappearing on remove or clear. modified: playlistmainwindow.cpp --- playlistmainwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playlistmainwindow.cpp b/playlistmainwindow.cpp index 4af4b7a..8ba4412 100644 --- a/playlistmainwindow.cpp +++ b/playlistmainwindow.cpp @@ -109,7 +109,7 @@ void PlayListMainWindow::onListSelectionChanged() { void PlayListMainWindow::onRemove() { if (0 < this->mCurrentVlcIndex) { /*QNetworkReply * reply = */ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_delete&id=" + QString::number(this->mCurrentVlcIndex)))); - this->requestPlayList(); + connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList())); } } void PlayListMainWindow::onPlay() { @@ -128,7 +128,7 @@ void PlayListMainWindow::onShuffle() { } void PlayListMainWindow::onClear() { /*QNetworkReply * reply = */ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=pl_empty"))); - this->requestPlayList(); + connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList())); } void PlayListMainWindow::requestPlayList() { mContents->clear(); @@ -137,6 +137,7 @@ void PlayListMainWindow::requestPlayList() { ui->removeButton->setDisabled(true); ui->playButton->setDisabled(true); QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/playlist.xml"))); + disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList())); connect(reply,SIGNAL(readyRead()),this,SLOT(readReady())); connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *))); } -- 1.7.9.5