diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index 130fea52..370c1b1a 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -154,6 +154,20 @@ int main(int argc, char *argv[]) settingsCache->setPlayerBgPath(destDir + "/fabric_gray.png"); } } + + if(settingsCache->getSoundPath().isEmpty()) + { + QString srcDir = QLibraryInfo::location(QLibraryInfo::DataPath); + QString destDir = dataDir + "/sounds"; + QDir tmpDir(destDir); + if(!tmpDir.exists()) + { + // try to install the default sounds for the current user and set the settigs value + settingsCache->copyPath(srcDir + "/sounds", destDir); + + settingsCache->setSoundPath(destDir); + } + } #endif if (!settingsValid() || db->getLoadStatus() != Ok) {