diff --git a/include/FileBrowser.h b/include/FileBrowser.h index a73a00801..d9847cf91 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -201,7 +201,7 @@ public: QString fullName() const { - return QFileInfo(m_path, text(0)).absoluteFilePath(); + return QDir::cleanPath(m_path) + "/" + text(0); } inline FileTypes type( void ) const diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index e627ca5c5..dbb2f71ac 100644 --- a/include/SampleBuffer.h +++ b/include/SampleBuffer.h @@ -253,7 +253,7 @@ public: } static QString tryToMakeRelative( const QString & _file ); - static QString tryToMakeAbsolute( const QString & _file ); + static QString tryToMakeAbsolute(const QString & file); public slots: diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 6dff51abb..e44b246e5 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -1414,20 +1414,24 @@ QString SampleBuffer::tryToMakeRelative( const QString & _file ) -QString SampleBuffer::tryToMakeAbsolute( const QString & _file ) +QString SampleBuffer::tryToMakeAbsolute(const QString& file) { - if( QFileInfo( _file ).isAbsolute() ) + QFileInfo f(file); + + if(f.isRelative()) { - return _file; + f = QFileInfo(ConfigManager::inst()->userSamplesDir() + file); + + if(! f.exists()) + { + f = QFileInfo(ConfigManager::inst()->factorySamplesDir() + file); + } } - QString f = ConfigManager::inst()->userSamplesDir() + _file; - if( QFileInfo( f ).exists() ) - { - return f; + if (f.exists()) { + return f.absoluteFilePath(); } - - return ConfigManager::inst()->factorySamplesDir() + _file; + return file; }