[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:07:10 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=868923e
The following commit has been merged in the master branch:
commit 868923e9eb9b60865e07a09244b585232f9ea837
Author: George Goldberg <grundleborg at googlemail.com>
Date: Sun Mar 28 13:34:14 2010 +0000
Merge branch 'fix-dario-crash'
svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=1108282
---
kpeople/nepomuk-feeder/telepathyaccount.cpp | 10 +++++++++-
kpeople/nepomuk-feeder/telepathyaccount.h | 3 +--
kpeople/nepomuk-feeder/telepathycontact.cpp | 5 +++--
kpeople/nepomuk-feeder/telepathycontact.h | 3 +++
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/kpeople/nepomuk-feeder/telepathyaccount.cpp b/kpeople/nepomuk-feeder/telepathyaccount.cpp
index 094d14c..1a0e093 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.cpp
+++ b/kpeople/nepomuk-feeder/telepathyaccount.cpp
@@ -282,6 +282,13 @@ void TelepathyAccount::onContactsUpgraded(Tp::PendingOperation* op)
foreach (Tp::ContactPtr contact, pc->contacts()) {
TelepathyContact *tpcontact = new TelepathyContact(contact, m_connection, m_accountResource, this);
m_contacts.insert(contact, tpcontact);
+
+ // We need to connect to the TelepathyContact's destroyed signal to remove it from the hash
+ // when it is detroyed.
+ connect(tpcontact,
+ SIGNAL(contactDestroyed(Tp::ContactPtr)),
+ SLOT(onContactDestroyed(Tp::ContactPtr)));
+
if (tpcontact->avatarToken().isEmpty()) {
// We totally need to retrieve the avatar
avatarsToRetrieve << contact->handle().toList();
@@ -378,12 +385,13 @@ void TelepathyAccount::onContactAvatarUpdated(uint contact, const QString& token
}
}
-void TelepathyAccount::removeContact(const Tp::ContactPtr &contact)
+void TelepathyAccount::onContactDestroyed(const Tp::ContactPtr &contact)
{
if (!contact.isNull()) {
m_contacts.remove(contact);
}
}
+
#include "telepathyaccount.moc"
diff --git a/kpeople/nepomuk-feeder/telepathyaccount.h b/kpeople/nepomuk-feeder/telepathyaccount.h
index dd73b18..29f39f4 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.h
+++ b/kpeople/nepomuk-feeder/telepathyaccount.h
@@ -53,8 +53,6 @@ public:
explicit TelepathyAccount(const QString &path, TelepathyAccountMonitor *parent = 0);
~TelepathyAccount();
- void removeContact(const Tp::ContactPtr &contact);
-
private Q_SLOTS:
void onAccountReady(Tp::PendingOperation *op);
void onHaveConnectionChanged(bool haveConnection);
@@ -65,6 +63,7 @@ private Q_SLOTS:
void onAvatarChanged(const Tp::Avatar &avatar);
void onContactAvatarRetrieved(uint contact, const QString &token, const QByteArray &avatar, const QString &mimetype);
void onContactAvatarUpdated(uint contact, const QString &token);
+ void onContactDestroyed(const Tp::ContactPtr &contact);
private:
Q_DISABLE_COPY(TelepathyAccount);
diff --git a/kpeople/nepomuk-feeder/telepathycontact.cpp b/kpeople/nepomuk-feeder/telepathycontact.cpp
index 0a36aaf..6e4a2e6 100644
--- a/kpeople/nepomuk-feeder/telepathycontact.cpp
+++ b/kpeople/nepomuk-feeder/telepathycontact.cpp
@@ -80,9 +80,10 @@ TelepathyContact::TelepathyContact(Tp::ContactPtr contact,
TelepathyContact::~TelepathyContact()
{
- // Remove from cache
- m_parent->removeContact(m_contact);
kDebug();
+
+ // Signal this contact is destroyed so it can be removed from the Hash.
+ Q_EMIT contactDestroyed(m_contact);
}
void TelepathyContact::doNepomukSetup()
diff --git a/kpeople/nepomuk-feeder/telepathycontact.h b/kpeople/nepomuk-feeder/telepathycontact.h
index 9710754..6d5ec52 100644
--- a/kpeople/nepomuk-feeder/telepathycontact.h
+++ b/kpeople/nepomuk-feeder/telepathycontact.h
@@ -49,6 +49,9 @@ public:
QString avatarToken() const;
void setAvatar(const QString &token, const QByteArray &data);
+Q_SIGNALS:
+ void contactDestroyed(const Tp::ContactPtr &contact);
+
private Q_SLOTS:
void onAliasChanged(const QString &alias);
void onPresenceChanged(const QString &status, uint type, const QString &message);
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list