[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:04:27 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=ac364f3
The following commit has been merged in the master branch:
commit ac364f39add7e72036b9391b6bf1bfc26b9e39ce
Author: George Goldberg <grundleborg at googlemail.com>
Date: Sat Feb 13 16:35:21 2010 +0000
Give the Tp::Connection to the TelepathyContact so it can delete itself when the connection becomes invalid.
svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=1089648
---
kpeople/nepomuk-feeder/telepathyaccount.cpp | 2 +-
kpeople/nepomuk-feeder/telepathycontact.cpp | 21 +++++++++++++++++----
kpeople/nepomuk-feeder/telepathycontact.h | 6 +++++-
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/kpeople/nepomuk-feeder/telepathyaccount.cpp b/kpeople/nepomuk-feeder/telepathyaccount.cpp
index 655a484..8724940 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.cpp
+++ b/kpeople/nepomuk-feeder/telepathyaccount.cpp
@@ -246,7 +246,7 @@ void TelepathyAccount::onContactsUpgraded(Tp::PendingOperation* op)
// We have an upgraded contact list. Now we can create a TelepathyContact instance for
// each contact.
foreach (Tp::ContactPtr contact, pc->contacts()) {
- new TelepathyContact(contact, this);
+ new TelepathyContact(contact, m_connection, this);
}
}
diff --git a/kpeople/nepomuk-feeder/telepathycontact.cpp b/kpeople/nepomuk-feeder/telepathycontact.cpp
index 1845913..cc0f861 100644
--- a/kpeople/nepomuk-feeder/telepathycontact.cpp
+++ b/kpeople/nepomuk-feeder/telepathycontact.cpp
@@ -23,17 +23,30 @@
#include "telepathyaccount.h"
-TelepathyContact::TelepathyContact(Tp::ContactPtr contact, TelepathyAccount *parent)
+#include <KDebug>
+
+TelepathyContact::TelepathyContact(Tp::ContactPtr contact,
+ Tp::ConnectionPtr connection,
+ TelepathyAccount *parent)
: QObject(parent),
m_parent(parent),
- m_contact(contact)
+ m_contact(contact),
+ m_connection(connection)
{
- // TODO: Implement me!
+ kDebug() << "New TelepathyContact Created:"
+ << m_contact.data()
+ << m_connection.data()
+ << m_parent;
+
+ // We need to destroy ourself if the connection goes down.
+ connect(m_connection.data(),
+ SIGNAL(invalidated(Tp::DBusProxy*, const QString&, const QString&)),
+ SLOT(deleteLater()));
}
TelepathyContact::~TelepathyContact()
{
-
+ kDebug();
}
diff --git a/kpeople/nepomuk-feeder/telepathycontact.h b/kpeople/nepomuk-feeder/telepathycontact.h
index c193da5..e26c813 100644
--- a/kpeople/nepomuk-feeder/telepathycontact.h
+++ b/kpeople/nepomuk-feeder/telepathycontact.h
@@ -24,6 +24,7 @@
#include <QtCore/QObject>
+#include <TelepathyQt4/Connection>
#include <TelepathyQt4/Contact>
class TelepathyAccount;
@@ -36,7 +37,9 @@ class TelepathyContact : public QObject
Q_OBJECT
public:
- explicit TelepathyContact(Tp::ContactPtr contact, TelepathyAccount *parent = 0);
+ explicit TelepathyContact(Tp::ContactPtr contact,
+ Tp::ConnectionPtr connection,
+ TelepathyAccount *parent = 0);
~TelepathyContact();
private:
@@ -44,6 +47,7 @@ private:
TelepathyAccount *m_parent;
Tp::ContactPtr m_contact;
+ Tp::ConnectionPtr m_connection;
};
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list