summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothsocket_osx.mm
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-05 12:22:22 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-06 11:32:30 +0000
commit6b2fd04b7be4494767b6092a030607010d91310c (patch)
tree229f5faf260ddb52c6129806956496c82eebbb00 /src/bluetooth/qbluetoothsocket_osx.mm
parent0c626f290111a0dfed2e0faae98afb1b0ad9943c (diff)
Shift all OSX & iOS translations into C++ filev5.5.0-alpha1
lupdate cannot parse .mm files. Therefore tr markup must be inside of C++ files. Some error strings where slightly modified to make use of already existing translations for other backends such as Bluez and QNX. Change-Id: I97fe6cfe2227e32fdbc61edd253080a1cd68edc9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_osx.mm')
-rw-r--r--src/bluetooth/qbluetoothsocket_osx.mm17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm
index 2472cbee..62883247 100644
--- a/src/bluetooth/qbluetoothsocket_osx.mm
+++ b/src/bluetooth/qbluetoothsocket_osx.mm
@@ -42,6 +42,7 @@
#include "qbluetoothlocaldevice.h"
#include "qbluetoothdeviceinfo.h"
#include "osx/osxbtutility_p.h"
+#include "osx/uistrings_p.h"
#include "qbluetoothsocket.h"
#include <QtCore/qloggingcategory.h>
@@ -250,7 +251,7 @@ void QBluetoothSocketPrivate::_q_writeNotify()
status = [l2capChannel writeAsync:writeChunk.data() length:UInt16(size)];
if (status != kIOReturnSuccess) {
- errorString = QBluetoothSocket::tr("Network Error");
+ errorString = QCoreApplication::translate(SOCKET, SOC_NETWORK_ERROR);
q_ptr->setSocketError(QBluetoothSocket::NetworkError);
return;
} else {
@@ -386,7 +387,7 @@ qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize)
Q_ASSERT_X(maxSize > 0, Q_FUNC_INFO, "invalid data size");
if (state != QBluetoothSocket::ConnectedState) {
- errorString = tr("Cannot write while not connected");
+ errorString = QCoreApplication::translate(SOCKET, SOC_NOWRITE);
q_ptr->setSocketError(QBluetoothSocket::OperationError);
return -1;
}
@@ -445,7 +446,7 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op
{
if (state() != UnconnectedState && state() != ServiceLookupState) {
qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "called on a busy socket";
- d_ptr->errorString = tr("Trying to connect while connection is in progress");
+ d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_CONNECT_IN_PROGRESS);
setSocketError(OperationError);
return;
}
@@ -474,7 +475,7 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, const
{
if (state() != QBluetoothSocket::UnconnectedState) {
qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "called on a busy socket";
- d_ptr->errorString = tr("Trying to connect while connection is in progress");
+ d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_CONNECT_IN_PROGRESS);
setSocketError(QBluetoothSocket::OperationError);
return;
}
@@ -491,7 +492,7 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, quint1
{
if (state() != QBluetoothSocket::UnconnectedState) {
qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "called on a busy socket";
- d_ptr->errorString = tr("Trying to connect while connection is in progress");
+ d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_CONNECT_IN_PROGRESS);
setSocketError(OperationError);
return;
}
@@ -585,7 +586,7 @@ void QBluetoothSocket::serviceDiscovered(const QBluetoothServiceInfo &service)
void QBluetoothSocket::discoveryFinished()
{
- d_ptr->errorString = tr("Service cannot be found");
+ d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_SERVICE_NOT_FOUND);
setSocketState(UnconnectedState);
setSocketError(ServiceNotFoundError);
}
@@ -642,7 +643,7 @@ quint16 QBluetoothSocket::peerPort() const
qint64 QBluetoothSocket::writeData(const char *data, qint64 maxSize)
{
if (!data || maxSize <= 0) {
- d_ptr->errorString = tr("Invalid data/data size");
+ d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_INVAL_DATASIZE);
setSocketError(QBluetoothSocket::OperationError);
return -1;
}
@@ -653,7 +654,7 @@ qint64 QBluetoothSocket::writeData(const char *data, qint64 maxSize)
qint64 QBluetoothSocketPrivate::readData(char *data, qint64 maxSize)
{
if (state != QBluetoothSocket::ConnectedState) {
- errorString = tr("Cannot read while not connected");
+ errorString = QCoreApplication::translate(SOCKET, SOC_NOREAD);
q_ptr->setSocketError(QBluetoothSocket::OperationError);
return -1;
}