Commit 21dd4c8b authored by Friedemann Kleint's avatar Friedemann Kleint

QmlJS: Simplify code, fix MSVC-warning.

qmljsviewercontext.cpp:80: warning: C4715:
'QmlJS::ViewerContext::languageIsCompatible':
: not all control paths return a value.

Change-Id: I22279ef7a43873b9c8f3d73d3826b59d5abaa390
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 11807f0d
......@@ -58,25 +58,22 @@ bool ViewerContext::languageIsCompatible(Language::Enum l) const
{
switch (language) {
case Language::JavaScript:
return l == Language::JavaScript;
case Language::Json:
return l == Language::Json;
case Language::QmlProject:
case Language::QmlQbs:
case Language::QmlTypeInfo:
return language == l;
case Language::Qml:
return l == Language::Qml || l == Language::QmlQtQuick1 || l == Language::QmlQtQuick2
|| Language::JavaScript;
case Language::QmlProject:
return l == Language::QmlProject;
case Language::QmlQbs:
return l == Language::QmlQbs;
case Language::QmlQtQuick1:
return l == Language::Qml || l == Language::QmlQtQuick1 || Language::JavaScript;
case Language::QmlQtQuick2:
return l == Language::Qml || l == Language::QmlQtQuick2 || Language::JavaScript;
case Language::QmlTypeInfo:
return l == Language::QmlTypeInfo;
case Language::Unknown: // ?
return true;
break;
}
return true;
}
} // namespace QmlJS
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