Skip to content

Commit

Permalink
MixInvitation*Iq: Do not use d-pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
melvo committed Mar 24, 2024
1 parent 9ceadc4 commit dd32673
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
32 changes: 9 additions & 23 deletions src/base/QXmppMixIq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ void QXmppMixSubscriptionUpdateIq::toXmlElementFromChild(QXmlStreamWriter *write
}
/// \endcond

class QXmppMixInvitationRequestIqPrivate : public QSharedData
{
public:
QString inviteeJid;
};

///
/// \class QXmppMixInvitationRequestIq
///
Expand All @@ -170,7 +164,6 @@ class QXmppMixInvitationRequestIqPrivate : public QSharedData
/// Constructs a MIX invitation request IQ.
///
QXmppMixInvitationRequestIq::QXmppMixInvitationRequestIq()
: d(new QXmppMixInvitationRequestIqPrivate)
{
}

Expand All @@ -183,7 +176,7 @@ QXMPP_PRIVATE_DEFINE_RULE_OF_SIX(QXmppMixInvitationRequestIq)
///
QString QXmppMixInvitationRequestIq::inviteeJid() const
{
return d->inviteeJid;
return m_inviteeJid;
}

///
Expand All @@ -193,7 +186,7 @@ QString QXmppMixInvitationRequestIq::inviteeJid() const
///
void QXmppMixInvitationRequestIq::setInviteeJid(const QString &inviteeJid)
{
d->inviteeJid = inviteeJid;
m_inviteeJid = inviteeJid;
}

bool QXmppMixInvitationRequestIq::isMixInvitationRequestIq(const QDomElement &element)
Expand All @@ -206,24 +199,18 @@ void QXmppMixInvitationRequestIq::parseElementFromChild(const QDomElement &eleme
{
QDomElement child = element.firstChildElement();
const auto subChild = child.firstChildElement(QStringLiteral("invitee"));
d->inviteeJid = subChild.text();
m_inviteeJid = subChild.text();
}

void QXmppMixInvitationRequestIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement(QSL65("invite"));
writer->writeDefaultNamespace(toString65(ns_mix_misc));
writeXmlTextElement(writer, u"invitee", d->inviteeJid);
writeXmlTextElement(writer, u"invitee", m_inviteeJid);
writer->writeEndElement();
}
/// \endcond

class QXmppMixInvitationResponseIqPrivate : public QSharedData
{
public:
QXmppMixInvitation invitation;
};

///
/// \class QXmppMixInvitationResponseIq
///
Expand All @@ -240,7 +227,6 @@ class QXmppMixInvitationResponseIqPrivate : public QSharedData
/// Constructs a MIX invitation response IQ.
///
QXmppMixInvitationResponseIq::QXmppMixInvitationResponseIq()
: d(new QXmppMixInvitationResponseIqPrivate)
{
}

Expand All @@ -253,7 +239,7 @@ QXMPP_PRIVATE_DEFINE_RULE_OF_SIX(QXmppMixInvitationResponseIq)
///
QXmppMixInvitation QXmppMixInvitationResponseIq::invitation() const
{
return d->invitation;
return m_invitation;
}

///
Expand All @@ -263,7 +249,7 @@ QXmppMixInvitation QXmppMixInvitationResponseIq::invitation() const
///
void QXmppMixInvitationResponseIq::setInvitation(const QXmppMixInvitation &invitation)
{
d->invitation = invitation;
m_invitation = invitation;
}

bool QXmppMixInvitationResponseIq::isMixInvitationResponseIq(const QDomElement &element)
Expand All @@ -276,15 +262,15 @@ void QXmppMixInvitationResponseIq::parseElementFromChild(const QDomElement &elem
{
QDomElement child = element.firstChildElement();
const auto subChild = child.firstChildElement(QStringLiteral("invitation"));
d->invitation = QXmppMixInvitation();
d->invitation.parse(subChild);
m_invitation = QXmppMixInvitation();
m_invitation.parse(subChild);
}

void QXmppMixInvitationResponseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement(QSL65("invite"));
writer->writeDefaultNamespace(toString65(ns_mix_misc));
d->invitation.toXml(writer);
m_invitation.toXml(writer);
writer->writeEndElement();
}
/// \endcond
Expand Down
7 changes: 2 additions & 5 deletions src/base/QXmppMixIq_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#include "QXmppMixConfigItem.h"
#include "QXmppMixInvitation.h"

class QXmppMixInvitationRequestIqPrivate;
class QXmppMixInvitationResponseIqPrivate;

class QXMPP_EXPORT QXmppMixSubscriptionUpdateIq : public QXmppIq
{
public:
Expand Down Expand Up @@ -57,7 +54,7 @@ class QXMPP_EXPORT QXmppMixInvitationRequestIq : public QXmppIq
/// \endcond

private:
QSharedDataPointer<QXmppMixInvitationRequestIqPrivate> d;
QString m_inviteeJid;
};

class QXMPP_EXPORT QXmppMixInvitationResponseIq : public QXmppIq
Expand All @@ -79,7 +76,7 @@ class QXMPP_EXPORT QXmppMixInvitationResponseIq : public QXmppIq
/// \endcond

private:
QSharedDataPointer<QXmppMixInvitationResponseIqPrivate> d;
QXmppMixInvitation m_invitation;
};

namespace QXmpp::Private {
Expand Down

0 comments on commit dd32673

Please sign in to comment.