Use Canonical Paths for Relative Paths Calculations (#4211)

Fix redundant path elements
Closes #4173
This commit is contained in:
Tres Finocchiaro
2018-03-03 22:46:07 -05:00
committed by GitHub
parent 926b6542ae
commit 1d63bd3b4e
3 changed files with 7 additions and 3 deletions

View File

@@ -1415,7 +1415,8 @@ QString SampleBuffer::tryToMakeRelative( const QString & file )
{
if( QFileInfo( file ).isRelative() == false )
{
QString f = QString( file ).replace( QDir::separator(), '/' );
// Normalize the path
QString f = QFileInfo( file ).canonicalFilePath().replace( QDir::separator(), '/' );
// First, look in factory samples
// Isolate "samples/" from "data:/samples/"