diff options
author | Laszlo Papp <lpapp@kde.org> | 2014-03-07 03:11:36 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 07:53:57 +0100 |
commit | bc0a65234440b6a08d862840a48ebae0d3421fbc (patch) | |
tree | 4a26818059a742525c75f5ce4b26f792468e957d | |
parent | 0904f76a6afceca067caf287bd9734678d6d5df1 (diff) | |
download | qtserialport-bc0a65234440b6a08d862840a48ebae0d3421fbc.tar.gz |
Obsolete the "settings restore on close" API
Now that the settings detection is removed, it would be better to make this API
deprecate because it does not make much sense anymore. It was a bad idea to add
this, but we cannot remove it for now, hence the obsoletion.
Change-Id: I5e02959cb54281995b911ff0f64bd2fa36b80060
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r-- | src/serialport/qserialport.cpp | 1 | ||||
-rw-r--r-- | src/serialport/qserialport.h | 7 | ||||
-rw-r--r-- | tests/auto/qserialport/tst_qserialport.cpp | 1 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index 040b7ef..6508940 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -568,6 +568,7 @@ void QSerialPort::close() \property QSerialPort::settingsRestoredOnClose \brief the flag which specifies to restore the previous settings when closing the serial port. + \obsolete If this flag is true, the settings will be restored; otherwise not. The default state of the QSerialPort class is to restore the diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h index fb77e81..6ca5af4 100644 --- a/src/serialport/qserialport.h +++ b/src/serialport/qserialport.h @@ -64,11 +64,11 @@ class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice Q_PROPERTY(FlowControl flowControl READ flowControl WRITE setFlowControl NOTIFY flowControlChanged) #if QT_DEPRECATED_SINCE(5, 2) Q_PROPERTY(DataErrorPolicy dataErrorPolicy READ dataErrorPolicy WRITE setDataErrorPolicy NOTIFY dataErrorPolicyChanged) + Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged) #endif Q_PROPERTY(bool dataTerminalReady READ isDataTerminalReady WRITE setDataTerminalReady NOTIFY dataTerminalReadyChanged) Q_PROPERTY(bool requestToSend READ isRequestToSend WRITE setRequestToSend NOTIFY requestToSendChanged) Q_PROPERTY(SerialPortError error READ error RESET clearError NOTIFY error) - Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged) Q_ENUMS(BaudRate DataBits Parity StopBits FlowControl DataErrorPolicy SerialPortError) Q_FLAGS(Directions PinoutSignals) @@ -198,9 +198,6 @@ public: bool open(OpenMode mode) Q_DECL_OVERRIDE; void close() Q_DECL_OVERRIDE; - void setSettingsRestoredOnClose(bool restore); - bool settingsRestoredOnClose() const; - bool setBaudRate(qint32 baudRate, Directions directions = AllDirections); qint32 baudRate(Directions directions = AllDirections) const; @@ -231,6 +228,8 @@ public: #if QT_DEPRECATED_SINCE(5, 2) QT_DEPRECATED bool setDataErrorPolicy(DataErrorPolicy policy = IgnorePolicy); QT_DEPRECATED DataErrorPolicy dataErrorPolicy() const; + void setSettingsRestoredOnClose(bool restore); + bool settingsRestoredOnClose() const; #endif SerialPortError error() const; diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp index 3e8c700..8c348bb 100644 --- a/tests/auto/qserialport/tst_qserialport.cpp +++ b/tests/auto/qserialport/tst_qserialport.cpp @@ -98,7 +98,6 @@ void tst_QSerialPort::defaultConstruct() QVERIFY(!serialPort.errorString().isEmpty()); // properties - QCOMPARE(serialPort.settingsRestoredOnClose(), true); QCOMPARE(serialPort.baudRate(), qint32(0)); QCOMPARE(serialPort.baudRate(QSerialPort::Input), qint32(0)); QCOMPARE(serialPort.baudRate(QSerialPort::Output), qint32(0)); |