mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-30 23:50:19 -07:00
Sound engine: don't open() inexistent files
Avoid error “QIODevice::read: device not open”
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user