mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 01:39:42 +01:00
various updater fixes
This commit is contained in:
parent
73d7ba03f5
commit
9f5215302c
@ -64,8 +64,6 @@ PlaylistUpdaterInterface::PlaylistUpdaterInterface( const playlist_ptr& pl )
|
||||
connect( m_timer, SIGNAL( timeout() ), this, SLOT( updateNow() ) );
|
||||
|
||||
QTimer::singleShot( 0, this, SLOT( doSave() ) );
|
||||
|
||||
setAutoUpdate( m_autoUpdate );
|
||||
}
|
||||
|
||||
PlaylistUpdaterInterface::PlaylistUpdaterInterface( const playlist_ptr& pl, int interval, bool autoUpdate )
|
||||
|
@ -55,8 +55,15 @@ XspfUpdater::~XspfUpdater()
|
||||
void
|
||||
XspfUpdater::updateNow()
|
||||
{
|
||||
if ( m_url.isEmpty() )
|
||||
{
|
||||
qWarning() << "XspfUpdater not updating because we have an empty url...";
|
||||
return;
|
||||
}
|
||||
|
||||
XSPFLoader* l = new XSPFLoader( false, false );
|
||||
l->setAutoResolveTracks( false );
|
||||
l->setErrorTitle( playlist()->title() );
|
||||
l->load( m_url );
|
||||
connect( l, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( playlistLoaded( QList<Tomahawk::query_ptr> ) ) );
|
||||
}
|
||||
|
@ -122,7 +122,11 @@ XSPFLoader::reportError()
|
||||
{
|
||||
emit error( FetchError );
|
||||
#ifndef ENABLE_HEADLESS
|
||||
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( errorToString( FetchError) ) );
|
||||
const QString errorMsg = errorToString( FetchError);
|
||||
if ( !m_errorTitle.isEmpty() )
|
||||
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( QString( "%1: %2" ).arg( m_errorTitle ).arg( errorMsg ) ) );
|
||||
else
|
||||
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( errorMsg ) );
|
||||
#endif
|
||||
deleteLater();
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
void setOverrideTitle( const QString& newTitle );
|
||||
void setAutoResolveTracks( bool autoResolve ) { m_autoResolve = autoResolve; }
|
||||
void setAutoDelete( bool autoDelete ) { m_autoDelete = autoDelete; }
|
||||
void setErrorTitle( const QString& error ) { m_errorTitle = error; }
|
||||
|
||||
static QString errorToString( XSPFErrorCode error );
|
||||
|
||||
@ -73,7 +74,7 @@ private:
|
||||
bool m_autoCreate, m_autoUpdate, m_autoResolve, m_autoDelete;
|
||||
QString m_NS,m_overrideTitle;
|
||||
QList< Tomahawk::query_ptr > m_entries;
|
||||
QString m_title, m_info, m_creator;
|
||||
QString m_title, m_info, m_creator, m_errorTitle;
|
||||
|
||||
QUrl m_url;
|
||||
QByteArray m_body;
|
||||
|
Loading…
x
Reference in New Issue
Block a user