+void LevelSwitcher::readLevelCollections(QStringList collections)
+{
+ foreach (const QString& coll, collections) {
+ QFile file(QString(LEVDIR) + "/" + coll + ".dat");
+ qDebug() << "Trying to read" << file.fileName();
+ if (!file.exists())
+ qFatal("Error reading level collection: doesn't exist");
+ file.open(QIODevice::ReadOnly);
+ QTextStream levelData(&file);
+ QStringList readLevels;
+ while (!levelData.atEnd())
+ readLevels << levelData.readLine();
+
+ levelCollections.insert(coll, readLevels);
+ file.close();
+ }
+}
+