diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-02-04 16:43:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-06 09:31:25 +0100 |
commit | c0ec84946d13e4693160e859c947696e92ef615b (patch) | |
tree | f1b25f4701b26399d0faeb3166158e0441634660 /src | |
parent | 06fad3e877530eadb33d20dbf3f88c2b18c2851f (diff) |
Fix lupdate-warning in qqmlrewrite.cpp.
Class 'QQmlRewrite' lacks Q_OBJECT macro.
Replace global-static strings by message functions.
Change-Id: I67a6fbe67575533d3ce5750d72c9d7eff06e7efa
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlrewrite.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlrewrite.cpp b/src/qml/qml/qqmlrewrite.cpp index 0913a8c224..0e281428ed 100644 --- a/src/qml/qml/qqmlrewrite.cpp +++ b/src/qml/qml/qqmlrewrite.cpp @@ -44,6 +44,7 @@ #include <private/qqmlglobal_p.h> #include <QtCore/qdebug.h> +#include <QtCore/qcoreapplication.h> QT_BEGIN_NAMESPACE @@ -513,8 +514,15 @@ bool RewriteSignalHandler::visit(AST::IdentifierExpression *e) return false; } -static QString unnamed_error_string(QLatin1String(QT_TR_NOOP("Signal uses unnamed parameter followed by named parameter."))); -static QString global_error_string(QLatin1String(QT_TR_NOOP("Signal parameter \"%1\" hides global variable."))); +static inline QString msgUnnamedErrorString() +{ + return QCoreApplication::translate("QQmlRewrite", "Signal uses unnamed parameter followed by named parameter."); +} + +static inline QString msgGlobalErrorString(const QString &p) +{ + return QCoreApplication::translate("QQmlRewrite", "Signal parameter \"%1\" hides global variable.").arg(p); +} #define EXIT_ON_ERROR(error) \ { \ @@ -543,9 +551,9 @@ QString RewriteSignalHandler::createParameterString(const QList<QHashedString> & if (param.isEmpty()) unnamedParam = true; else if (unnamedParam) - EXIT_ON_ERROR(unnamed_error_string) + EXIT_ON_ERROR(msgUnnamedErrorString()) else if (illegalNames.contains(param)) - EXIT_ON_ERROR(global_error_string.arg(param)) + EXIT_ON_ERROR(msgGlobalErrorString(param)) ++_parameterCountForJS; parameters += param; if (i < parameterNameList.count()-1) |