emailuis/nmailui/src/nmmailboxlistviewitem.cpp
changeset 40 2c62ef3caffd
parent 23 2dc6caa42ec3
child 30 759dc5235cdb
equal deleted inserted replaced
39:b0b89ca206b5 40:2c62ef3caffd
    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());