Skip to content
Snippets Groups Projects
Commit 0f6898c9 authored by aviau's avatar aviau Committed by Stepan Salenikovich
Browse files

itemdataroles: create IsPresent

This adds the new IsPresent Ring Item Data Role so that clients do not
need additional logic when trying to extract the presence of the
different LRC models.

Tuleap: #1379
Change-Id: If1f0130ecd13b3fc57071dcce40d2d71079ad94d
parent 989ab7ac
No related branches found
No related tags found
No related merge requests found
...@@ -2233,6 +2233,7 @@ QVariant Call::roleData(int role) const ...@@ -2233,6 +2233,7 @@ QVariant Call::roleData(int role) const
case static_cast<int>(Call::Role::StopTime): case static_cast<int>(Call::Role::StopTime):
return (int) d_ptr->m_pStopTimeStamp; return (int) d_ptr->m_pStopTimeStamp;
case static_cast<int>(Call::Role::IsPresent): case static_cast<int>(Call::Role::IsPresent):
case static_cast<int>(Ring::Role::IsPresent):
return peerContactMethod()->isPresent(); return peerContactMethod()->isPresent();
case static_cast<int>(Call::Role::IsTracked): case static_cast<int>(Call::Role::IsTracked):
return peerContactMethod()->isTracked(); return peerContactMethod()->isTracked();
......
...@@ -559,6 +559,7 @@ QVariant ContactMethod::roleData(int role) const ...@@ -559,6 +559,7 @@ QVariant ContactMethod::roleData(int role) const
case static_cast<int>(Call::Role::Filter): case static_cast<int>(Call::Role::Filter):
cat = uri()+primaryName(); cat = uri()+primaryName();
break; break;
case static_cast<int>(Ring::Role::IsPresent):
case static_cast<int>(Call::Role::IsPresent): case static_cast<int>(Call::Role::IsPresent):
cat = isPresent(); cat = isPresent();
break; break;
......
...@@ -46,6 +46,7 @@ enum class Role ...@@ -46,6 +46,7 @@ enum class Role
FormattedState , FormattedState ,
Length , Length ,
DropState , DropState ,
IsPresent ,
UnreadTextMessageCount, UnreadTextMessageCount,
UserRole = Qt::UserRole + 100 // this should always be the last role in the list UserRole = Qt::UserRole + 100 // this should always be the last role in the list
}; };
......
...@@ -613,6 +613,8 @@ QVariant Person::roleData(int role) const ...@@ -613,6 +613,8 @@ QVariant Person::roleData(int role) const
return QVariant(QDateTime::fromTime_t( lastUsedTime())); return QVariant(QDateTime::fromTime_t( lastUsedTime()));
case static_cast<int>(Person::Role::Filter): case static_cast<int>(Person::Role::Filter):
return filterString(); return filterString();
case static_cast<int>(Ring::Role::IsPresent):
return isPresent();
case static_cast<int>(Ring::Role::UnreadTextMessageCount): case static_cast<int>(Ring::Role::UnreadTextMessageCount):
{ {
int unread = 0; int unread = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment