Skip to content
Snippets Groups Projects
Commit d46dae87 authored by Alexandre Lision's avatar Alexandre Lision Committed by Stepan Salenikovich
Browse files

phonedirectorymodel: revert roledata delegation

Change introduced in 47ab47c2,
breaking the RecentModel generation

This also uses the new decorationRole delegate method.

Change-Id: I1c27385bf55e990f0a0ed087696547e245814b19
Tuleap: #170
parent 47ab47c2
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,15 @@ QVariant PhoneDirectoryModel::data(const QModelIndex& index, int role ) const ...@@ -104,7 +104,15 @@ QVariant PhoneDirectoryModel::data(const QModelIndex& index, int role ) const
const ContactMethod* number = d_ptr->m_lNumbers[index.row()]; const ContactMethod* number = d_ptr->m_lNumbers[index.row()];
switch (static_cast<PhoneDirectoryModelPrivate::Columns>(index.column())) { switch (static_cast<PhoneDirectoryModelPrivate::Columns>(index.column())) {
case PhoneDirectoryModelPrivate::Columns::URI: case PhoneDirectoryModelPrivate::Columns::URI:
return number->roleData(role); switch (role) {
case Qt::DisplayRole:
return number->uri();
case Qt::DecorationRole :
return GlobalInstances::pixmapManipulator().decorationRole(number);
case (int) Role::Object:
return QVariant::fromValue(const_cast<ContactMethod*>(number));
}
break;
case PhoneDirectoryModelPrivate::Columns::TYPE: case PhoneDirectoryModelPrivate::Columns::TYPE:
switch (role) { switch (role) {
case Qt::DisplayRole: case Qt::DisplayRole:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment