1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 16:29:43 +01:00

Add error checking when can't get short url.

This commit is contained in:
Alejandro Wainzinger 2011-09-10 02:13:45 -07:00
parent b250d13362
commit 79920efe4f

View File

@ -814,7 +814,6 @@ GlobalActionManager::shortenLinkRequestFinished()
if( !reply )
{
emit shortLinkReady( QUrl( "" ), QUrl( "" ) );
reply->deleteLater();
return;
}
@ -847,9 +846,22 @@ GlobalActionManager::shortenLinkRequestFinished()
}
void
GlobalActionManager::shortenLinkRequestError( QNetworkReply::NetworkError )
GlobalActionManager::shortenLinkRequestError( QNetworkReply::NetworkError error )
{
qDebug() << Q_FUNC_INFO;
qDebug() << "Network Error: " << error;
QNetworkReply *reply = qobject_cast<QNetworkReply*>( sender() );
// NOTE: this should never happen
if( !reply )
{
emit shortLinkReady( QUrl( "" ), QUrl( "" ) );
return;
}
reply->deleteLater();
emit shortLinkReady( QUrl( "" ), QUrl( "" ) );
}
void