summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/serialbus/modbus/master/mainwindow.cpp8
-rw-r--r--src/serialbus/qmodbusreply.cpp2
-rw-r--r--src/serialbus/qmodbusreply.h2
-rw-r--r--tests/auto/qmodbusreply/tst_qmodbusreply.cpp20
4 files changed, 16 insertions, 16 deletions
diff --git a/examples/serialbus/modbus/master/mainwindow.cpp b/examples/serialbus/modbus/master/mainwindow.cpp
index 1fb8ee5..d30ddbe 100644
--- a/examples/serialbus/modbus/master/mainwindow.cpp
+++ b/examples/serialbus/modbus/master/mainwindow.cpp
@@ -271,11 +271,11 @@ void MainWindow::readReady()
}
} else if (reply->error() == QModbusReply::ProtocolError) {
statusBar()->showMessage(tr("Read response error: %1 (Mobus exception: 0x%2)").
- arg(reply->errorText()).
+ arg(reply->errorString()).
arg(reply->rawResult().exceptionCode(), -1, 16), 5000);
} else {
statusBar()->showMessage(tr("Read response error: %1 (code: 0x%2)").
- arg(reply->errorText()).
+ arg(reply->errorString()).
arg(reply->error(), -1, 16), 5000);
}
@@ -330,11 +330,11 @@ void MainWindow::writeReady()
if (reply->error() == QModbusReply::ProtocolError) {
statusBar()->showMessage(tr("Write response error: %1 (Mobus exception: 0x%2)").
- arg(reply->errorText()).
+ arg(reply->errorString()).
arg(reply->rawResult().exceptionCode(), -1, 16), 5000);
} else if (reply->error() != QModbusReply::NoError) {
statusBar()->showMessage(tr("Write response error: %1 (code: 0x%2)").
- arg(reply->errorText()).
+ arg(reply->errorString()).
arg(reply->error(), -1, 16), 5000);
}
diff --git a/src/serialbus/qmodbusreply.cpp b/src/serialbus/qmodbusreply.cpp
index 3723f38..3debc84 100644
--- a/src/serialbus/qmodbusreply.cpp
+++ b/src/serialbus/qmodbusreply.cpp
@@ -240,7 +240,7 @@ void QModbusReply::setError(QModbusReply::ReplyError error, const QString &error
\sa error(), errorOccurred()
*/
-QString QModbusReply::errorText() const
+QString QModbusReply::errorString() const
{
Q_D(const QModbusReply);
return d->m_errorText;
diff --git a/src/serialbus/qmodbusreply.h b/src/serialbus/qmodbusreply.h
index cb63408..d9d709c 100644
--- a/src/serialbus/qmodbusreply.h
+++ b/src/serialbus/qmodbusreply.h
@@ -78,7 +78,7 @@ public:
QModbusResponse rawResult() const;
ReplyError error() const;
- QString errorText() const;
+ QString errorString() const;
void setResult(const QModbusDataUnit &unit);
void setRawResult(const QModbusResponse &unit);
diff --git a/tests/auto/qmodbusreply/tst_qmodbusreply.cpp b/tests/auto/qmodbusreply/tst_qmodbusreply.cpp
index 2259186..0967697 100644
--- a/tests/auto/qmodbusreply/tst_qmodbusreply.cpp
+++ b/tests/auto/qmodbusreply/tst_qmodbusreply.cpp
@@ -57,7 +57,7 @@ void tst_QModbusReply::tst_ctor()
QCOMPARE(r.isFinished(), false);
QCOMPARE(r.result().isValid(), false);
QCOMPARE(r.rawResult().isValid(), false);
- QCOMPARE(r.errorText(), QString());
+ QCOMPARE(r.errorString(), QString());
QCOMPARE(r.error(), QModbusReply::NoError);
QModbusReply r2(QModbusReply::Raw, 2, this);
@@ -66,7 +66,7 @@ void tst_QModbusReply::tst_ctor()
QCOMPARE(r2.isFinished(), false);
QCOMPARE(r2.result().isValid(), false);
QCOMPARE(r2.rawResult().isValid(), false);
- QCOMPARE(r2.errorText(), QString());
+ QCOMPARE(r2.errorString(), QString());
QCOMPARE(r2.error(), QModbusReply::NoError);
}
@@ -81,7 +81,7 @@ void tst_QModbusReply::tst_setFinished()
QCOMPARE(replyTest.isFinished(), false);
QCOMPARE(replyTest.result().isValid(), false);
QCOMPARE(replyTest.rawResult().isValid(), false);
- QCOMPARE(replyTest.errorText(), QString());
+ QCOMPARE(replyTest.errorString(), QString());
QCOMPARE(replyTest.error(), QModbusReply::NoError);
QVERIFY(finishedSpy.isEmpty());
@@ -94,7 +94,7 @@ void tst_QModbusReply::tst_setFinished()
QCOMPARE(replyTest.isFinished(), true);
QCOMPARE(replyTest.result().isValid(), false);
QCOMPARE(replyTest.rawResult().isValid(), false);
- QCOMPARE(replyTest.errorText(), QString());
+ QCOMPARE(replyTest.errorString(), QString());
QCOMPARE(replyTest.error(), QModbusReply::NoError);
replyTest.setFinished(false);
@@ -104,14 +104,14 @@ void tst_QModbusReply::tst_setFinished()
QCOMPARE(replyTest.isFinished(), false);
QCOMPARE(replyTest.result().isValid(), false);
QCOMPARE(replyTest.rawResult().isValid(), false);
- QCOMPARE(replyTest.errorText(), QString());
+ QCOMPARE(replyTest.errorString(), QString());
QCOMPARE(replyTest.error(), QModbusReply::NoError);
}
void tst_QModbusReply::tst_setError_data()
{
QTest::addColumn<QModbusReply::ReplyError>("error");
- QTest::addColumn<QString>("errorText");
+ QTest::addColumn<QString>("errorString");
QTest::newRow("ProtocolError") << QModbusReply::ProtocolError << QString("ProtocolError");
QTest::newRow("NoError") << QModbusReply::NoError << QString("NoError");
@@ -123,7 +123,7 @@ void tst_QModbusReply::tst_setError_data()
void tst_QModbusReply::tst_setError()
{
QFETCH(QModbusReply::ReplyError, error);
- QFETCH(QString, errorText);
+ QFETCH(QString, errorString);
QModbusReply replyTest(QModbusReply::Common, 1);
QCOMPARE(replyTest.serverAddress(), 1);
@@ -133,15 +133,15 @@ void tst_QModbusReply::tst_setError()
QVERIFY(finishedSpy.isEmpty());
QVERIFY(errorSpy.isEmpty());
- replyTest.setError(error, errorText);
+ replyTest.setError(error, errorString);
QCOMPARE(finishedSpy.count(), 1);
QCOMPARE(errorSpy.count(), 1);
QCOMPARE(replyTest.rawResult().isValid(), false);
QCOMPARE(replyTest.error(), error);
- QCOMPARE(replyTest.errorText(), errorText);
+ QCOMPARE(replyTest.errorString(), errorString);
QCOMPARE(errorSpy.at(0).at(0).value<QModbusReply::ReplyError>(), error);
- replyTest.setError(error, errorText);
+ replyTest.setError(error, errorString);
replyTest.setFinished(true);
QCOMPARE(finishedSpy.count(), 3); //setError() implies call to setFinished()
QCOMPARE(errorSpy.count(), 2);