aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/CppDocument.cpp
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2011-03-03 11:55:48 +0100
committerChristian Kamm <[email protected]>2011-03-03 11:55:48 +0100
commitccb49b9873838afca2807b2532011ab989d0f007 (patch)
tree93e6be95efa1c960bf4439ea7542e5fb6cb94d95 /src/libs/cplusplus/CppDocument.cpp
parenta3c526f362dcc7db21b09360dea906826c8d8d96 (diff)
QmlJS: Disable possibly confusing warnings on qmlRegisterType.
Reviewed-by: Roberto Raggi Reviewed-by: Erik Verbruggen
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
-rw-r--r--src/libs/cplusplus/CppDocument.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp
index 63ee763b9bc..c6b75ee8a7b 100644
--- a/src/libs/cplusplus/CppDocument.cpp
+++ b/src/libs/cplusplus/CppDocument.cpp
@@ -659,8 +659,10 @@ protected:
if (StringLiteralAST *nameAst = ast->expression_list->next->next->next->value->asStringLiteral())
nameLit = translationUnit()->stringLiteral(nameAst->literal_token);
if (!nameLit) {
- translationUnit()->warning(ast->expression_list->next->next->next->value->firstToken(),
- "The type will only be available in Qt Creator's QML editors when the type name is a string literal");
+ // disable this warning for now, we don't want to encourage using string literals if they don't mean to
+ // in the future, we will also accept annotations for the qmlRegisterType arguments in comments
+// translationUnit()->warning(ast->expression_list->next->next->next->value->firstToken(),
+// "The type will only be available in Qt Creator's QML editors when the type name is a string literal");
return false;
}
@@ -700,9 +702,10 @@ protected:
exportedType.majorVersion = QString::fromUtf8(majorLit->chars(), majorLit->size()).toInt();
exportedType.minorVersion = QString::fromUtf8(minorLit->chars(), minorLit->size()).toInt();
} else {
- translationUnit()->warning(ast->base_expression->firstToken(),
- "The module will not be available in Qt Creator's QML editors because the uri and version numbers\n"
- "cannot be determined by static analysis. The type will still be available globally.");
+ // disable this warning, see above for details
+// translationUnit()->warning(ast->base_expression->firstToken(),
+// "The module will not be available in Qt Creator's QML editors because the uri and version numbers\n"
+// "cannot be determined by static analysis. The type will still be available globally.");
exportedType.packageName = QLatin1String("<default>");
}