summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-01-19 15:22:55 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-21 14:48:02 +0000
commit3aa737acc1698c61d8566749c1e7ab6d2bab83b6 (patch)
tree81cd645035c53d3979cb333d7ec3a3f5b7a38eed
parent205a46c9c07f801ba20616ac00338ae5c10013a7 (diff)
Mark QBluetoothServer::listen() overload with [[nodiscard]]
The results are intended to be stored as it is the only reference to the registered service. Task-number: QTBUG-100042 Change-Id: Ic8f939aeb9d4bb61a91106e456e3c80d9ace11c0 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 4bd126afaef1cafd42f8806651226e2b37325537) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/bluetooth/qbluetoothserver.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothserver.h b/src/bluetooth/qbluetoothserver.h
index fed57f82..0a13812b 100644
--- a/src/bluetooth/qbluetoothserver.h
+++ b/src/bluetooth/qbluetoothserver.h
@@ -76,7 +76,8 @@ public:
void close();
bool listen(const QBluetoothAddress &address = QBluetoothAddress(), quint16 port = 0);
- QBluetoothServiceInfo listen(const QBluetoothUuid &uuid, const QString &serviceName = QString());
+ [[nodiscard]] QBluetoothServiceInfo listen(const QBluetoothUuid &uuid,
+ const QString &serviceName = QString());
bool isListening() const;
void setMaxPendingConnections(int numConnections);