diff options
author | Giuseppe D'Angelo <dangelog@gmail.com> | 2011-09-12 16:43:21 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-09-12 16:43:21 (GMT) |
commit | 434686a926a2a6e71f3cdea2508898b7800f7c81 (patch) | |
tree | 15d966c8912ba9caed32f57470d56ecacbb51c90 /src/network | |
parent | 6acb1a68962592e59cf2673de05661b39587c18c (diff) | |
download | Qt-434686a926a2a6e71f3cdea2508898b7800f7c81.zip Qt-434686a926a2a6e71f3cdea2508898b7800f7c81.tar.gz Qt-434686a926a2a6e71f3cdea2508898b7800f7c81.tar.bz2 |
Fix QNetworkReply::errorString returning an untranslated string
The QHttpNetworkConnectionPrivate::errorDetail is supposed to return a
translated string, which is then set as the QNetworkReply error.
The current code incorrectly uses QT_TRANSLATE_NOOP,
which mark the strings for translation, but does not translate them.
The result is that even with a translator loaded those strings are
written in English.
Fixes QTBUG-18382.
Merge-request: 2671
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 6101eea..4f2145e 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -48,6 +48,7 @@ #include <private/qauthenticator_p.h> #include <qnetworkproxy.h> #include <qauthenticator.h> +#include <qcoreapplication.h> #include <qbuffer.h> #include <qpair.h> @@ -665,32 +666,31 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e QString errorString; switch (errorCode) { case QNetworkReply::HostNotFoundError: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QHttp", "Host %1 not found")) - .arg(socket->peerName()); + errorString = QCoreApplication::translate("QHttp", "Host %1 not found").arg(socket->peerName()); break; case QNetworkReply::ConnectionRefusedError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection refused")); + errorString = QCoreApplication::translate("QHttp", "Connection refused"); break; case QNetworkReply::RemoteHostClosedError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection closed")); + errorString = QCoreApplication::translate("QHttp", "Connection closed"); break; case QNetworkReply::TimeoutError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Socket operation timed out")); + errorString = QCoreApplication::translate("QAbstractSocket", "Socket operation timed out"); break; case QNetworkReply::ProxyAuthenticationRequiredError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy requires authentication")); + errorString = QCoreApplication::translate("QHttp", "Proxy requires authentication"); break; case QNetworkReply::AuthenticationRequiredError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Host requires authentication")); + errorString = QCoreApplication::translate("QHttp", "Host requires authentication"); break; case QNetworkReply::ProtocolFailure: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Data corrupted")); + errorString = QCoreApplication::translate("QHttp", "Data corrupted"); break; case QNetworkReply::ProtocolUnknownError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown protocol specified")); + errorString = QCoreApplication::translate("QHttp", "Unknown protocol specified"); break; case QNetworkReply::SslHandshakeFailedError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "SSL handshake failed")); + errorString = QCoreApplication::translate("QHttp", "SSL handshake failed"); break; default: // all other errors are treated as QNetworkReply::UnknownNetworkError |