diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-01-07 13:32:02 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-01-10 12:54:53 +0100 |
commit | 0de6c26ac17c90f513329fdbe87ef036fc25925a (patch) | |
tree | 34073f867f729cc49eed8c20835e188b5083eae8 /tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | |
parent | 94b3dd77f29a00ebbd1efdc66d75f57e1c75b152 (diff) |
QLocalSocket - deprecate ambiguous 'error' overloads
QLocalSocket::error is overloaded as a signal and an accessor (for the
error reported by the signal). This means connecting to the signal using
a pointer to member function would require ambiguity resolution. We
deprecate the old accessor (to be removed in Qt 6) and introduce a new one -
'socketError'.
[ChangeLog][Deprecation Notice] QLocalSocket::error() (the getter) is deprecated; superseded by socketError().
Task-number: QTBUG-80369
Change-Id: Iab346f7b4cd1024dee9e5ef71b4b7e09f6d95b12
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp')
-rw-r--r-- | tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 732f7eef00..0c1536bd59 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -195,7 +195,7 @@ private slots: void slotError(QLocalSocket::LocalSocketError newError) { QVERIFY(errorString() != QLatin1String("Unknown error")); - QCOMPARE(error(), newError); + QCOMPARE(socketError(), newError); } void slotStateChanged(QLocalSocket::LocalSocketState newState) { @@ -256,7 +256,7 @@ void tst_QLocalSocket::socket_basic() QCOMPARE(socket.canReadLine(), false); socket.close(); socket.disconnectFromServer(); - QCOMPARE(QLocalSocket::UnknownSocketError, socket.error()); + QCOMPARE(QLocalSocket::UnknownSocketError, socket.socketError()); QVERIFY(!socket.errorString().isEmpty()); QCOMPARE(socket.flush(), false); QCOMPARE(socket.isValid(), false); @@ -375,13 +375,13 @@ void tst_QLocalSocket::listenAndConnect() QVERIFY(socket->waitForConnected()); QVERIFY(socket->isValid()); QCOMPARE(socket->errorString(), QString("Unknown error")); - QCOMPARE(socket->error(), QLocalSocket::UnknownSocketError); + QCOMPARE(socket->socketError(), QLocalSocket::UnknownSocketError); QCOMPARE(socket->state(), QLocalSocket::ConnectedState); //QVERIFY(socket->socketDescriptor() != -1); QCOMPARE(spyError.count(), 0); } else { QVERIFY(!socket->errorString().isEmpty()); - QVERIFY(socket->error() != QLocalSocket::UnknownSocketError); + QVERIFY(socket->socketError() != QLocalSocket::UnknownSocketError); QCOMPARE(socket->state(), QLocalSocket::UnconnectedState); //QCOMPARE(socket->socketDescriptor(), -1); QCOMPARE(qvariant_cast<QLocalSocket::LocalSocketError>(spyError.first()[0]), |