Merge pull request #2705 from karmux/master

Fixes #2537. GigaSampler can load both relative and absolute paths
This commit is contained in:
Oskar Wallgren
2016-04-24 06:34:00 +02:00

View File

@@ -209,7 +209,7 @@ void GigInstrument::openFile( const QString & _gigFile, bool updateTrackName )
try
{
m_instance = new GigInstance( _gigFile );
m_instance = new GigInstance( SampleBuffer::tryToMakeAbsolute( _gigFile ) );
m_filename = SampleBuffer::tryToMakeRelative( _gigFile );
}
catch( ... )
@@ -1067,18 +1067,7 @@ void GigInstrumentView::showFileDialog()
QString dir;
if( k->m_filename != "" )
{
QString f = k->m_filename;
if( QFileInfo( f ).isRelative() )
{
f = ConfigManager::inst()->gigDir() + f;
if( QFileInfo( f ).exists() == false )
{
f = ConfigManager::inst()->factorySamplesDir() + k->m_filename;
}
}
QString f = SampleBuffer::tryToMakeAbsolute( k->m_filename );
ofd.setDirectory( QFileInfo( f ).absolutePath() );
ofd.selectFile( QFileInfo( f ).fileName() );
}