[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:04:35 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=3c8bc50
The following commit has been merged in the master branch:
commit 3c8bc5071841b60988eccba01fd3b02ecc1b6706
Author: George Goldberg <grundleborg at googlemail.com>
Date: Sat Mar 6 21:10:46 2010 +0000
When a contact item's resources in Nepomuk change, tell the view that model data changed.
svn path=/trunk/playground/network/telepathy-contactlist/; revision=1100124
---
contact-item.cpp | 2 ++
contact-item.h | 3 +++
contacts-list-model.cpp | 16 +++++++++++++++-
contacts-list-model.h | 3 +++
4 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/contact-item.cpp b/contact-item.cpp
index b5074c2..6470fef 100644
--- a/contact-item.cpp
+++ b/contact-item.cpp
@@ -103,6 +103,8 @@ const KIcon& ContactItem::presenceIcon() const
void ContactItem::onStatementAdded(const Soprano::Statement &statement)
{
kDebug() << "Statement added called.";
+
+ Q_EMIT dirty();
}
diff --git a/contact-item.h b/contact-item.h
index 8431184..7bdf85c 100644
--- a/contact-item.h
+++ b/contact-item.h
@@ -46,6 +46,9 @@ public:
virtual void onStatementAdded(const Soprano::Statement &statement);
+Q_SIGNALS:
+ void dirty();
+
private Q_SLOTS:
void updatePresenceIcon();
diff --git a/contacts-list-model.cpp b/contacts-list-model.cpp
index 66aff4a..1f251f8 100644
--- a/contacts-list-model.cpp
+++ b/contacts-list-model.cpp
@@ -68,7 +68,9 @@ ContactsListModel::ContactsListModel(QObject *parent)
kDebug() << this << ": Found Contact:" << foundIMAccount.imIDs().first();
// And create a ContactItem for each one.
- m_contactItems.append(new ContactItem(foundPersonContact, foundIMAccount, this));
+ ContactItem *item = new ContactItem(foundPersonContact, foundIMAccount, this);
+ m_contactItems.append(item);
+ connect(item, SIGNAL(dirty()), SLOT(onItemDirty()));
}
}
@@ -164,6 +166,18 @@ QVariant ContactsListModel::headerData(int section, Qt::Orientation orientation,
return QVariant();
}
+void ContactsListModel::onItemDirty()
+{
+ ContactItem *item = qobject_cast<ContactItem*>(sender());
+
+ Q_ASSERT(item);
+ if (!item) {
+ kWarning() << "Invalid sender.";
+ }
+
+ QModelIndex itemIndex = index(m_contactItems.indexOf(item), 0, QModelIndex());
+ Q_EMIT dataChanged(itemIndex, itemIndex);
+}
#include "contacts-list-model.moc"
diff --git a/contacts-list-model.h b/contacts-list-model.h
index 9ee4af6..3d3857f 100644
--- a/contacts-list-model.h
+++ b/contacts-list-model.h
@@ -46,6 +46,9 @@ public:
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
+private Q_SLOTS:
+ void onItemDirty();
+
private:
Q_DISABLE_COPY(ContactsListModel);
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list