diff options
| author | Linus Jahn <lnj@kaidan.im> | 2019-10-26 18:53:23 +0200 |
|---|---|---|
| committer | LNJ <lnj@kaidan.im> | 2019-10-27 11:26:23 +0100 |
| commit | f8c546c5b701c53d708a38a951fcc734eaee7940 (patch) | |
| tree | 1c931fb34dfeb49d8a0a435bddf0dc6927c44f88 /src | |
| parent | 942b926b6e468524f410ceb8fc28ee28f60ad7ce (diff) | |
| download | qxmpp-f8c546c5b701c53d708a38a951fcc734eaee7940.tar.gz | |
Replace deprecated Q_ENUMS with Q_ENUM
Q_ENUM exists since Qt 5.5, more details can be found here:
https://woboq.com/blog/q_enum.html
Diffstat (limited to 'src')
| -rw-r--r-- | src/base/QXmppIq.h | 3 | ||||
| -rw-r--r-- | src/base/QXmppLogger.h | 2 | ||||
| -rw-r--r-- | src/base/QXmppRtpChannel.h | 2 | ||||
| -rw-r--r-- | src/base/QXmppStun.h | 5 | ||||
| -rw-r--r-- | src/client/QXmppCallManager.h | 9 | ||||
| -rw-r--r-- | src/client/QXmppClient.h | 9 | ||||
| -rw-r--r-- | src/client/QXmppTransferManager.h | 14 |
7 files changed, 20 insertions, 24 deletions
diff --git a/src/base/QXmppIq.h b/src/base/QXmppIq.h index e7451e7c..d0bcc56f 100644 --- a/src/base/QXmppIq.h +++ b/src/base/QXmppIq.h @@ -43,8 +43,7 @@ class QXMPP_EXPORT QXmppIq : public QXmppStanza { public: /// This enum describes the type of IQ. - enum Type - { + enum Type { Error = 0, ///< Error response. Get, ///< Get request. Set, ///< Set request. diff --git a/src/base/QXmppLogger.h b/src/base/QXmppLogger.h index 912dbd4c..80b9a221 100644 --- a/src/base/QXmppLogger.h +++ b/src/base/QXmppLogger.h @@ -45,7 +45,6 @@ class QXmppLoggerPrivate; class QXMPP_EXPORT QXmppLogger : public QObject { Q_OBJECT - Q_ENUMS(LoggingType) Q_FLAGS(MessageType MessageTypes) Q_PROPERTY(QString logFilePath READ logFilePath WRITE setLogFilePath) Q_PROPERTY(LoggingType loggingType READ loggingType WRITE setLoggingType) @@ -60,6 +59,7 @@ public: StdoutLogging = 2, ///< Log messages are written to the standard output SignalLogging = 4 ///< Log messages are emitted as a signal }; + Q_ENUM(LoggingType) /// This enum describes a type of log message. enum MessageType diff --git a/src/base/QXmppRtpChannel.h b/src/base/QXmppRtpChannel.h index 9b68c7bc..4e7b353f 100644 --- a/src/base/QXmppRtpChannel.h +++ b/src/base/QXmppRtpChannel.h @@ -75,7 +75,6 @@ private: class QXMPP_EXPORT QXmppRtpAudioChannel : public QIODevice, public QXmppRtpChannel { Q_OBJECT - Q_ENUMS(Tone) public: /// This enum is used to describe a DTMF tone. @@ -97,6 +96,7 @@ public: Tone_C, ///< Tone for the C key. Tone_D ///< Tone for the D key. }; + Q_ENUM(Tone) QXmppRtpAudioChannel(QObject *parent = nullptr); ~QXmppRtpAudioChannel() override; diff --git a/src/base/QXmppStun.h b/src/base/QXmppStun.h index 4fa3e34b..deabdcb1 100644 --- a/src/base/QXmppStun.h +++ b/src/base/QXmppStun.h @@ -241,16 +241,15 @@ private: class QXMPP_EXPORT QXmppIceConnection : public QXmppLoggable { Q_OBJECT - Q_ENUMS(GatheringState) Q_PROPERTY(QXmppIceConnection::GatheringState gatheringState READ gatheringState NOTIFY gatheringStateChanged) public: - enum GatheringState - { + enum GatheringState { NewGatheringState, BusyGatheringState, CompleteGatheringState }; + Q_ENUM(GatheringState) QXmppIceConnection(QObject *parent = nullptr); ~QXmppIceConnection() override; diff --git a/src/client/QXmppCallManager.h b/src/client/QXmppCallManager.h index 220bd31f..9f6290e4 100644 --- a/src/client/QXmppCallManager.h +++ b/src/client/QXmppCallManager.h @@ -53,7 +53,6 @@ class QXmppRtpVideoChannel; class QXMPP_EXPORT QXmppCall : public QXmppLoggable { Q_OBJECT - Q_ENUMS(Direction State) Q_FLAGS(QIODevice::OpenModeFlag QIODevice::OpenMode) Q_PROPERTY(Direction direction READ direction CONSTANT) Q_PROPERTY(QString jid READ jid CONSTANT) @@ -63,20 +62,20 @@ class QXMPP_EXPORT QXmppCall : public QXmppLoggable public: /// This enum is used to describe the direction of a call. - enum Direction - { + enum Direction { IncomingDirection, ///< The call is incoming. OutgoingDirection ///< The call is outgoing. }; + Q_ENUM(Direction) /// This enum is used to describe the state of a call. - enum State - { + enum State { ConnectingState = 0, ///< The call is being connected. ActiveState = 1, ///< The call is active. DisconnectingState = 2, ///< The call is being disconnected. FinishedState = 3 ///< The call is finished. }; + Q_ENUM(State) ~QXmppCall() override; diff --git a/src/client/QXmppClient.h b/src/client/QXmppClient.h index d3726334..91e9f11d 100644 --- a/src/client/QXmppClient.h +++ b/src/client/QXmppClient.h @@ -80,28 +80,27 @@ class QXmppVersionManager; class QXMPP_EXPORT QXmppClient : public QXmppLoggable { Q_OBJECT - Q_ENUMS(Error State) Q_PROPERTY(QXmppLogger* logger READ logger WRITE setLogger NOTIFY loggerChanged) Q_PROPERTY(State state READ state NOTIFY stateChanged) public: /// An enumeration for type of error. /// Error could come due a TCP socket or XML stream or due to various stanzas. - enum Error - { + enum Error { NoError, ///< No error. SocketError, ///< Error due to TCP socket. KeepAliveError, ///< Error due to no response to a keep alive. XmppStreamError ///< Error due to XML stream. }; + Q_ENUM(Error) /// This enumeration describes a client state. - enum State - { + enum State { DisconnectedState, ///< Disconnected from the server. ConnectingState, ///< Trying to connect to the server. ConnectedState ///< Connected to the server. }; + Q_ENUM(State) QXmppClient(QObject *parent = nullptr); ~QXmppClient() override; diff --git a/src/client/QXmppTransferManager.h b/src/client/QXmppTransferManager.h index 8202ea91..9a263772 100644 --- a/src/client/QXmppTransferManager.h +++ b/src/client/QXmppTransferManager.h @@ -86,7 +86,6 @@ private: class QXMPP_EXPORT QXmppTransferJob : public QXmppLoggable { Q_OBJECT - Q_ENUMS(Direction Error State) Q_FLAGS(Method Methods) Q_PROPERTY(Direction direction READ direction CONSTANT) Q_PROPERTY(QUrl localFileUrl READ localFileUrl WRITE setLocalFileUrl NOTIFY localFileUrlChanged) @@ -99,30 +98,30 @@ class QXMPP_EXPORT QXmppTransferJob : public QXmppLoggable public: /// This enum is used to describe the direction of a transfer job. - enum Direction - { + enum Direction { IncomingDirection, ///< The file is being received. OutgoingDirection ///< The file is being sent. }; + Q_ENUM(Direction) /// This enum is used to describe the type of error encountered by a transfer job. - enum Error - { + enum Error { NoError = 0, ///< No error occurred. AbortError, ///< The file transfer was aborted. FileAccessError, ///< An error was encountered trying to access a local file. FileCorruptError, ///< The file is corrupt: the file size or hash do not match. ProtocolError ///< An error was encountered in the file transfer protocol. }; + Q_ENUM(Error) /// This enum is used to describe a transfer method. - enum Method - { + enum Method { NoMethod = 0, ///< No transfer method. InBandMethod = 1, ///< XEP-0047: In-Band Bytestreams SocksMethod = 2, ///< XEP-0065: SOCKS5 Bytestreams AnyMethod = 3 ///< Any supported transfer method. }; + Q_ENUM(Method) Q_DECLARE_FLAGS(Methods, Method) /// This enum is used to describe the state of a transfer job. @@ -133,6 +132,7 @@ public: TransferState = 2, ///< The transfer is ongoing. FinishedState = 3 ///< The transfer is finished. }; + Q_ENUM(State) ~QXmppTransferJob() override; |
