Commit 7ff7aefe authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlJS: Add special severity for loading type information



The designer has to be able to handle this error/warning
explicitly. To be able to identify the warning I added
a special severity.

Change-Id: I99571497f7327a7857244ef48334c14a254c8ca0
Reviewed-by: default avatarMarco Benelli <marco.benelli@qt.io>
parent 5afc149b
......@@ -56,11 +56,12 @@ enum Enum {
namespace Severity {
enum Enum
{
Hint, // cosmetic or convention
MaybeWarning, // possibly a warning, insufficient information
Warning, // could cause unintended behavior
MaybeError, // possibly an error, insufficient information
Error // definitely an error
Hint, // cosmetic or convention
MaybeWarning, // possibly a warning, insufficient information
Warning, // could cause unintended behavior
ReadingTypeInfoWarning, // currently dumping type information
MaybeError, // possibly an error, insufficient information
Error // definitely an error
};
}
......
......@@ -453,8 +453,9 @@ bool LinkPrivate::importLibrary(Document::Ptr doc,
}
}
if (errorLoc.isValid()) {
warning(doc, errorLoc,
Link::tr("QML module contains C++ plugins, currently reading type information..."));
appendDiagnostic(doc, DiagnosticMessage(Severity::ReadingTypeInfoWarning,
errorLoc,
Link::tr("QML module contains C++ plugins, currently reading type information...")));
import->valid = false;
}
} else if (libraryInfo.pluginTypeInfoStatus() == LibraryInfo::DumpError
......
......@@ -436,7 +436,9 @@ protected:
const TextEditor::FontSettings &fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
QTextCharFormat format;
if (d.severity == Severity::Warning || d.severity == Severity::MaybeWarning) {
if (d.severity == Severity::Warning
|| d.severity == Severity::MaybeWarning
|| d.severity == Severity::ReadingTypeInfoWarning) {
format = fontSettings.toTextCharFormat(TextEditor::C_WARNING);
} else if (d.severity == Severity::Error || d.severity == Severity::MaybeError) {
format = fontSettings.toTextCharFormat(TextEditor::C_ERROR);
......
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