Commit f7b2dd95 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.textToModelMerger: check for no imports

No imports make no sense in the visual designer.

Change-Id: Ib426d726c6d7e11a3dce25b3c73c4bc921f64f60
Reviewed-on: http://codereview.qt.nokia.com/1505Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent f231c246
......@@ -748,6 +748,11 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
setupImports(doc, differenceHandler);
if (m_rewriterView->model()->imports().isEmpty()) {
const QmlJS::DiagnosticMessage diagnosticMessage(QmlJS::DiagnosticMessage::Error, AST::SourceLocation(0, 0, 0, 0), QCoreApplication::translate("QmlDesigner::TextToModelMerger error message", "No import statements found"));
errors.append(RewriterView::Error(diagnosticMessage, QUrl::fromLocalFile(doc->fileName())));
}
if (view()->checkSemanticErrors()) {
Check check(doc, m_lookupContext->context());
check.setOptions(check.options() & ~Check::ErrCheckTypeErrors);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment