From 382bf8f2c656e5cb52dbad4b5b66b75a2e941f5c Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Sat, 1 Apr 2017 21:13:15 -0700
Subject: [PATCH] Correct the use of QString::arg

It returns an updated QString, without modifying the variable it was
called on. Found by Clang when building:

qbluetoothsocket_bluez.cpp:255:17: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]

Change-Id: I27b55fdf514247549455fffd14b1795de236d488
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
---
 src/bluetooth/qbluetoothsocket_bluez.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp
index 803df6df..83d8c308 100644
--- a/src/bluetooth/qbluetoothsocket_bluez.cpp
+++ b/src/bluetooth/qbluetoothsocket_bluez.cpp
@@ -251,8 +251,8 @@ void QBluetoothSocketPrivate::_q_writeNotify()
                 break;
             default:
                 // every other case returns error
-                errorString = QBluetoothSocket::tr("Network Error: %1");
-                errorString.arg(qt_error_string(errno));
+                errorString = QBluetoothSocket::tr("Network Error: %1")
+                        .arg(qt_error_string(errno));
                 q->setSocketError(QBluetoothSocket::NetworkError);
                 break;
             }
@@ -507,8 +507,8 @@ qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize)
                 sz = 0;
                 break;
             default:
-                errorString = QBluetoothSocket::tr("Network Error: %1");
-                errorString.arg(qt_error_string(errno));
+                errorString = QBluetoothSocket::tr("Network Error: %1")
+                        .arg(qt_error_string(errno));
                 q->setSocketError(QBluetoothSocket::NetworkError);
             }
         }
-- 
GitLab