mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
various updater fixes
This commit is contained in:
@@ -64,8 +64,6 @@ PlaylistUpdaterInterface::PlaylistUpdaterInterface( const playlist_ptr& pl )
|
|||||||
connect( m_timer, SIGNAL( timeout() ), this, SLOT( updateNow() ) );
|
connect( m_timer, SIGNAL( timeout() ), this, SLOT( updateNow() ) );
|
||||||
|
|
||||||
QTimer::singleShot( 0, this, SLOT( doSave() ) );
|
QTimer::singleShot( 0, this, SLOT( doSave() ) );
|
||||||
|
|
||||||
setAutoUpdate( m_autoUpdate );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaylistUpdaterInterface::PlaylistUpdaterInterface( const playlist_ptr& pl, int interval, bool autoUpdate )
|
PlaylistUpdaterInterface::PlaylistUpdaterInterface( const playlist_ptr& pl, int interval, bool autoUpdate )
|
||||||
|
@@ -55,8 +55,15 @@ XspfUpdater::~XspfUpdater()
|
|||||||
void
|
void
|
||||||
XspfUpdater::updateNow()
|
XspfUpdater::updateNow()
|
||||||
{
|
{
|
||||||
|
if ( m_url.isEmpty() )
|
||||||
|
{
|
||||||
|
qWarning() << "XspfUpdater not updating because we have an empty url...";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
XSPFLoader* l = new XSPFLoader( false, false );
|
XSPFLoader* l = new XSPFLoader( false, false );
|
||||||
l->setAutoResolveTracks( false );
|
l->setAutoResolveTracks( false );
|
||||||
|
l->setErrorTitle( playlist()->title() );
|
||||||
l->load( m_url );
|
l->load( m_url );
|
||||||
connect( l, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( playlistLoaded( QList<Tomahawk::query_ptr> ) ) );
|
connect( l, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( playlistLoaded( QList<Tomahawk::query_ptr> ) ) );
|
||||||
}
|
}
|
||||||
|
@@ -122,7 +122,11 @@ XSPFLoader::reportError()
|
|||||||
{
|
{
|
||||||
emit error( FetchError );
|
emit error( FetchError );
|
||||||
#ifndef ENABLE_HEADLESS
|
#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
|
#endif
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
@@ -49,6 +49,7 @@ public:
|
|||||||
void setOverrideTitle( const QString& newTitle );
|
void setOverrideTitle( const QString& newTitle );
|
||||||
void setAutoResolveTracks( bool autoResolve ) { m_autoResolve = autoResolve; }
|
void setAutoResolveTracks( bool autoResolve ) { m_autoResolve = autoResolve; }
|
||||||
void setAutoDelete( bool autoDelete ) { m_autoDelete = autoDelete; }
|
void setAutoDelete( bool autoDelete ) { m_autoDelete = autoDelete; }
|
||||||
|
void setErrorTitle( const QString& error ) { m_errorTitle = error; }
|
||||||
|
|
||||||
static QString errorToString( XSPFErrorCode error );
|
static QString errorToString( XSPFErrorCode error );
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ private:
|
|||||||
bool m_autoCreate, m_autoUpdate, m_autoResolve, m_autoDelete;
|
bool m_autoCreate, m_autoUpdate, m_autoResolve, m_autoDelete;
|
||||||
QString m_NS,m_overrideTitle;
|
QString m_NS,m_overrideTitle;
|
||||||
QList< Tomahawk::query_ptr > m_entries;
|
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;
|
QUrl m_url;
|
||||||
QByteArray m_body;
|
QByteArray m_body;
|
||||||
|
Reference in New Issue
Block a user