Improve STK rawwave path detection (#5804)

This commit is contained in:
Hyunjin Song
2020-11-27 11:53:42 +09:00
committed by GitHub
parent 1949f93f10
commit 9ca5497202

View File

@@ -528,17 +528,16 @@ void ConfigManager::loadConfigFile(const QString & configFile)
{
#if defined(LMMS_BUILD_WIN32)
m_stkDir = m_dataDir + "stk/rawwaves/";
#elif defined(LMMS_BUILD_APPLE)
m_stkDir = qApp->applicationDirPath() + "/../share/stk/rawwaves/";
#else
if ( qApp->applicationDirPath().startsWith("/tmp/") )
// Look for bundled raw waves first
m_stkDir = qApp->applicationDirPath() + "/../share/stk/rawwaves/";
// Try system installations if not exists
if (!QDir(m_stkDir).exists())
{
// Assume AppImage bundle
m_stkDir = qApp->applicationDirPath() + "/../share/stk/rawwaves/";
m_stkDir = "/usr/local/share/stk/rawwaves/";
}
else
if (!QDir(m_stkDir).exists())
{
// Fallback to system provided location
m_stkDir = "/usr/share/stk/rawwaves/";
}
#endif