1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-24 16:51:59 +01:00

use WaitForSignal

This commit is contained in:
Nick Lanham 2015-12-03 17:25:00 -08:00
parent 310cf001af
commit da537d9a4b

View File

@ -28,6 +28,7 @@
#include "core/network.h"
#include "core/taskmanager.h"
#include "core/timeconstants.h"
#include "core/waitforsignal.h"
#include "internet/core/internetplaylistitem.h"
#include <boost/scope_exit.hpp>
@ -109,13 +110,7 @@ PlaylistItemList SubsonicDynamicPlaylist::GenerateMore(int count) {
PlaylistItemList items;
QNetworkReply* reply = Send(network, url, service->usesslv3_);
// wait for reply
{
QEventLoop loop;
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
}
WaitForSignal(reply, SIGNAL(finished()));
reply->deleteLater();
@ -169,13 +164,7 @@ void SubsonicDynamicPlaylist::GetAlbum(SubsonicService* service,
QUrl url = service->BuildRequestUrl("getAlbum");
url.addQueryItem("id", id);
QNetworkReply* reply = Send(network, url, usesslv3);
{ // wait for reply
QEventLoop loop;
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
}
WaitForSignal(reply, SIGNAL(finished()));
reply->deleteLater();
if (reply->error() != QNetworkReply::NoError) {