forked from qt-creator/qt-creator
QmlJS: Ensure the C++ model manager is available before using it.
Change-Id: I0cc4e59505a6a5baa585e3748fdf174805d661b1 Reviewed-on: http://codereview.qt.nokia.com/3913 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -524,9 +524,11 @@ QList<LanguageUtils::FakeMetaObject::ConstPtr> FindExportedCppTypes::operator()(
|
||||
|
||||
FindExportsVisitor finder(document);
|
||||
QList<ExportedQmlType> exports = finder();
|
||||
CppModelManagerInterface::instance()->setExtraDiagnostics(
|
||||
document->fileName(), CppModelManagerInterface::ExportedQmlTypesDiagnostic,
|
||||
finder.messages());
|
||||
if (CppModelManagerInterface *cppModelManager = CppModelManagerInterface::instance()) {
|
||||
cppModelManager->setExtraDiagnostics(
|
||||
document->fileName(), CppModelManagerInterface::ExportedQmlTypesDiagnostic,
|
||||
finder.messages());
|
||||
}
|
||||
if (exports.isEmpty())
|
||||
return noResults;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user