From 4b344fd9f4eec8cb4271f38e8dfdc88905375e66 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 24 Feb 2010 15:43:12 +0100 Subject: Remove QObject::tr() in the network module code. --- src/network/access/qnetworkaccessdatabackend.cpp | 7 +++++-- src/network/access/qnetworkaccessdebugpipebackend.cpp | 4 ++-- src/network/access/qnetworkreplyimpl.cpp | 2 +- src/network/kernel/qhostinfo.cpp | 2 +- src/network/kernel/qhostinfo_unix.cpp | 4 +++- src/plugins/bearer/icd/qnetworksession_impl.cpp | 6 +++--- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/network/access/qnetworkaccessdatabackend.cpp b/src/network/access/qnetworkaccessdatabackend.cpp index a2e7ef5..efb6e3e 100644 --- a/src/network/access/qnetworkaccessdatabackend.cpp +++ b/src/network/access/qnetworkaccessdatabackend.cpp @@ -44,6 +44,7 @@ #include "qnetworkreply.h" #include "qurlinfo.h" #include "private/qdataurl_p.h" +#include QT_BEGIN_NAMESPACE @@ -72,7 +73,8 @@ void QNetworkAccessDataBackend::open() if (operation() != QNetworkAccessManager::GetOperation && operation() != QNetworkAccessManager::HeadOperation) { // data: doesn't support anything but GET - QString msg = QObject::tr("Operation not supported on %1") + const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", + "Operation not supported on %1") .arg(uri.toString()); error(QNetworkReply::ContentOperationNotPermittedError, msg); finished(); @@ -96,7 +98,8 @@ void QNetworkAccessDataBackend::open() } // something wrong with this URI - QString msg = QObject::tr("Invalid URI: %1").arg(uri.toString()); + const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", + "Invalid URI: %1").arg(uri.toString()); error(QNetworkReply::ProtocolFailure, msg); finished(); } diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index 5926d0b..cd077e7 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -252,7 +252,7 @@ void QNetworkAccessDebugPipeBackend::socketError() break; } - error(code, QObject::tr("Socket error on %1: %2") + error(code, QNetworkAccessDebugPipeBackend::tr("Socket error on %1: %2") .arg(url().toString(), socket.errorString())); finished(); disconnect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); @@ -267,7 +267,7 @@ void QNetworkAccessDebugPipeBackend::socketDisconnected() // normal close } else { // abnormal close - QString msg = QObject::tr("Remote host closed the connection prematurely on %1") + QString msg = QNetworkAccessDebugPipeBackend::tr("Remote host closed the connection prematurely on %1") .arg(url().toString()); error(QNetworkReply::RemoteHostClosedError, msg); finished(); diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 2175686..b201380 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -565,7 +565,7 @@ void QNetworkReplyImplPrivate::finished() } } else { error(QNetworkReply::TemporaryNetworkFailureError, - q->tr("Temporary network failure.")); + QNetworkReply::tr("Temporary network failure.")); } } } diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 9de499e..93f6d13 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -165,7 +165,7 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, if (name.isEmpty()) { QHostInfo hostInfo(id); hostInfo.setError(QHostInfo::HostNotFound); - hostInfo.setErrorString(QObject::tr("No host name given")); + hostInfo.setErrorString(QCoreApplication::translate("QHostInfo", "No host name given")); QScopedPointer result(new QHostInfoResult); QObject::connect(result.data(), SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index be06b6e..a186e78 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -193,7 +193,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) results.setHostName(hostName); if (aceHostname.isEmpty()) { results.setError(QHostInfo::HostNotFound); - results.setErrorString(hostName.isEmpty() ? QObject::tr("No host name given") : QObject::tr("Invalid hostname")); + results.setErrorString(hostName.isEmpty() ? + QCoreApplication::translate("QHostInfoAgent", "No host name given") : + QCoreApplication::translate("QHostInfoAgent", "Invalid hostname")); return results; } diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index a9e93e0..e7c56a2 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -1080,14 +1080,14 @@ QString QNetworkSessionPrivateImpl::errorString() const QString errorStr; switch(q->error()) { case QNetworkSession::RoamingError: - errorStr = QObject::tr("Roaming error"); + errorStr = QNetworkSessionPrivateImpl::tr("Roaming error"); break; case QNetworkSession::SessionAbortedError: - errorStr = QObject::tr("Session aborted by user or system"); + errorStr = QNetworkSessionPrivateImpl::tr("Session aborted by user or system"); break; default: case QNetworkSession::UnknownSessionError: - errorStr = QObject::tr("Unidentified Error"); + errorStr = QNetworkSessionPrivateImpl::tr("Unidentified Error"); break; } return errorStr; -- cgit v0.12