forked from qt-creator/qt-creator
QmlJS: Turn ErrDoNotMixTranslationFunctionsInQmlUi into a warning
Task-number: QDS-10548 Task-number: QDS-7597 Change-Id: I785fbf0f47f0753b257ef5fae1c3bf4afa9b416f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -675,7 +675,7 @@ QList<StaticAnalysis::Type> Check::defaultDisabledMessagesForNonQuickUi()
|
||||
ErrBehavioursNotSupportedInQmlUi,
|
||||
ErrStatesOnlyInRootItemInQmlUi,
|
||||
ErrReferenceToParentItemNotSupportedInQmlUi,
|
||||
ErrDoNotMixTranslationFunctionsInQmlUi,
|
||||
WarnDoNotMixTranslationFunctionsInQmlUi,
|
||||
});
|
||||
return disabled;
|
||||
}
|
||||
@@ -774,7 +774,7 @@ void Check::enableQmlDesignerUiFileChecks()
|
||||
enableMessage(ErrBehavioursNotSupportedInQmlUi);
|
||||
enableMessage(ErrStatesOnlyInRootItemInQmlUi);
|
||||
enableMessage(ErrReferenceToParentItemNotSupportedInQmlUi);
|
||||
enableMessage(ErrDoNotMixTranslationFunctionsInQmlUi);
|
||||
enableMessage(WarnDoNotMixTranslationFunctionsInQmlUi);
|
||||
}
|
||||
|
||||
void Check::disableQmlDesignerUiFileChecks()
|
||||
@@ -786,7 +786,7 @@ void Check::disableQmlDesignerUiFileChecks()
|
||||
disableMessage(ErrBehavioursNotSupportedInQmlUi);
|
||||
disableMessage(ErrStatesOnlyInRootItemInQmlUi);
|
||||
disableMessage(ErrReferenceToParentItemNotSupportedInQmlUi);
|
||||
disableMessage(ErrDoNotMixTranslationFunctionsInQmlUi);
|
||||
disableMessage(WarnDoNotMixTranslationFunctionsInQmlUi);
|
||||
}
|
||||
|
||||
bool Check::preVisit(Node *ast)
|
||||
@@ -1937,7 +1937,7 @@ bool Check::visit(CallExpression *ast)
|
||||
|
||||
if (lastTransLationfunction != noTranslationfunction
|
||||
&& lastTransLationfunction != translationFunction)
|
||||
addMessage(ErrDoNotMixTranslationFunctionsInQmlUi, location);
|
||||
addMessage(WarnDoNotMixTranslationFunctionsInQmlUi, location);
|
||||
|
||||
lastTransLationfunction = translationFunction;
|
||||
}
|
||||
|
@@ -218,7 +218,8 @@ StaticAnalysisMessages::StaticAnalysisMessages()
|
||||
Tr::tr("States are only supported in the root item in a UI file (.ui.qml)."));
|
||||
newMsg(ErrReferenceToParentItemNotSupportedInQmlUi, Error,
|
||||
Tr::tr("Referencing the parent of the root item is not supported in a UI file (.ui.qml)."));
|
||||
newMsg(ErrDoNotMixTranslationFunctionsInQmlUi, Error,
|
||||
newMsg(WarnDoNotMixTranslationFunctionsInQmlUi,
|
||||
Warning,
|
||||
Tr::tr("Do not mix translation functions in a UI file (.ui.qml)."));
|
||||
newMsg(StateCannotHaveChildItem, Error,
|
||||
Tr::tr("A State cannot have a child item (%1)."), 1);
|
||||
|
@@ -83,7 +83,7 @@ enum Type {
|
||||
ErrBehavioursNotSupportedInQmlUi = 224,
|
||||
ErrStatesOnlyInRootItemInQmlUi = 225,
|
||||
ErrReferenceToParentItemNotSupportedInQmlUi = 226,
|
||||
ErrDoNotMixTranslationFunctionsInQmlUi = 227,
|
||||
WarnDoNotMixTranslationFunctionsInQmlUi = 227,
|
||||
ErrUnknownComponent = 300,
|
||||
ErrCouldNotResolvePrototypeOf = 301,
|
||||
ErrCouldNotResolvePrototype = 302,
|
||||
|
Reference in New Issue
Block a user