forked from qt-creator/qt-creator
QmlJS: Use canonical paths for matching of import directories
We rely on string comparison for detection of QML import paths. Therefore make sure that all paths are canonical. Change-Id: I416bc31915644a888c416d726049668b0e71f29a Task-number: QTCREATORBUG-12902 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -438,15 +438,21 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
|
||||
}
|
||||
|
||||
bool LinkPrivate::importLibrary(Document::Ptr doc,
|
||||
const QString &libraryPath,
|
||||
const QString &libraryPath_,
|
||||
Import *import,
|
||||
const QString &importPath)
|
||||
{
|
||||
const ImportInfo &importInfo = import->info;
|
||||
QString libraryPath = libraryPath_;
|
||||
|
||||
const LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
|
||||
if (!libraryInfo.isValid())
|
||||
return false;
|
||||
LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
|
||||
if (!libraryInfo.isValid()) {
|
||||
// try canonical path
|
||||
libraryPath = QFileInfo(libraryPath).canonicalFilePath();
|
||||
libraryInfo = snapshot.libraryInfo(libraryPath);
|
||||
if (!libraryInfo.isValid())
|
||||
return false;
|
||||
}
|
||||
|
||||
import->libraryPath = libraryPath;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user