forked from qt-creator/qt-creator
Qmljs: check pointer to ModelManagerInterface
Task-number: QTCREATORBUG-19152 Change-Id: I3c511d15af943cc92c35a3c3d823080415940780 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This commit is contained in:
@@ -2239,11 +2239,13 @@ ImportInfo ImportInfo::pathImport(const QString &docPath, const QString &path,
|
|||||||
} else if (importFileInfo.isDir()) {
|
} else if (importFileInfo.isDir()) {
|
||||||
info.m_type = ImportType::Directory;
|
info.m_type = ImportType::Directory;
|
||||||
} else if (path.startsWith(QLatin1String("qrc:"))) {
|
} else if (path.startsWith(QLatin1String("qrc:"))) {
|
||||||
|
ModelManagerInterface *model = ModelManagerInterface::instance();
|
||||||
info.m_path = path;
|
info.m_path = path;
|
||||||
if (ModelManagerInterface::instance()->filesAtQrcPath(info.path()).isEmpty())
|
info.m_type = !model
|
||||||
info.m_type = ImportType::QrcDirectory;
|
? ImportType::UnknownFile
|
||||||
else
|
: model->filesAtQrcPath(info.path()).isEmpty()
|
||||||
info.m_type = ImportType::QrcFile;
|
? ImportType::QrcDirectory
|
||||||
|
: ImportType::QrcFile;
|
||||||
} else {
|
} else {
|
||||||
info.m_type = ImportType::UnknownFile;
|
info.m_type = ImportType::UnknownFile;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user