[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:05:02 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=27dc07f
The following commit has been merged in the master branch:
commit 27dc07f5191656f32ddec1a3b43d222fe0711d2e
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Wed Feb 23 12:02:35 2011 +0100
Don't show the overlay for offline contacts
---
contactoverlays.cpp | 22 +++++++++++-----------
fakecontactsmodel.cpp | 2 +-
main-widget.cpp | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/contactoverlays.cpp b/contactoverlays.cpp
index 819b372..4f73373 100644
--- a/contactoverlays.cpp
+++ b/contactoverlays.cpp
@@ -130,11 +130,11 @@ void TextChannelContactOverlay::slotClicked(bool checked)
bool TextChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
-
- if (m_referenceModel)
- {
- }
- return true;
+ if(index.data(ModelRoles::UserStatusRole).value<Tp::ConnectionPresenceType>() == Tp::ConnectionPresenceTypeOffline) {
+ return false;
+ }
+
+ return true;
}
// ------------------------------------------------------------------------
@@ -242,10 +242,10 @@ void AudioChannelContactOverlay::slotClicked(bool checked)
bool AudioChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
-
- if (m_referenceModel)
- {
+ if(index.data(ModelRoles::UserStatusRole).value<Tp::ConnectionPresenceType>() == Tp::ConnectionPresenceTypeOffline) {
+ return false;
}
+
return true;
}
@@ -353,9 +353,9 @@ void VideoChannelContactOverlay::slotClicked(bool checked)
bool VideoChannelContactOverlay::checkIndex(const QModelIndex& index) const
{
-
- if (m_referenceModel)
- {
+ if(index.data(ModelRoles::UserStatusRole).value<Tp::ConnectionPresenceType>() == Tp::ConnectionPresenceTypeOffline) {
+ return false;
}
+
return true;
}
\ No newline at end of file
diff --git a/fakecontactsmodel.cpp b/fakecontactsmodel.cpp
index 83f71c6..78a905c 100644
--- a/fakecontactsmodel.cpp
+++ b/fakecontactsmodel.cpp
@@ -154,7 +154,7 @@ QVariant FakeContactsModel::data(const QModelIndex& index, int role) const
}
else if(role == ModelRoles::UserStatusRole)
{
- return contact->data()->presence().type();
+ return QVariant::fromValue<Tp::ConnectionPresenceType>(contact->data()->presence().type());
}
else if(role == ModelRoles::UserStatusMsgRole)
{
diff --git a/main-widget.cpp b/main-widget.cpp
index 84a2596..224e33c 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -109,7 +109,7 @@ void ContactDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opt
QPixmap icon;
- switch(idx.data(ModelRoles::UserStatusRole).toInt())
+ switch(idx.data(ModelRoles::UserStatusRole).value<Tp::ConnectionPresenceType>())
{
case Tp::ConnectionPresenceTypeAvailable:
icon = SmallIcon("user-online", KIconLoader::SizeSmallMedium);
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list