phonebookui/pbkcommonui/src/cntactionpopup_p.cpp
changeset 59 a642906a277a
parent 47 7cbcb2896f0e
equal deleted inserted replaced
47:7cbcb2896f0e 59:a642906a277a
    38 {
    38 {
    39     mContact = new QContact( *aContact );
    39     mContact = new QContact( *aContact );
    40     mListView = new HbListView(this);
    40     mListView = new HbListView(this);
    41     mListModel = new QStandardItemModel(this);
    41     mListModel = new QStandardItemModel(this);
    42     setAttribute(Qt::WA_DeleteOnClose, true);
    42     setAttribute(Qt::WA_DeleteOnClose, true);
       
    43     mDataItemList.clear();
    43 }
    44 }
    44 
    45 
    45 CntActionPopupPrivate::~CntActionPopupPrivate()
    46 CntActionPopupPrivate::~CntActionPopupPrivate()
    46 {
    47 {
    47     delete mContact;
    48     delete mContact;
   167     }
   168     }
   168     else if (action.compare("email", Qt::CaseInsensitive) == 0 )
   169     else if (action.compare("email", Qt::CaseInsensitive) == 0 )
   169     {
   170     {
   170         buildEmailActionPopup();
   171         buildEmailActionPopup();
   171     }
   172     }
   172     else
   173     
   173     {
   174     if(mDataItemList.count())
   174         return false;
   175     {
   175     }
   176         showPopup();
   176     showPopup();
   177         return true;
   177     return true; 
   178     }
       
   179     return false; 
   178     
   180     
   179 }
   181 }
   180 
   182 
   181 void CntActionPopupPrivate::showPopup()
   183 void CntActionPopupPrivate::showPopup()
   182 {
   184 {
   192     mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
   194     mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
   193     mListView->setFrictionEnabled(true);
   195     mListView->setFrictionEnabled(true);
   194     mListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum );
   196     mListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum );
   195     
   197     
   196     QString contactName = mContact->displayLabel();
   198     QString contactName = mContact->displayLabel();
       
   199     if (contactName.isEmpty())
       
   200     {
       
   201         contactName = hbTrId("txt_phob_list_unnamed");
       
   202     }
   197     HbLabel *label = new HbLabel();
   203     HbLabel *label = new HbLabel();
   198     label->setPlainText(contactName);
   204     label->setPlainText(contactName);
   199     
   205     
   200     setHeadingWidget(label);
   206     setHeadingWidget(label);
   201     setContentWidget(mListView);
   207     setContentWidget(mListView);