From: druid23 Date: Tue, 17 Aug 2010 01:18:09 +0000 (+0100) Subject: Fixed playlist disappearing on remove or clear. X-Git-Tag: v0.5~47 X-Git-Url: http://git.maemo.org/git/?p=vlc-remote;a=commitdiff_plain;h=1838d485921625ac370fb4de93e185cae95fb341 Fixed playlist disappearing on remove or clear. modified: playlistmainwindow.cpp --- 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 *))); }