Subsonic: Disconnect signal/slots
This commit is contained in:
parent
b4bc7333d9
commit
168e101a5a
@ -80,14 +80,14 @@ SubsonicRequest::~SubsonicRequest() {
|
||||
|
||||
while (!replies_.isEmpty()) {
|
||||
QNetworkReply *reply = replies_.takeFirst();
|
||||
disconnect(reply, 0, this, 0);
|
||||
disconnect(reply, nullptr, this, nullptr);
|
||||
if (reply->isRunning()) reply->abort();
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
while (!album_cover_replies_.isEmpty()) {
|
||||
QNetworkReply *reply = album_cover_replies_.takeFirst();
|
||||
disconnect(reply, 0, this, 0);
|
||||
disconnect(reply, nullptr, this, nullptr);
|
||||
if (reply->isRunning()) reply->abort();
|
||||
reply->deleteLater();
|
||||
}
|
||||
@ -355,6 +355,7 @@ void SubsonicRequest::AlbumSongsReplyReceived(QNetworkReply *reply, const QStrin
|
||||
|
||||
if (!replies_.contains(reply)) return;
|
||||
replies_.removeAll(reply);
|
||||
disconnect(reply, nullptr, this, nullptr);
|
||||
reply->deleteLater();
|
||||
|
||||
--album_songs_requests_active_;
|
||||
@ -722,10 +723,11 @@ void SubsonicRequest::FlushAlbumCoverRequests() {
|
||||
|
||||
}
|
||||
|
||||
void SubsonicRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url, const QString &filename) {
|
||||
void SubsonicRequest::AlbumCoverReceived(QNetworkReply *reply, const QString album_id, const QUrl url, const QString filename) {
|
||||
|
||||
if (album_cover_replies_.contains(reply)) {
|
||||
album_cover_replies_.removeAll(reply);
|
||||
disconnect(reply, nullptr, this, nullptr);
|
||||
reply->deleteLater();
|
||||
}
|
||||
else {
|
||||
|
@ -69,23 +69,24 @@ class SubsonicRequest : public SubsonicBaseRequest {
|
||||
private slots:
|
||||
void AlbumsReplyReceived(QNetworkReply *reply, const int offset_requested);
|
||||
void AlbumSongsReplyReceived(QNetworkReply *reply, const QString &artist_id, const QString &album_id, const QString &album_artist);
|
||||
void AlbumCoverReceived(QNetworkReply *reply, const QString &album_id, const QUrl &url, const QString &filename);
|
||||
void AlbumCoverReceived(QNetworkReply *reply, const QString album_id, const QUrl url, const QString filename);
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
|
||||
struct Request {
|
||||
QString artist_id = 0;
|
||||
explicit Request() : offset(0), size(0) {}
|
||||
QString artist_id;
|
||||
QString album_id;
|
||||
QString song_id = 0;
|
||||
int offset = 0;
|
||||
int size = 0;
|
||||
QString song_id;
|
||||
int offset;
|
||||
int size;
|
||||
QString album_artist;
|
||||
};
|
||||
struct AlbumCoverRequest {
|
||||
QString artist_id = 0;
|
||||
QString album_id = 0;
|
||||
QString artist_id;
|
||||
QString album_id;
|
||||
QUrl url;
|
||||
QString filename;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user