diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-12-13 16:17:43 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-12-13 16:20:26 +0100 |
commit | 948c7af9f202cac2fc02679172acb069ca61bfcd (patch) | |
tree | 16b46e6bcc51ee8b3ed7f017d967f8d33671aae5 /src/libs | |
parent | 0d08db21891e5b647c108a2ad8e955e13f84ceaf (diff) | |
download | qt-creator-948c7af9f202cac2fc02679172acb069ca61bfcd.tar.gz |
tr()-Fixes.
- Capitalization
- Fix lupdate warnings about tr() Usage in ZeroConf
- Fix some messages.
Change-Id: I95e4095ce54040e30d9a7968407bfc99b76643ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/qmljs/qmljsstaticanalysismessage.cpp | 17 | ||||
-rw-r--r-- | src/libs/zeroconf/avahiLib.cpp | 15 | ||||
-rw-r--r-- | src/libs/zeroconf/embeddedLib.cpp | 2 | ||||
-rw-r--r-- | src/libs/zeroconf/servicebrowser_p.h | 2 |
4 files changed, 21 insertions, 15 deletions
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp index bd66fc76f6..c5b23cae63 100644 --- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp +++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp @@ -70,6 +70,11 @@ public: QHash<Type, PrototypeMessageData> messages; }; +static inline QString msgInvalidConstructor(const char *what) +{ + return StaticAnalysisMessages::tr("do not use '%1' as a constructor").arg(QLatin1String(what)); +} + StaticAnalysisMessages::StaticAnalysisMessages() { // When changing a message or severity, update the documentation, currently @@ -133,15 +138,15 @@ StaticAnalysisMessages::StaticAnalysisMessages() newMsg(WarnFunctionUsedBeforeDeclaration, Warning, tr("function '%1' is used before its declaration"), 1); newMsg(WarnBooleanConstructor, Warning, - tr("do not use 'Boolean' as a constructor")); + msgInvalidConstructor("Boolean")); newMsg(WarnStringConstructor, Warning, - tr("do not use 'String' as a constructor")); + msgInvalidConstructor("String")); newMsg(WarnObjectConstructor, Warning, - tr("do not use 'Object' as a constructor")); + msgInvalidConstructor("Object")); newMsg(WarnArrayConstructor, Warning, - tr("do not use 'Array' as a constructor")); + msgInvalidConstructor("Array")); newMsg(WarnFunctionConstructor, Warning, - tr("do not use 'Function' as a constructor")); + msgInvalidConstructor("Function")); newMsg(HintAnonymousFunctionSpacing, Hint, tr("the 'function' keyword and the opening parenthesis should be separated by a single space")); newMsg(WarnBlock, Warning, @@ -181,7 +186,7 @@ StaticAnalysisMessages::StaticAnalysisMessages() newMsg(WarnNewWithLowercaseFunction, Warning, tr("'new' should only be used with functions that start with an uppercase letter")); newMsg(WarnNumberConstructor, Warning, - tr("do not use 'Number' as a constructor")); + msgInvalidConstructor("Function")); newMsg(HintBinaryOperatorSpacing, Hint, tr("use spaces around binary operators")); newMsg(WarnUnintentinalEmptyBlock, Warning, diff --git a/src/libs/zeroconf/avahiLib.cpp b/src/libs/zeroconf/avahiLib.cpp index 5177db352e..bdb5469eed 100644 --- a/src/libs/zeroconf/avahiLib.cpp +++ b/src/libs/zeroconf/avahiLib.cpp @@ -129,7 +129,8 @@ public: #ifndef ZCONF_AVAHI_STATIC_LINKING // dynamic linking if (!nativeLib.load()) { - setError(true, tr("AvahiZConfLib could not load native library")); + setError(true, + ZConfLib::tr("AvahiZConfLib could not load the native library '%1': %2").arg(libName, nativeLib.errorString())); } m_simplePollGet = reinterpret_cast<AvahiSimplePollGet>(nativeLib.resolve("avahi_simple_poll_get")); m_simplePollNew = reinterpret_cast<AvahiSimplePollNewPtr>(nativeLib.resolve("avahi_simple_poll_new")); @@ -316,7 +317,7 @@ public: if (m_simplePollFree) m_simplePollFree(connection->simple_poll); delete connection; - setError(true, tr("%1 could not create a client (probably the daemon is not running)")); + setError(true, ZConfLib::tr("%1 could not create a client (probably the daemon is not running)").arg(name())); return kDNSServiceErr_Unknown; } *sdRef = reinterpret_cast<ConnectionRef>(connection); @@ -440,16 +441,16 @@ extern "C" void cAvahiClientReply (AvahiClient * /*s*/, AvahiClientState state, break; case (AVAHI_CLIENT_S_COLLISION): /* Server state: COLLISION */ - lib->setError(true, lib->tr("cAvahiClient, server collision")); + lib->setError(true, ZConfLib::tr("cAvahiClient, server collision")); break; case (AVAHI_CLIENT_FAILURE): - lib->setError(true, lib->tr("cAvahiClient, some kind of error happened on the client side")); + lib->setError(true, ZConfLib::tr("cAvahiClient, some kind of error happened on the client side")); break; case (AVAHI_CLIENT_CONNECTING): - lib->setError(false, lib->tr("cAvahiClient, still connecting, no server available")); + lib->setError(false, ZConfLib::tr("cAvahiClient, still connecting, no server available")); break; default: - lib->setError(true, lib->tr("Error: unexpected state %1 in cAvahiClientReply, ignoring it") + lib->setError(true, ZConfLib::tr("Error: unexpected state %1 in cAvahiClientReply, ignoring it") .arg(state)); } } @@ -484,7 +485,7 @@ extern "C" void cAvahiBrowseReply( browser->updateFlowStatusForFlags(0); break; default: - browser->mainConnection->lib->setError(true, browser->mainConnection->lib->tr( + browser->mainConnection->lib->setError(true, ZConfLib::tr( "Error: unexpected state %1 in cAvahiBrowseReply, ignoring it") .arg(event)); } diff --git a/src/libs/zeroconf/embeddedLib.cpp b/src/libs/zeroconf/embeddedLib.cpp index c7e13ecdc2..f2a2145b52 100644 --- a/src/libs/zeroconf/embeddedLib.cpp +++ b/src/libs/zeroconf/embeddedLib.cpp @@ -85,7 +85,7 @@ public: qDebug() << name() << " started " << daemonPath; return true; } else { - this->setError(true, tr("%1 failed starting embedded daemon at %2") + this->setError(true, ZConfLib::tr("%1 failed starting embedded daemon at %2") .arg(name()).arg(daemonPath)); } } diff --git a/src/libs/zeroconf/servicebrowser_p.h b/src/libs/zeroconf/servicebrowser_p.h index bcf2389517..a8712f7ba6 100644 --- a/src/libs/zeroconf/servicebrowser_p.h +++ b/src/libs/zeroconf/servicebrowser_p.h @@ -56,7 +56,7 @@ class ServiceBrowserPrivate; // represents a zero conf library exposing the dns-sd interface class ZConfLib { - Q_DECLARE_TR_FUNCTIONS(ZeroConf) + Q_DECLARE_TR_FUNCTIONS(ZeroConf::Internal::ZConfLib) public: typedef QSharedPointer<ZConfLib> Ptr; typedef void *ConnectionRef; |