OSX: Handle sounds for first time installations
If the sounds path is unset in the settings and a “sounds” directory doesn’t exists in the user’s data directory, install the sounds files and set the settings value accordingly
This commit is contained in:
parent
d396b3dfac
commit
fef005d042
1 changed files with 14 additions and 0 deletions
|
@ -146,6 +146,20 @@ int main(int argc, char *argv[])
|
||||||
settingsCache->setPlayerBgPath(destDir + "/fabric_gray.png");
|
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
|
#endif
|
||||||
|
|
||||||
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty() || settingsCache->getPicsPath().isEmpty() || !QDir(settingsCache->getPicsPath()).exists()) {
|
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty() || settingsCache->getPicsPath().isEmpty() || !QDir(settingsCache->getPicsPath()).exists()) {
|
||||||
|
|
Loading…
Reference in a new issue