Skip to content
Permalink
Browse files

Modernize codebase using clang-tidy

Using the following checks:
 * modernize-use-nullptr
 * modernize-use-override
 * modernize-use-using
 * modernize-use-bool-literals
  • Loading branch information...
JBBgameich authored and lnjX committed May 10, 2019
1 parent 35256b7 commit b18a57daa33f0fefa5f4c63aa7f448b48d302e0d
Showing with 359 additions and 359 deletions.
  1. +2 −2 examples/example_1_echoClient/example_1_echoClient.h
  2. +2 −2 examples/example_2_rosterHandling/example_2_rosterHandling.h
  3. +1 −1 examples/example_3_transferHandling/example_3_transferHandling.cpp
  4. +1 −1 examples/example_3_transferHandling/example_3_transferHandling.h
  5. +2 −2 examples/example_5_rpcInterface/remoteinterface.h
  6. +2 −2 examples/example_6_rpcClient/rpcClient.h
  7. +2 −2 examples/example_7_archiveHandling/example_7_archiveHandling.h
  8. +2 −2 examples/example_8_server/example_8_server.cpp
  9. +2 −2 examples/example_9_vCard/example_9_vCard.h
  10. +10 −10 src/base/QXmppArchiveIq.h
  11. +2 −2 src/base/QXmppBindIq.h
  12. +2 −2 src/base/QXmppByteStreamIq.h
  13. +4 −4 src/base/QXmppCodec_p.h
  14. +1 −1 src/base/QXmppDataForm.cpp
  15. +2 −2 src/base/QXmppDiscoveryIq.h
  16. +3 −3 src/base/QXmppElement.cpp
  17. +1 −1 src/base/QXmppElement.h
  18. +2 −2 src/base/QXmppEntityTimeIq.h
  19. +6 −6 src/base/QXmppHttpUploadIq.h
  20. +6 −6 src/base/QXmppIbbIq.h
  21. +4 −4 src/base/QXmppIq.h
  22. +4 −4 src/base/QXmppJingleIq.h
  23. +3 −3 src/base/QXmppLogger.cpp
  24. +4 −4 src/base/QXmppLogger.h
  25. +4 −4 src/base/QXmppMamIq.h
  26. +4 −4 src/base/QXmppMessage.h
  27. +3 −3 src/base/QXmppMixIq.h
  28. +4 −4 src/base/QXmppMucIq.h
  29. +2 −2 src/base/QXmppNonSASLAuth.h
  30. +1 −1 src/base/QXmppPingIq.h
  31. +4 −4 src/base/QXmppPresence.h
  32. +2 −2 src/base/QXmppPubSubIq.h
  33. +2 −2 src/base/QXmppRegisterIq.h
  34. +3 −3 src/base/QXmppRosterIq.h
  35. +6 −6 src/base/QXmppRpcIq.h
  36. +9 −9 src/base/QXmppRtpChannel.cpp
  37. +16 −16 src/base/QXmppRtpChannel.h
  38. +3 −3 src/base/QXmppSasl.cpp
  39. +49 −49 src/base/QXmppSasl_p.h
  40. +1 −1 src/base/QXmppSessionIq.h
  41. +2 −2 src/base/QXmppSocks.h
  42. +1 −1 src/base/QXmppStream.cpp
  43. +1 −1 src/base/QXmppStream.h
  44. +2 −2 src/base/QXmppStreamFeatures.h
  45. +2 −2 src/base/QXmppStreamInitiationIq_p.h
  46. +14 −14 src/base/QXmppStun.cpp
  47. +6 −6 src/base/QXmppStun.h
  48. +12 −12 src/base/QXmppStun_p.h
  49. +3 −3 src/base/QXmppVCardIq.h
  50. +2 −2 src/base/QXmppVersionIq.h
  51. +2 −2 src/client/QXmppArchiveManager.h
  52. +2 −2 src/client/QXmppBookmarkManager.cpp
  53. +3 −3 src/client/QXmppBookmarkManager.h
  54. +12 −12 src/client/QXmppCallManager.cpp
  55. +5 −5 src/client/QXmppCallManager.h
  56. +3 −3 src/client/QXmppCarbonManager.h
  57. +3 −3 src/client/QXmppClient.cpp
  58. +3 −3 src/client/QXmppClient.h
  59. +1 −1 src/client/QXmppClientExtension.cpp
  60. +1 −1 src/client/QXmppClientExtension.h
  61. +3 −3 src/client/QXmppDiscoveryManager.h
  62. +2 −2 src/client/QXmppEntityTimeManager.h
  63. +1 −1 src/client/QXmppInvokable.cpp
  64. +2 −2 src/client/QXmppInvokable.h
  65. +2 −2 src/client/QXmppMamManager.h
  66. +2 −2 src/client/QXmppMessageReceiptManager.h
  67. +5 −5 src/client/QXmppMucManager.h
  68. +4 −4 src/client/QXmppOutgoingClient.cpp
  69. +6 −6 src/client/QXmppOutgoingClient.h
  70. +2 −2 src/client/QXmppRosterManager.h
  71. +3 −3 src/client/QXmppRpcManager.h
  72. +15 −15 src/client/QXmppTransferManager.cpp
  73. +5 −5 src/client/QXmppTransferManager.h
  74. +3 −3 src/client/QXmppVCardManager.h
  75. +3 −3 src/client/QXmppVersionManager.h
  76. +2 −2 src/server/QXmppDialback.h
  77. +5 −5 src/server/QXmppIncomingClient.cpp
  78. +5 −5 src/server/QXmppIncomingClient.h
  79. +4 −4 src/server/QXmppIncomingServer.h
  80. +5 −5 src/server/QXmppOutgoingServer.h
  81. +1 −1 src/server/QXmppPasswordChecker.h
  82. +3 −3 src/server/QXmppServer.cpp
  83. +4 −4 src/server/QXmppServer.h
  84. +1 −1 src/server/QXmppServerExtension.cpp
  85. +1 −1 src/server/QXmppServerExtension.h
  86. +2 −2 src/server/QXmppServerPlugin.h
  87. +1 −1 tests/qxmppcallmanager/tst_qxmppcallmanager.cpp
  88. +1 −1 tests/qxmppsocks/tst_qxmppsocks.cpp
  89. +1 −1 tests/qxmpptransfermanager/tst_qxmpptransfermanager.cpp
  90. +2 −2 tests/util.h
