52 void NmMailboxListViewItem::updateChildItems() |
52 void NmMailboxListViewItem::updateChildItems() |
53 { |
53 { |
54 // To create primitives |
54 // To create primitives |
55 HbListViewItem::updateChildItems(); |
55 HbListViewItem::updateChildItems(); |
56 |
56 |
|
57 EmailMailboxInfo mailboxInfo; |
|
58 |
57 NmMailboxMetaData *mailbox = |
59 NmMailboxMetaData *mailbox = |
58 modelIndex().data(Qt::DisplayRole).value<NmMailboxMetaData*>(); |
60 modelIndex().data(Qt::DisplayRole).value<NmMailboxMetaData*>(); |
59 if (mailbox){ |
61 if (mailbox){ |
60 mLayout = new QGraphicsLinearLayout(Qt::Horizontal, 0); |
62 mLayout = new QGraphicsLinearLayout(Qt::Horizontal, 0); |
61 mLayout->setContentsMargins(0,0,0,0); |
63 mLayout->setContentsMargins(0,0,0,0); |
62 |
64 |
63 HbLabel *mbIcon = new HbLabel(); |
65 HbLabel *mbIcon = new HbLabel(); |
64 mbIcon->setObjectName("MailboxListViewMailboxIcon"); |
66 mbIcon->setObjectName("MailboxListViewMailboxIcon"); |
65 mbIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconDefaultMailbox)); |
67 |
|
68 QString domainName = mailbox->address(); |
|
69 QString iconName = mailboxInfo.mailboxIcon(domainName); |
|
70 mbIcon->setIcon(HbIcon(iconName)); |
66 mbIcon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); |
71 mbIcon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); |
67 |
72 |
68 HbLabel *mbName = new HbLabel(); |
73 HbLabel *mbName = new HbLabel(); |
69 mbName->setObjectName("MailboxListViewMailboxName"); |
74 mbName->setObjectName("MailboxListViewMailboxName"); |
70 mbName->setPlainText(mailbox->name()); |
75 mbName->setPlainText(mailbox->name()); |