Add data search path support
Also add LMMS_DATA_DIR env var to "data:" search paths. When lmms is launched from its build directory (without `make install`ing), LMMS_DATA_DIR can be passed to point lmms to the "data" directory in the source tree.
This commit is contained in:
@@ -67,7 +67,7 @@ void BandLimitedWave::generateWaves()
|
||||
int i;
|
||||
|
||||
// set wavetable directory
|
||||
s_wavetableDir = ConfigManager::inst()->dataDir() + "wavetables/";
|
||||
s_wavetableDir = "data:wavetables/";
|
||||
|
||||
// set wavetable files
|
||||
QFile saw_file( s_wavetableDir + "saw.bin" );
|
||||
|
||||
@@ -63,6 +63,9 @@ ConfigManager::ConfigManager() :
|
||||
m_flDir( QDir::home().absolutePath() ),
|
||||
m_recoveryFile( QDir(m_workingDir).absoluteFilePath("recover.mmp") )
|
||||
{
|
||||
if (! qgetenv("LMMS_DATA_DIR").isEmpty())
|
||||
QDir::addSearchPath("data", QString::fromLocal8Bit(qgetenv("LMMS_DATA_DIR")));
|
||||
QDir::addSearchPath("data", m_dataDir);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user