@@ -32,8 +32,8 @@ class echoClient : public QXmppClient
Q_OBJECT

public:
echoClient(QObject *parent = 0);
~echoClient();
echoClient(QObject *parent = nullptr);
~echoClient() override;

public slots:
void messageReceived(const QXmppMessage&);
@@ -32,8 +32,8 @@ class xmppClient : public QXmppClient
Q_OBJECT

public:
xmppClient(QObject *parent = 0);
~xmppClient();
xmppClient(QObject *parent = nullptr);
~xmppClient() override;

public slots:
void clientConnected();
@@ -35,7 +35,7 @@
#include "example_3_transferHandling.h"

xmppClient::xmppClient(QObject *parent)
: QXmppClient(parent), transferManager(0)
: QXmppClient(parent), transferManager(nullptr)
{
bool check;
Q_UNUSED(check);
@@ -33,7 +33,7 @@ class xmppClient : public QXmppClient
Q_OBJECT

public:
xmppClient(QObject *parent = 0);
xmppClient(QObject *parent = nullptr);
void setRecipient(const QString &recipient);

private slots:
@@ -7,9 +7,9 @@ class RemoteInterface : public QXmppInvokable
{
Q_OBJECT
public:
RemoteInterface(QObject *parent = 0);
RemoteInterface(QObject *parent = nullptr);

bool isAuthorized( const QString &jid ) const;
bool isAuthorized( const QString &jid ) const override;

// RPC Interface
public slots:
@@ -35,8 +35,8 @@ class rpcClient : public QXmppClient
Q_OBJECT

public:
rpcClient(QObject *parent = 0);
~rpcClient();
rpcClient(QObject *parent = nullptr);
~rpcClient() override;

private slots:
void slotInvokeRemoteMethod();
@@ -43,8 +43,8 @@ class xmppClient : public QXmppClient
PageBackwards
};

xmppClient(QObject *parent = 0);
~xmppClient();
xmppClient(QObject *parent = nullptr);
~xmppClient() override;

void setPageDirection(PageDirection direction);
void setPageSize(int size);
@@ -33,7 +33,7 @@
class passwordChecker : public QXmppPasswordChecker
{
/// Retrieves the password for the given username.
QXmppPasswordReply::Error getPassword(const QXmppPasswordRequest &request, QString &password)
QXmppPasswordReply::Error getPassword(const QXmppPasswordRequest &request, QString &password) override
{
if (request.username() == USERNAME)
{
@@ -45,7 +45,7 @@ class passwordChecker : public QXmppPasswordChecker
};

/// Returns true as we implemented getPassword().
bool hasGetPassword() const
bool hasGetPassword() const override
{
return true;
};
@@ -34,8 +34,8 @@ class xmppClient : public QXmppClient
Q_OBJECT

public:
xmppClient(QObject *parent = 0);
~xmppClient();
xmppClient(QObject *parent = nullptr);
~xmppClient() override;

public slots:
void clientConnected();
@@ -111,8 +111,8 @@ class QXMPP_EXPORT QXmppArchiveChatIq : public QXmppIq
static bool isArchiveChatIq(const QDomElement &element);

protected:
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -153,8 +153,8 @@ class QXMPP_EXPORT QXmppArchiveListIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -186,8 +186,8 @@ class QXMPP_EXPORT QXmppArchiveRemoveIq : public QXmppIq
static bool isArchiveRemoveIq(const QDomElement &element);

protected:
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -218,8 +218,8 @@ class QXMPP_EXPORT QXmppArchiveRetrieveIq : public QXmppIq
static bool isArchiveRetrieveIq(const QDomElement &element);

protected:
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -239,8 +239,8 @@ class QXMPP_EXPORT QXmppArchivePrefIq : public QXmppIq
static bool isArchivePrefIq(const QDomElement &element);

protected:
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond
};

@@ -48,8 +48,8 @@ class QXMPP_EXPORT QXmppBindIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -78,8 +78,8 @@ class QXMPP_EXPORT QXmppByteStreamIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -60,8 +60,8 @@ class QXmppG711aCodec : public QXmppCodec
public:
QXmppG711aCodec(int clockrate);

qint64 encode(QDataStream &input, QDataStream &output);
qint64 decode(QDataStream &input, QDataStream &output);
qint64 encode(QDataStream &input, QDataStream &output) override;
qint64 decode(QDataStream &input, QDataStream &output) override;

private:
int m_frequency;
@@ -76,8 +76,8 @@ class QXmppG711uCodec : public QXmppCodec
public:
QXmppG711uCodec(int clockrate);

qint64 encode(QDataStream &input, QDataStream &output);
qint64 decode(QDataStream &input, QDataStream &output);
qint64 encode(QDataStream &input, QDataStream &output) override;
qint64 decode(QDataStream &input, QDataStream &output) override;

private:
int m_frequency;
@@ -46,7 +46,7 @@ static field_type field_types[] = {
{QXmppDataForm::Field::TextMultiField, "text-multi"},
{QXmppDataForm::Field::TextPrivateField, "text-private"},
{QXmppDataForm::Field::TextSingleField, "text-single"},
{static_cast<QXmppDataForm::Field::Type>(-1), NULL},
{static_cast<QXmppDataForm::Field::Type>(-1), nullptr},
};

class QXmppDataFormMediaPrivate : public QSharedData
@@ -99,8 +99,8 @@ class QXMPP_EXPORT QXmppDiscoveryIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -46,12 +46,12 @@ class QXmppElementPrivate
};

QXmppElementPrivate::QXmppElementPrivate()
: counter(1), parent(NULL)
: counter(1), parent(nullptr)
{
}

QXmppElementPrivate::QXmppElementPrivate(const QDomElement &element)
: counter(1), parent(NULL)
: counter(1), parent(nullptr)
{
if (element.isNull())
return;
@@ -207,7 +207,7 @@ void QXmppElement::removeChild(const QXmppElement &child)

d->children.removeAll(child.d);
child.d->counter.deref();
child.d->parent = NULL;
child.d->parent = nullptr;
}

QString QXmppElement::tagName() const
@@ -34,7 +34,7 @@ class QDomElement;
class QXmppElement;
class QXmppElementPrivate;

typedef QList<QXmppElement> QXmppElementList;
using QXmppElementList = QList<QXmppElement>;
class QXMPP_EXPORT QXmppElement
{
public:
@@ -44,8 +44,8 @@ class QXMPP_EXPORT QXmppEntityTimeIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -42,7 +42,7 @@ class QXMPP_EXPORT QXmppHttpUploadRequestIq : public QXmppIq
{
public:
QXmppHttpUploadRequestIq();
~QXmppHttpUploadRequestIq();
~QXmppHttpUploadRequestIq() override;

QString fileName() const;
void setFileName(const QString &filename);
@@ -57,8 +57,8 @@ class QXMPP_EXPORT QXmppHttpUploadRequestIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -74,7 +74,7 @@ class QXMPP_EXPORT QXmppHttpUploadSlotIq : public QXmppIq
{
public:
QXmppHttpUploadSlotIq();
~QXmppHttpUploadSlotIq();
~QXmppHttpUploadSlotIq() override;

QUrl putUrl() const;
void setPutUrl(const QUrl &putUrl);
@@ -89,8 +89,8 @@ class QXMPP_EXPORT QXmppHttpUploadSlotIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -42,8 +42,8 @@ class QXmppIbbOpenIq: public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -63,8 +63,8 @@ class QXmppIbbCloseIq: public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -89,8 +89,8 @@ class QXMPP_EXPORT QXmppIbbDataIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:
@@ -53,18 +53,18 @@ class QXMPP_EXPORT QXmppIq : public QXmppStanza

QXmppIq(QXmppIq::Type type = QXmppIq::Get);
QXmppIq(const QXmppIq &other);
~QXmppIq();
~QXmppIq() override;

QXmppIq& operator=(const QXmppIq &other);

QXmppIq::Type type() const;
void setType(QXmppIq::Type);

bool isXmppStanza() const;
bool isXmppStanza() const override;

/// \cond
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
void parse(const QDomElement &element) override;
void toXml(QXmlStreamWriter *writer) const override;

protected:
virtual void parseElementFromChild(const QDomElement &element);
@@ -138,7 +138,7 @@ class QXMPP_EXPORT QXmppJingleCandidate
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;

static QXmppJingleCandidate::Type typeFromString(const QString &typeStr, bool *ok = 0);
static QXmppJingleCandidate::Type typeFromString(const QString &typeStr, bool *ok = nullptr);
static QString typeToString(QXmppJingleCandidate::Type type);
/// \endcond

@@ -289,7 +289,7 @@ class QXMPP_EXPORT QXmppJingleIq : public QXmppIq

QXmppJingleIq();
QXmppJingleIq(const QXmppJingleIq &other);
~QXmppJingleIq();
~QXmppJingleIq() override;

QXmppJingleIq& operator=(const QXmppJingleIq &other);

@@ -322,8 +322,8 @@ class QXMPP_EXPORT QXmppJingleIq : public QXmppIq

protected:
/// \cond
void parseElementFromChild(const QDomElement &element);
void toXmlElementFromChild(QXmlStreamWriter *writer) const;
void parseElementFromChild(const QDomElement &element) override;
void toXmlElementFromChild(QXmlStreamWriter *writer) const override;
/// \endcond

private:

0 comments on commit b18a57d

Please sign in to comment.
You can’t perform that action at this time.