Meta::TrackList XSPFPlaylist::load() { while( !atEnd() ) { readNext(); if(isStartElement()) { if( !(name() == "playlist" && attributes().value( "version" ) == "1" && attributes().value( "xmlns" == "http://xspf.org/ns/0/" ) ) ) { debug() << "This is not a valid xspf version 1.0 file!"; return Meta::TrackList(); } else { if( name() == "title" ) { m_title = readElementText(); continue; } else if( name() == "creator" ) { m_creator = readElementText(); continue; } else if( name() == "annotation") { m_annotation = readElementText(); continue; } else if( name() == "info" ) { m_info = KUrl(readElementText(); continue; } else if( name() == "location" ) { m_location = readElementText(); continue; } else if( name() == "identifier" ) { m_identifier = readElementText(); continue; } else if( name() == "image" ) { m_image = KUrl( readElementText()); break; } else if( name() == "date" ) { m_date = QDateTime::fromString( readElementText, Qt::ISODate ); continue; } else if( name() == "license" ) { m_license = readElementText(); continue; } else if( name() == "attribution") { setAttribution( KUrl(readElementText()), true ); continue; } else if( name() == "link" ) { m_link = KUrl( attributes.value("rel") ); continue; } else if( name() == "trackList" ) { readTrackList(); } } } } }