All platform: at startup, ensure that a proper directory for sounds is set
This commit is contained in:
parent
924337ee93
commit
8fba04397b
1 changed files with 14 additions and 0 deletions
|
@ -165,6 +165,20 @@ int main(int argc, char *argv[])
|
|||
if (!QDir().mkpath(settingsCache->getPicsPath() + "/CUSTOM"))
|
||||
qDebug() << "Could not create " + settingsCache->getPicsPath().toUtf8() + "/CUSTOM. Will fall back on default card images.";
|
||||
|
||||
if(settingsCache->getSoundPath().isEmpty() || !QDir(settingsCache->getSoundPath()).exists())
|
||||
{
|
||||
QDir tmpDir;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
tmpDir = app.applicationDirPath() + "/../Resources/sounds";
|
||||
#elif defined(Q_OS_WIN)
|
||||
tmpDir = app.applicationDirPath() + "/sounds";
|
||||
#else // linux
|
||||
tmpDir = app.applicationDirPath() + "/../share/cockatrice/sounds/";
|
||||
#endif
|
||||
settingsCache->setSoundPath(tmpDir.canonicalPath());
|
||||
}
|
||||
|
||||
if (!settingsValid() || db->getLoadStatus() != Ok) {
|
||||
qDebug("main(): invalid settings or load status");
|
||||
DlgSettings dlgSettings;
|
||||
|
|
Loading…
Reference in a new issue