forked from qt-creator/qt-creator
QmlJS: Fix handling multiple import paths into same module
It is possible to import components of different paths to fill a module. Take further paths into account when looking up types. Fixes: QTCREATORBUG-24405 Change-Id: I8d6bf0a324ea9c0d1fe9d91b40857f91f00dd662 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
@@ -421,16 +421,17 @@ QString PluginDumper::buildQmltypesPath(const QString &name) const
|
||||
version = m.captured("major") + QLatin1Char('.') + m.captured("minor");
|
||||
}
|
||||
|
||||
const QString path = modulePath(qualifiedName, version, m_modelManager->importPathsNames());
|
||||
const QStringList paths = modulePaths(qualifiedName, version, m_modelManager->importPathsNames());
|
||||
|
||||
if (path.isEmpty())
|
||||
if (paths.isEmpty())
|
||||
return QString();
|
||||
|
||||
QDirIterator it(path, QStringList { "*.qmltypes" }, QDir::Files);
|
||||
|
||||
if (it.hasNext())
|
||||
return it.next();
|
||||
for (const QString &path : paths) {
|
||||
QDirIterator it(path, QStringList { "*.qmltypes" }, QDir::Files);
|
||||
|
||||
if (it.hasNext())
|
||||
return it.next();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user