diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-02-07 22:59:19 +0000 |
---|---|---|
committer | Laszlo Papp <lpapp@kde.org> | 2013-02-10 12:32:32 +0100 |
commit | 0fdbabd6911c109048b5d39300202f1949101b28 (patch) | |
tree | 16ce0ce40fcb278741b97a42cbeda18c28757699 /src | |
parent | 83aa6adaaffb68c1cd6a810802692695d8b16e92 (diff) | |
download | qtserialport-0fdbabd6911c109048b5d39300202f1949101b28.tar.gz |
Modify the restore settings on close API to lean towards the Qt'ish style
Change-Id: Idb648c9e8d0607826e775f4b92f092b5c81c9790
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/serialport/qserialport.cpp | 20 | ||||
-rw-r--r-- | src/serialport/qserialport.h | 8 | ||||
-rw-r--r-- | src/serialport/qserialport_p.h | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_symbian.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_win.cpp | 2 | ||||
-rw-r--r-- | src/serialport/qserialport_wince.cpp | 2 |
7 files changed, 19 insertions, 19 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index b884e82..49f67e0 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -73,7 +73,7 @@ QSerialPortPrivateData::QSerialPortPrivateData(QSerialPort *q) , stopBits(QSerialPort::UnknownStopBits) , flow(QSerialPort::UnknownFlowControl) , policy(QSerialPort::IgnorePolicy) - , restoreSettingsOnClose(true) + , settingsRestoredOnClose(true) , q_ptr(q) { } @@ -554,7 +554,7 @@ void QSerialPort::close() } /*! - \property QSerialPort::restoreSettingsOnClose + \property QSerialPort::settingsRestoredOnClose \brief the flag which allows to restore the previous settings while closing the serial port. @@ -562,31 +562,31 @@ void QSerialPort::close() The default state of the QSerialPort class is configured to restore the settings. */ -void QSerialPort::setRestoreSettingsOnClose(bool restore) +void QSerialPort::setSettingsRestoredOnClose(bool restore) { Q_D(QSerialPort); - if (d->restoreSettingsOnClose != restore) { - d->restoreSettingsOnClose = restore; - emit restoreSettingsOnCloseChanged(d->restoreSettingsOnClose); + if (d->settingsRestoredOnClose != restore) { + d->settingsRestoredOnClose = restore; + emit settingsRestoredOnCloseChanged(d->settingsRestoredOnClose); } } -bool QSerialPort::restoreSettingsOnClose() const +bool QSerialPort::settingsRestoredOnClose() const { Q_D(const QSerialPort); - return d->restoreSettingsOnClose; + return d->settingsRestoredOnClose; } /*! - \fn void QSerialPort::restoreSettingsOnCloseChanged(bool restore) + \fn void QSerialPort::settingsRestoredOnCloseChanged(bool restore) This signal is emitted after the flag which allows to restore the previous settings while closing the serial port has been changed. The new flag which allows to restore the previous settings while closing the serial port is passed as \restore. - \sa QSerialPort::restoreSettingsOnClose + \sa QSerialPort::settingsRestoredOnClose */ /*! diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h index e565cfd..5f1b06b 100644 --- a/src/serialport/qserialport.h +++ b/src/serialport/qserialport.h @@ -65,7 +65,7 @@ class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice 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 restoreSettingsOnClose READ restoreSettingsOnClose WRITE setRestoreSettingsOnClose NOTIFY restoreSettingsOnCloseChanged) + Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged) Q_ENUMS( Directions Rate DataBits Parity StopBits FlowControl Lines DataErrorPolicy SerialPortError ) @@ -170,8 +170,8 @@ public: virtual bool open(OpenMode mode); virtual void close(); - void setRestoreSettingsOnClose(bool restore); - bool restoreSettingsOnClose() const; + void setSettingsRestoredOnClose(bool restore); + bool settingsRestoredOnClose() const; bool setBaudRate(qint32 baudRate, Directions dir = AllDirections); qint32 baudRate(Directions dir = AllDirections) const; @@ -232,7 +232,7 @@ Q_SIGNALS: void dataTerminalReadyChanged(bool set); void requestToSendChanged(bool set); void error(QSerialPort::SerialPortError serialPortError); - void restoreSettingsOnCloseChanged(bool restore); + void settingsRestoredOnCloseChanged(bool restore); protected: virtual qint64 readData(char *data, qint64 maxSize); diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h index c88b714..abd9cb6 100644 --- a/src/serialport/qserialport_p.h +++ b/src/serialport/qserialport_p.h @@ -80,7 +80,7 @@ public: QSerialPort::DataErrorPolicy policy; bool dataTerminalReady; bool requestToSend; - bool restoreSettingsOnClose; + bool settingsRestoredOnClose; QSerialPort * const q_ptr; }; diff --git a/src/serialport/qserialport_symbian.cpp b/src/serialport/qserialport_symbian.cpp index 200dc06..cca7c02 100644 --- a/src/serialport/qserialport_symbian.cpp +++ b/src/serialport/qserialport_symbian.cpp @@ -153,7 +153,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) void QSerialPortPrivate::close() { - if (restoreSettingsOnClose) + if (settingsRestoredOnClose) descriptor.SetConfig(restoredSettings); descriptor.Close(); } diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index fac8544..7e14b3d 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -209,7 +209,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) void QSerialPortPrivate::close() { - if (restoreSettingsOnClose) { + if (settingsRestoredOnClose) { ::tcsetattr(descriptor, TCSANOW, &restoredTermios); #ifdef Q_OS_LINUX if (isCustomBaudRateSupported) diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index 5046eea..56da5d8 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -294,7 +294,7 @@ void QSerialPortPrivate::close() readyReadEmitted = false; flagErrorFromCommEvent = false; - if (restoreSettingsOnClose) { + if (settingsRestoredOnClose) { ::SetCommState(descriptor, &restoredDcb); ::SetCommTimeouts(descriptor, &restoredCommTimeouts); } diff --git a/src/serialport/qserialport_wince.cpp b/src/serialport/qserialport_wince.cpp index 2382cdd..4e61a8c 100644 --- a/src/serialport/qserialport_wince.cpp +++ b/src/serialport/qserialport_wince.cpp @@ -225,7 +225,7 @@ void QSerialPortPrivate::close() eventNotifier = 0; } - if (restoreSettingsOnClose) { + if (settingsRestoredOnClose) { ::SetCommState(descriptor, &restoredDcb); ::SetCommTimeouts(descriptor, &restoredCommTimeouts); } |