mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-13 13:37:36 -08:00
All platform: at startup, ensure that a proper directory for sounds is set
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user