1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-18 23:09:42 +01:00

Make sure we always delete replies when finished with the network request.

This commit is contained in:
Christian Muehlhaeuser 2015-04-06 05:44:39 +02:00
parent 091d8697bc
commit 68598bea8b
20 changed files with 78 additions and 30 deletions

View File

@ -4,6 +4,7 @@
* Copyright 2011-2012, Hugo Lindström <hugolm84@gmail.com>
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -290,6 +291,7 @@ ChartsPlugin::chartSourcesList()
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Got chart sources list";
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
if ( reply->error() == QNetworkReply::NoError )
{
@ -432,6 +434,7 @@ ChartsPlugin::chartsList()
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Got chart list result";
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
if ( reply->error() == QNetworkReply::NoError )
{
@ -623,6 +626,7 @@ ChartsPlugin::chartReturned()
{
/// Chart request returned something! Woho
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QVariantMap returnedData;
if ( reply->error() == QNetworkReply::NoError )

View File

@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
@ -181,6 +181,7 @@ void
EchonestPlugin::getArtistBiographySlot()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Echonest::Artist artist = artistFromReply( reply );
Echonest::BiographyList biographies = artist.biographies();
QVariantMap biographyMap;
@ -196,7 +197,6 @@ EchonestPlugin::getArtistBiographySlot()
}
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
emit info( requestData, biographyMap );
reply->deleteLater();
}
@ -204,11 +204,11 @@ void
EchonestPlugin::getArtistFamiliaritySlot()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Echonest::Artist artist = artistFromReply( reply );
qreal familiarity = artist.familiarity();
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
emit info( requestData, familiarity );
reply->deleteLater();
}
@ -216,11 +216,11 @@ void
EchonestPlugin::getArtistHotttnesssSlot()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Echonest::Artist artist = artistFromReply( reply );
qreal hotttnesss = artist.hotttnesss();
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
emit info( requestData, hotttnesss );
reply->deleteLater();
}
@ -228,6 +228,7 @@ void
EchonestPlugin::getArtistTermsSlot()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Echonest::Artist artist = artistFromReply( reply );
Echonest::TermList terms = artist.terms();
QVariantMap termsMap;
@ -239,7 +240,6 @@ EchonestPlugin::getArtistTermsSlot()
}
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
emit info( requestData, termsMap );
reply->deleteLater();
}
@ -247,6 +247,7 @@ void
EchonestPlugin::getMiscTopSlot()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Echonest::TermList terms = Echonest::Artist::parseTopTerms( reply );
QVariantMap termsMap;
Q_FOREACH( const Echonest::Term& term, terms ) {
@ -257,7 +258,6 @@ EchonestPlugin::getMiscTopSlot()
}
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
emit info( requestData, termsMap );
reply->deleteLater();
}

View File

@ -2,6 +2,7 @@
*
* Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -318,6 +319,8 @@ HypemPlugin::chartReturned()
/// Chart request returned something! Woho
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QString url = reply->url().toString();
QVariantMap returnedData;
if ( reply->error() == QNetworkReply::NoError )

View File

@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
@ -155,6 +155,7 @@ MusicBrainzPlugin::gotReleaseGroupsSlot()
QNetworkReply* oldReply = qobject_cast<QNetworkReply*>( sender() );
if ( !oldReply )
return; //timeout will handle it
oldReply->deleteLater();
QDomDocument doc;
doc.setContent( oldReply->readAll() );
@ -213,6 +214,7 @@ MusicBrainzPlugin::gotReleasesSlot()
QNetworkReply* oldReply = qobject_cast<QNetworkReply*>( sender() );
if ( !oldReply )
return; //timeout will handle it
oldReply->deleteLater();
QDomDocument doc;
doc.setContent( oldReply->readAll() );
@ -260,6 +262,7 @@ MusicBrainzPlugin::gotRecordingsSlot()
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
if ( !reply )
return; //timeout will handle it
reply->deleteLater();
QDomDocument doc;
doc.setContent( reply->readAll() );

View File

@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
@ -112,6 +112,7 @@ MusixMatchPlugin::trackSearchSlot()
QNetworkReply* oldReply = qobject_cast<QNetworkReply*>( sender() );
if ( !oldReply )
return; //timeout will handle it
oldReply->deleteLater();
QDomDocument doc;
doc.setContent(oldReply->readAll());
@ -142,6 +143,7 @@ MusixMatchPlugin::trackLyricsSlot()
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
if ( !reply )
return; //timeout will handle it
reply->deleteLater();
QDomDocument doc;
doc.setContent( reply->readAll() );

View File

