[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:53 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=5f4c841
The following commit has been merged in the master branch:
commit 5f4c8418207e7760c3be275e46853e10c7f3bed1
Author: Lasath Fernando <kde at lasath.org>
Date: Tue Jan 10 19:38:05 2012 +1100
Keep copy of the Avatar in ConversationTarget, so it can be returned more quickly.
---
KTp/Declarative/conversation-target.cpp | 23 ++++++++++++++++-------
KTp/Declarative/conversation-target.h | 1 +
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/KTp/Declarative/conversation-target.cpp b/KTp/Declarative/conversation-target.cpp
index 6befd38..ddb22a4 100644
--- a/KTp/Declarative/conversation-target.cpp
+++ b/KTp/Declarative/conversation-target.cpp
@@ -26,6 +26,7 @@ class ConversationTarget::ConversationTargetPrivate
{
public:
Tp::ContactPtr contact;
+ KIcon avatar;
};
ConversationTarget::ConversationTarget(Tp::ContactPtr contact, QObject* parent) :
@@ -39,6 +40,7 @@ ConversationTarget::ConversationTarget(Tp::ContactPtr contact, QObject* parent)
}
d->contact = contact;
+ updateAvatar();
}
void ConversationTarget::setupContactSignals(Tp::ContactPtr contact)
@@ -50,14 +52,9 @@ void ConversationTarget::setupContactSignals(Tp::ContactPtr contact)
QIcon ConversationTarget::avatar() const
{
- QString path = d->contact->avatarData().fileName;
-
- if (path.isEmpty()) {
- return KIcon(QLatin1String("im-user"));
- } else {
- return QIcon(path);
- }
+ return d->avatar;
}
+
QString ConversationTarget::id() const
{
return d->contact->id();
@@ -115,9 +112,21 @@ void ConversationTarget::onPresenceChanged(const Tp::Presence&)
void ConversationTarget::onAvatarDataChanged(const Tp::AvatarData&)
{
+ updateAvatar();
Q_EMIT avatarChanged(avatar());
}
+void ConversationTarget::updateAvatar()
+{
+ QString path = d->contact->avatarData().fileName;
+
+ if(path.isEmpty()) {
+ path = QLatin1String("im-user");
+ }
+
+ d->avatar = KIcon(path);
+}
+
Tp::ContactPtr ConversationTarget::contact() const
{
return d->contact;
diff --git a/KTp/Declarative/conversation-target.h b/KTp/Declarative/conversation-target.h
index 864296d..3357d00 100644
--- a/KTp/Declarative/conversation-target.h
+++ b/KTp/Declarative/conversation-target.h
@@ -68,6 +68,7 @@ private Q_SLOTS:
private:
void setupContactSignals(Tp::ContactPtr contact);
void removeContactSignals(Tp::ContactPtr contact);
+ void updateAvatar();
class ConversationTargetPrivate;
ConversationTargetPrivate *d;
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list