Skip to content

Commit 4542429

Browse files
committed
BaseConnectionContactsInterface: BaseConnection added as private member.
Contacts interface is closely related to BaseConnection. Added member is needed for BaseConnectionContactsInterface::getContactByID(). (The same story happend with another mandatory Connection interface: BaseConnectionRequestsInterface::ensureChannel() requires BaseConnection ptr.)
1 parent c89a98c commit 4542429

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

TelepathyQt/base-connection.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -927,13 +927,15 @@ void BaseConnectionRequestsInterface::createChannel(const QVariantMap &request,
927927
// Conn.I.Contacts
928928
// The BaseConnectionContactsInterface code is fully or partially generated by the TelepathyQt-Generator.
929929
struct TP_QT_NO_EXPORT BaseConnectionContactsInterface::Private {
930-
Private(BaseConnectionContactsInterface *parent)
931-
: adaptee(new BaseConnectionContactsInterface::Adaptee(parent))
930+
Private(BaseConnectionContactsInterface *parent, BaseConnection *connection)
931+
: connection(connection),
932+
adaptee(new BaseConnectionContactsInterface::Adaptee(parent))
932933
{
933934
}
934935

935936
QStringList contactAttributeInterfaces;
936937
GetContactAttributesCallback getContactAttributesCB;
938+
BaseConnection *connection;
937939
BaseConnectionContactsInterface::Adaptee *adaptee;
938940
};
939941

@@ -975,9 +977,9 @@ void BaseConnectionContactsInterface::Adaptee::getContactAttributes(const Tp::UI
975977
/**
976978
* Class constructor.
977979
*/
978-
BaseConnectionContactsInterface::BaseConnectionContactsInterface()
980+
BaseConnectionContactsInterface::BaseConnectionContactsInterface(BaseConnection *connection)
979981
: AbstractConnectionInterface(TP_QT_IFACE_CONNECTION_INTERFACE_CONTACTS),
980-
mPriv(new Private(this))
982+
mPriv(new Private(this, connection))
981983
{
982984
}
983985

TelepathyQt/base-connection.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ class TP_QT_EXPORT BaseConnectionContactsInterface : public AbstractConnectionIn
199199
Q_DISABLE_COPY(BaseConnectionContactsInterface)
200200

201201
public:
202-
static BaseConnectionContactsInterfacePtr create()
202+
static BaseConnectionContactsInterfacePtr create(BaseConnection *connection)
203203
{
204-
return BaseConnectionContactsInterfacePtr(new BaseConnectionContactsInterface());
204+
return BaseConnectionContactsInterfacePtr(new BaseConnectionContactsInterface(connection));
205205
}
206206
template<typename BaseConnectionContactsInterfaceSubclass>
207-
static SharedPtr<BaseConnectionContactsInterfaceSubclass> create()
207+
static SharedPtr<BaseConnectionContactsInterfaceSubclass> create(BaseConnection *connection)
208208
{
209209
return SharedPtr<BaseConnectionContactsInterfaceSubclass>(
210-
new BaseConnectionContactsInterfaceSubclass());
210+
new BaseConnectionContactsInterfaceSubclass(connection));
211211
}
212212

213213
virtual ~BaseConnectionContactsInterface();
@@ -222,7 +222,7 @@ class TP_QT_EXPORT BaseConnectionContactsInterface : public AbstractConnectionIn
222222
Tp::ContactAttributesMap getContactAttributes(const Tp::UIntList &handles, const QStringList &interfaces, DBusError *error);
223223

224224
protected:
225-
BaseConnectionContactsInterface();
225+
BaseConnectionContactsInterface(BaseConnection *connection);
226226

227227
private:
228228
void createAdaptor();

0 commit comments

Comments
 (0)