From da537d9a4b8680711842817b6e4c0e5c030bdc4e Mon Sep 17 00:00:00 2001 From: Nick Lanham Date: Thu, 3 Dec 2015 17:25:00 -0800 Subject: [PATCH] use WaitForSignal --- .../subsonic/subsonicdynamicplaylist.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/internet/subsonic/subsonicdynamicplaylist.cpp b/src/internet/subsonic/subsonicdynamicplaylist.cpp index a61055087..37a9f3c5f 100644 --- a/src/internet/subsonic/subsonicdynamicplaylist.cpp +++ b/src/internet/subsonic/subsonicdynamicplaylist.cpp @@ -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 @@ -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) {