1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-28 03:32:27 +01:00

Don't load xspf tracks that have no title or artist, we needs them.

Show a warning when failing to load tracks from an XSPF.
This commit is contained in:
Leo Franchi 2011-03-13 15:28:08 -04:00
parent 7d13c56081
commit 736e0800de

View File

@ -99,6 +99,7 @@ XSPFLoader::gotBody()
if ( m_title.isEmpty() )
m_title = tr( "New Playlist" );
bool shownError = false;
for ( unsigned int i = 0; i < tracklist.length(); i++ )
{
QDomNode e = tracklist.at( i );
@ -118,6 +119,14 @@ XSPFLoader::gotBody()
track = n.text();
}
}
if( artist.isEmpty() || track.isEmpty() ) {
if( !shownError ) {
QMessageBox::warning( 0, tr( "Failed to save tracks" ), tr( "Some tracks in the playlist do not contain an artist and a title. They will be ignored." ), QMessageBox::Ok );
shownError = true;
}
continue;
}
plentry_ptr p( new PlaylistEntry );
p->setGuid( uuid() );