rendered paste bodybool CollectionManager::setupCollection( QString collectionPath )
{
QDir collection( collectionPath );
QString entry;
QDirIterator it(collection, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks );
[...]
QTextStream out( &database );
QDataStream indexstream( &index );
while( it.hasNext() ) {
entry = it.next();
//entry = it.filePath();
//qDebug()<<entry;
if( it.fileInfo().isFile() && ( entry.endsWith( ".mp3", Qt::CaseInsensitive ) || entry.endsWith( ".ogg", Qt::CaseInsensitive ) ) ) {
indexstream << database.pos(); // expensive?
//qDebug() << database.pos();
out << it.filePath();
out << "\n";
out.flush();
songcount++;
}
}
qDebug() << "I found" << songcount << "songs in the collection.";
// TODO 0.0.1: tests show that songs with umlauts are missing
indexstream << songcount;
}
[...]