[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:23:12 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=1d10cb7
The following commit has been merged in the master branch:
commit 1d10cb760d8ae7f1fb34c98c3a6820ffba7c6726
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sun Jan 20 13:58:41 2013 +0000
Remove pointless hash of chat state inside ChannelContactsModel
REVIEW: 108506
---
lib/channel-contact-model.cpp | 9 ++++-----
lib/channel-contact-model.h | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/channel-contact-model.cpp b/lib/channel-contact-model.cpp
index da37766..109e6b1 100644
--- a/lib/channel-contact-model.cpp
+++ b/lib/channel-contact-model.cpp
@@ -31,10 +31,11 @@ ChannelContactModel::ChannelContactModel(const Tp::TextChannelPtr &channel, QObj
void ChannelContactModel::setTextChannel(const Tp::TextChannelPtr &channel)
{
+ m_channel = channel;
+
//remove existing contacts in list
beginRemoveRows(QModelIndex(), 0, m_contacts.size());
m_contacts.clear();
- m_chatState.clear();
endRemoveRows();
//add existing contacts from channel
@@ -86,7 +87,7 @@ QVariant ChannelContactModel::data(const QModelIndex &index, int role) const
case Qt::DecorationRole:
{
const Tp::ContactPtr contact = m_contacts[row];
- if (m_chatState.contains(contact) && m_chatState[contact] == Tp::ChannelChatStateComposing) {
+ if (m_channel->chatState(contact) == Tp::ChannelChatStateComposing) {
return KIcon(QLatin1String("document-edit"));
}
@@ -171,16 +172,14 @@ void ChannelContactModel::removeContacts(const Tp::Contacts &contacts)
beginRemoveRows(QModelIndex(), m_contacts.indexOf(contact), m_contacts.indexOf(contact));
m_contacts.removeAll(contact);
- m_chatState.remove(contact);
endRemoveRows();
}
}
void ChannelContactModel::onChatStateChanged(const Tp::ContactPtr &contact, Tp::ChannelChatState state)
{
+ Q_UNUSED(state)
const QModelIndex index = createIndex(m_contacts.lastIndexOf(contact), 0);
-
- m_chatState[contact] = state;
dataChanged(index, index);
}
diff --git a/lib/channel-contact-model.h b/lib/channel-contact-model.h
index 031a98c..b03346b 100644
--- a/lib/channel-contact-model.h
+++ b/lib/channel-contact-model.h
@@ -67,10 +67,10 @@ private Q_SLOTS:
private:
+ Tp::TextChannelPtr m_channel;
void addContacts(const Tp::Contacts &contacts);
void removeContacts(const Tp::Contacts &contacts);
QList<Tp::ContactPtr> m_contacts;
- QHash<Tp::ContactPtr, Tp::ChannelChatState> m_chatState;
};
#endif // CHANNEL_CONTACT_MODEL_H
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list