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