mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
Skip to next track if we have a QNR and it emits a failed signal
This commit is contained in:
parent
124706afab
commit
9418fd0fb8
@ -424,6 +424,9 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
|
||||
tLog() << "Starting new song:" << m_currentTrack->url();
|
||||
emit loading( m_currentTrack );
|
||||
|
||||
if ( QNetworkReply* qnr_io = qobject_cast< QNetworkReply* >( io.data() ) )
|
||||
connect( qnr_io, SIGNAL( error( QNetworkReply::NetworkError ) ), this, SLOT( ioStreamError( QNetworkReply::NetworkError ) ) );
|
||||
|
||||
if ( !isHttpResult( m_currentTrack->url() ) && !isLocalResult( m_currentTrack->url() ) )
|
||||
{
|
||||
if ( QNetworkReply* qnr_io = qobject_cast< QNetworkReply* >( io.data() ) )
|
||||
@ -573,6 +576,16 @@ AudioEngine::playItem( Tomahawk::PlaylistInterface* playlist, const Tomahawk::re
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioEngine::ioStreamError( QNetworkReply::NetworkError error )
|
||||
{
|
||||
if ( error != QNetworkReply::NoError )
|
||||
{
|
||||
if ( canGoNext() )
|
||||
loadNextTrack();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::playlistNextTrackReady()
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#include <phonon/MediaObject>
|
||||
#include <phonon/AudioOutput>
|
||||
@ -134,6 +135,7 @@ private slots:
|
||||
|
||||
void setCurrentTrack( const Tomahawk::result_ptr& result );
|
||||
|
||||
void ioStreamError( QNetworkReply::NetworkError );
|
||||
private:
|
||||
void setState( AudioState state );
|
||||
|
||||
|
@ -371,6 +371,7 @@ RdioParser::pixmap() const
|
||||
if ( !s_pixmap )
|
||||
s_pixmap = new QPixmap( RESPATH "images/rdio.png" );
|
||||
|
||||
|
||||
return *s_pixmap;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user