@ -4,6 +4,7 @@
* Copyright 2011-2012, Hugo Lindström <hugolm84@gmail.com>
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -295,11 +296,13 @@ NewReleasesPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
}
}
void
NewReleasesPlugin::nrSourcesList()
{
tDebug ( LOGVERBOSE ) << Q_FUNC_INFO << "Got newreleases sources list";
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
if ( reply->error() == QNetworkReply::NoError )
{
@ -434,6 +437,7 @@ NewReleasesPlugin::nrList()
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Got newreleases list result";
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
if ( reply->error() == QNetworkReply::NoError )
{
@ -658,13 +662,15 @@ NewReleasesPlugin::getMaxAge( const qlonglong expires ) const
return 0;
}
void
NewReleasesPlugin::nrReturned()
{
/// Chart request returned something! Woho
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
QVariantMap returnedData;
reply->deleteLater();
QVariantMap returnedData;
if ( reply->error() == QNetworkReply::NoError )
{
bool ok;

View File

@ -2,6 +2,7 @@
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -121,6 +122,7 @@ RoviPlugin::albumLookupFinished()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
Q_ASSERT( reply );
reply->deleteLater();
if ( reply->error() != QNetworkReply::NoError )
return;

View File

@ -2,6 +2,7 @@
*
* Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -196,6 +197,7 @@ SpotifyPlugin::chartTypes()
/// Get possible chart type for specificSpotifyPlugin: InfoChart types returned chart source
tDebug() << Q_FUNC_INFO << "Got spotifychart type result";
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
if ( reply->error() == QNetworkReply::NoError )
{
@ -284,6 +286,7 @@ SpotifyPlugin::chartReturned()
{
/// Chart request returned something! Woho
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QString url = reply->url().toString();
QVariantMap returnedData;
if ( reply->error() == QNetworkReply::NoError )

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -461,6 +462,7 @@ AtticaManager::resolverIconFetched()
{
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( reply );
reply->deleteLater();
const QString resolverId = reply->property( "resolverId" ).toString();
@ -631,6 +633,7 @@ AtticaManager::payloadFetched()
{
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( reply );
reply->deleteLater();
bool installedSuccessfully = false;
const QString resolverId = reply->property( "resolverId" ).toString();

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -125,6 +126,7 @@ EchonestCatalogSynchronizer::catalogDeleted()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
QString toDel = QString( "collection/%1Catalog" ).arg( r->property( "type" ).toString() );
@ -158,6 +160,7 @@ EchonestCatalogSynchronizer::songCreateFinished()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
tDebug() << "Finished creating song catalog, updating data now!!";
try
@ -192,6 +195,7 @@ EchonestCatalogSynchronizer::artistCreateFinished()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
// We don't support artist catalogs at the moment
return;
@ -275,6 +279,7 @@ EchonestCatalogSynchronizer::songUpdateFinished()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
try
{
@ -294,6 +299,7 @@ EchonestCatalogSynchronizer::checkTicket()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
try
{

View File

@ -555,6 +555,7 @@ void
LastFmInfoPlugin::similarArtistsReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QMap< int, QString > similarArtists = lastfm::Artist::getSimilar( reply );
@ -596,6 +597,7 @@ void
LastFmInfoPlugin::similarTracksReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QMap< int, QPair< QString, QString > > similarTracks = lastfm::Track::getSimilar( reply );
@ -648,6 +650,7 @@ void
LastFmInfoPlugin::chartReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QVariantMap returnedData;
const QRegExp tracks_rx( "chart\\.\\S+tracks\\S*", Qt::CaseInsensitive );
@ -694,6 +697,7 @@ void
LastFmInfoPlugin::topTracksReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QStringList topTracks = lastfm::Artist::getTopTracks( reply );
topTracks.removeDuplicates();
@ -716,6 +720,7 @@ void
LastFmInfoPlugin::artistInfoReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
if ( requestData.type == Tomahawk::InfoSystem::InfoArtistBiography )
@ -776,6 +781,7 @@ void
LastFmInfoPlugin::albumInfoReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
if ( requestData.type == Tomahawk::InfoSystem::InfoAlbumCoverArt )
@ -802,6 +808,7 @@ void
LastFmInfoPlugin::coverArtReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QUrl redir = reply->attribute( QNetworkRequest::RedirectionTargetAttribute ).toUrl();
if ( redir.isEmpty() )
{
@ -841,8 +848,6 @@ LastFmInfoPlugin::coverArtReturned()
newReply->setProperty( "requestData", reply->property( "requestData" ) );
connect( newReply, SIGNAL( finished() ), SLOT( coverArtReturned() ) );
}
reply->deleteLater();
}
@ -850,6 +855,7 @@ void
LastFmInfoPlugin::artistImagesReturned()
{
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
reply->deleteLater();
QUrl redir = reply->attribute( QNetworkRequest::RedirectionTargetAttribute ).toUrl();
if ( redir.isEmpty() )
{
@ -893,8 +899,6 @@ LastFmInfoPlugin::artistImagesReturned()
newReply->setProperty( "requestData", reply->property( "requestData" ) );
connect( newReply, SIGNAL( finished() ), SLOT( artistImagesReturned() ) );
}
reply->deleteLater();
}
@ -939,7 +943,8 @@ void
LastFmInfoPlugin::onAuthenticated()
{
QNetworkReply* authJob = dynamic_cast<QNetworkReply*>( sender() );
if ( !authJob || m_account.isNull() )
authJob->deleteLater();
if ( m_account.isNull() )
{
tLog() << Q_FUNC_INFO << "Help! No longer got a last.fm auth job!";
return;
@ -969,8 +974,6 @@ LastFmInfoPlugin::onAuthenticated()
tLog() << Q_FUNC_INFO << error.simplified();
}
authJob->deleteLater();
}

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -293,6 +294,7 @@ EchonestGenerator::staticFinished()
Q_ASSERT( qobject_cast< QNetworkReply* >( sender() ) );
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
reply->deleteLater();
Echonest::SongList songs;
try {
@ -361,6 +363,7 @@ void
EchonestGenerator::songLookupFinished()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
r->deleteLater();
if( !m_waiting.contains( r ) ) // another generate/start was begun meanwhile, we're out of date
return;
@ -399,6 +402,7 @@ EchonestGenerator::dynamicStarted()
Q_ASSERT( sender() );
Q_ASSERT( qobject_cast< QNetworkReply* >( sender() ) );
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
reply->deleteLater();
try
{
@ -417,6 +421,7 @@ EchonestGenerator::dynamicFetched()
Q_ASSERT( sender() );
Q_ASSERT( qobject_cast< QNetworkReply* >( sender() ) );
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
reply->deleteLater();
try
{
@ -731,6 +736,7 @@ EchonestGenerator::moodsReceived()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
try
{
@ -760,6 +766,7 @@ EchonestGenerator::stylesReceived()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
try
{
@ -787,6 +794,7 @@ EchonestGenerator::genresReceived()
{
QNetworkReply* r = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
try
{

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2014, Dominik Schmidt <domme@tomahawk-player.org>
* Copyright 2014, Dominik Schmidt <domme@tomahawk-player.org>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -3,6 +3,7 @@
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
* Copyright 2010-2012, Stefan Derkits <stefan@derkits.at>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -163,9 +164,9 @@ GroovesharkParser::trackPageFetchFinished()
{
NetworkReply* r = qobject_cast< NetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
m_queries.remove( r );
r->deleteLater();
QWebPage page;
page.settings()->setAttribute( QWebSettings::JavascriptEnabled, false );
@ -195,9 +196,9 @@ GroovesharkParser::groovesharkLookupFinished()
{
NetworkReply* r = qobject_cast< NetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
m_queries.remove( r );
r->deleteLater();
if ( r->reply()->error() == QNetworkReply::NoError )
{

View File

@ -3,6 +3,7 @@
* Written by Hugo Lindström <hugolm84@gmail.com>
* But based on Leo Franchi's work from spotifyParser
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -128,8 +129,8 @@ ItunesParser::itunesResponseLookupFinished()
{
NetworkReply* r = qobject_cast< NetworkReply* >( sender() );
Q_ASSERT( r );
m_queries.remove( r );
r->deleteLater();
m_queries.remove( r );
if ( r->reply()->error() == QNetworkReply::NoError )
{

View File

@ -1,6 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -99,13 +100,13 @@ void
JSPFLoader::networkLoadFinished()
{
NetworkReply* r = qobject_cast<NetworkReply*>( sender() );
r->deleteLater();
if ( r->reply()->error() == QNetworkReply::NoError )
{
m_body = r->reply()->readAll();
gotBody();
}
r->deleteLater();
}

View File

@ -1,7 +1,7 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -98,6 +98,7 @@ ShortenedLinkParser::lookupFinished( const QUrl& url )
{
NetworkReply* r = qobject_cast< NetworkReply* >( sender() );
Q_ASSERT( r );
r->deleteLater();
if ( r->reply()->error() != QNetworkReply::NoError )
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( tr( "Network error parsing shortened link!" ) ) );
@ -105,7 +106,6 @@ ShortenedLinkParser::lookupFinished( const QUrl& url )
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Got an un-shortened url:" << r->reply()->url().toString();
m_links << url.toString();
m_queries.remove( r );
r->deleteLater();
checkFinished();
}

View File

@ -2,6 +2,7 @@
*
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Hugo Lindström <hugolm84@gmail.com>
* Copyright 2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -220,9 +221,8 @@ SpotifyParser::spotifyBrowseFinished()
{
NetworkReply* r = qobject_cast< NetworkReply* >( sender() );
Q_ASSERT( r );
m_queries.remove( r );
r->deleteLater();
m_queries.remove( r );
if ( r->reply()->error() == QNetworkReply::NoError )
{
@ -293,8 +293,8 @@ SpotifyParser::spotifyTrackLookupFinished()
{
NetworkReply* r = qobject_cast< NetworkReply* >( sender() );
Q_ASSERT( r );
m_queries.remove( r );
r->deleteLater();
m_queries.remove( r );
if ( r->reply()->error() == QNetworkReply::NoError )
{

View File

@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2011-2012, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
*
@ -183,13 +183,13 @@ void
XSPFLoader::networkLoadFinished()
{
NetworkReply* r = qobject_cast<NetworkReply*>( sender() );
r->deleteLater();
if ( r->reply()->error() == QNetworkReply::NoError )
{
m_body = r->reply()->readAll();
gotBody();
}
r->deleteLater();
}

View File

@ -789,6 +789,7 @@ TomahawkApp::spotifyApiCheckFinished()
{
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
Q_ASSERT( reply );
reply->deleteLater();
DropJob::setCanParseSpotifyPlaylists( !reply->error() );
}