Sound engine: don't open() inexistent files

Avoid error “QIODevice::read: device not open”
This commit is contained in:
Fabio Bas 2015-03-30 15:58:33 +02:00
parent 757795f7cd
commit 399886c25c

View file

@ -22,6 +22,8 @@ void SoundEngine::cacheData()
<< "notification" << "draw" << "playcard" << "shuffle" << "tap" << "untap" << "cuckoo";
for (int i = 0; i < fileNames.size(); ++i) {
QFile file(settingsCache->getSoundPath() + "/" + fileNames[i] + ".raw");
if(!file.exists())
continue;
file.open(QIODevice::ReadOnly);
audioData.insert(fileNames[i], file.readAll());
file.close();