diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2015-05-19 11:03:11 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2015-05-25 13:42:37 +0000 |
commit | a0861ed6aa4ffa7ff47151d8017be7358e9649f8 (patch) | |
tree | 527ac517f0c8d6f31be36c430ba5135e39cb5cd5 | |
parent | d15bf9d678085c4572068c84db884e9a72e98b84 (diff) |
Use QT_DEPRECATED macro instead of custom QT_DEPRECATED_SINCE for Qt4
The macro QT_DEPRECATED_SINCE was introduced in QSP because earlier any
branch of QSP had support both Qt4 and Qt5. But beginning from Qt5.5 the
Qt4 uses the separate branch, named as "qt4-dev".
Thus it is reasonable to replace all deprecation conditions on #ifdef
QT_DEPRECATED, similar to Qt4 sources for this branch.
Task-number: QTBUG-46154
Change-Id: Id8d008f2341cd14d0352293c4a2c00a367655afb
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r-- | src/serialport/qserialport.cpp | 10 | ||||
-rw-r--r-- | src/serialport/qserialport.h | 18 | ||||
-rw-r--r-- | src/serialport/qserialportglobal.h | 5 | ||||
-rw-r--r-- | src/serialport/qserialportinfo.h | 2 |
4 files changed, 15 insertions, 20 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index ee60119f..4151b73d 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -74,7 +74,7 @@ QSerialPortPrivateData::QSerialPortPrivateData(QSerialPort *q) , stopBits(QSerialPort::OneStop) , flowControl(QSerialPort::NoFlowControl) , policy(QSerialPort::IgnorePolicy) -#if QT_DEPRECATED_SINCE(5,3) +#ifdef QT_DEPRECATED , settingsRestoredOnClose(true) #endif , isBreakEnabled(false) @@ -568,7 +568,7 @@ void QSerialPort::close() The default state of the QSerialPort class is to restore the settings. */ -#if QT_DEPRECATED_SINCE(5,3) +#ifdef QT_DEPRECATED void QSerialPort::setSettingsRestoredOnClose(bool restore) { Q_D(QSerialPort); @@ -584,7 +584,7 @@ bool QSerialPort::settingsRestoredOnClose() const Q_D(const QSerialPort); return d->settingsRestoredOnClose; } -#endif // QT_DEPRECATED_SINCE(5,3) +#endif // QT_DEPRECATED /*! \fn void QSerialPort::settingsRestoredOnCloseChanged(bool restore) \obsolete @@ -1065,7 +1065,7 @@ bool QSerialPort::atEnd() const with the kernel and hardware. Hence, the two scenarios cannot be completely compared to each other. */ -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED bool QSerialPort::setDataErrorPolicy(DataErrorPolicy policy) { Q_D(QSerialPort); @@ -1090,7 +1090,7 @@ QSerialPort::DataErrorPolicy QSerialPort::dataErrorPolicy() const Q_D(const QSerialPort); return d->policy; } -#endif // QT_DEPRECATED_SINCE(5, 2) +#endif // QT_DEPRECATED /*! \fn void QSerialPort::dataErrorPolicyChanged(DataErrorPolicy policy) \obsolete diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h index 847f74d0..6296163a 100644 --- a/src/serialport/qserialport.h +++ b/src/serialport/qserialport.h @@ -62,13 +62,13 @@ class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice Q_PROPERTY(Parity parity READ parity WRITE setParity NOTIFY parityChanged) Q_PROPERTY(StopBits stopBits READ stopBits WRITE setStopBits NOTIFY stopBitsChanged) Q_PROPERTY(FlowControl flowControl READ flowControl WRITE setFlowControl NOTIFY flowControlChanged) -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED Q_PROPERTY(DataErrorPolicy dataErrorPolicy READ dataErrorPolicy WRITE setDataErrorPolicy NOTIFY dataErrorPolicyChanged) #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) -#if QT_DEPRECATED_SINCE(5, 3) +#ifdef QT_DEPRECATED Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged) #endif Q_PROPERTY(bool breakEnabled READ isBreakEnabled WRITE setBreakEnabled NOTIFY breakEnabledChanged) @@ -149,7 +149,7 @@ public: }; Q_DECLARE_FLAGS(PinoutSignals, PinoutSignal) -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED #if defined _MSC_VER #pragma deprecated(UnknownBaud) #pragma deprecated(UnknownDataBits) @@ -161,7 +161,7 @@ public: #endif #endif -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED enum DataErrorPolicy { SkipPolicy, PassZeroPolicy, @@ -201,7 +201,7 @@ public: bool open(OpenMode mode) Q_DECL_OVERRIDE; void close() Q_DECL_OVERRIDE; -#if QT_DEPRECATED_SINCE(5, 3) +#ifdef QT_DEPRECATED QT_DEPRECATED void setSettingsRestoredOnClose(bool restore); QT_DEPRECATED bool settingsRestoredOnClose() const; #endif @@ -233,7 +233,7 @@ public: bool clear(Directions directions = AllDirections); bool atEnd() const Q_DECL_OVERRIDE; -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED QT_DEPRECATED bool setDataErrorPolicy(DataErrorPolicy policy = IgnorePolicy); QT_DEPRECATED DataErrorPolicy dataErrorPolicy() const; #endif @@ -253,7 +253,7 @@ public: bool waitForReadyRead(int msecs) Q_DECL_OVERRIDE; bool waitForBytesWritten(int msecs) Q_DECL_OVERRIDE; -#if QT_DEPRECATED_SINCE(5, 5) +#ifdef QT_DEPRECATED QT_DEPRECATED bool sendBreak(int duration = 0); #endif bool setBreakEnabled(bool set = true); @@ -267,13 +267,13 @@ Q_SIGNALS: void parityChanged(QSerialPort::Parity parity); void stopBitsChanged(QSerialPort::StopBits stopBits); void flowControlChanged(QSerialPort::FlowControl flowControl); -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED QT_DEPRECATED void dataErrorPolicyChanged(QSerialPort::DataErrorPolicy policy); #endif void dataTerminalReadyChanged(bool set); void requestToSendChanged(bool set); void error(QSerialPort::SerialPortError serialPortError); -#if QT_DEPRECATED_SINCE(5, 3) +#ifdef QT_DEPRECATED QT_DEPRECATED void settingsRestoredOnCloseChanged(bool restore); #endif void breakEnabledChanged(bool set); diff --git a/src/serialport/qserialportglobal.h b/src/serialport/qserialportglobal.h index 50f53e9c..78cf615f 100644 --- a/src/serialport/qserialportglobal.h +++ b/src/serialport/qserialportglobal.h @@ -58,11 +58,6 @@ QT_BEGIN_NAMESPACE # define Q_SERIALPORT_EXPORT #endif -// These macros have been available only since Qt 5.0 -#ifndef QT_DEPRECATED_SINCE -#define QT_DEPRECATED_SINCE(major, minor) 1 -#endif - #ifndef Q_DECL_OVERRIDE #define Q_DECL_OVERRIDE #endif diff --git a/src/serialport/qserialportinfo.h b/src/serialport/qserialportinfo.h index 0fdc0fa3..7aa98d10 100644 --- a/src/serialport/qserialportinfo.h +++ b/src/serialport/qserialportinfo.h @@ -81,7 +81,7 @@ public: bool isNull() const; bool isBusy() const; -#if QT_DEPRECATED_SINCE(5, 2) +#ifdef QT_DEPRECATED QT_DEPRECATED bool isValid() const; #endif |