equal
deleted
inserted
replaced
44 |
44 |
45 /*! |
45 /*! |
46 * Constructor |
46 * Constructor |
47 */ |
47 */ |
48 |
48 |
49 CntDisplayLabel::CntDisplayLabel() : |
49 CntDisplayLabel::CntDisplayLabel() |
50 m_nameOrder(CntOrderFirstLast) |
|
51 { |
50 { |
52 #ifdef SYMBIAN_BACKEND_USE_SQLITE |
51 #ifdef SYMBIAN_BACKEND_USE_SQLITE |
53 m_settings = new CntCenrep(KCntNameOrdering, *this); |
52 m_settings = new CntCenrep(KCntNameOrdering, *this); |
54 m_nameOrder = m_settings->getValue(); |
53 m_nameOrder = m_settings->getValue(); |
55 #endif |
54 #endif |
95 #endif |
94 #endif |
96 |
95 |
97 contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), firstLatin)); |
96 contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), firstLatin)); |
98 contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), secondLatin)); |
97 contactPrefferedDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), secondLatin)); |
99 m_contactDisplayLabelDetails.append(contactPrefferedDisplayLabelDetails); |
98 m_contactDisplayLabelDetails.append(contactPrefferedDisplayLabelDetails); |
100 |
|
101 //if preferred details doesn't exist use these |
|
102 QList<QPair<QLatin1String, QLatin1String> > contactSecondaryDisplayLabelDetails; |
|
103 contactSecondaryDisplayLabelDetails.append(qMakePair(QLatin1String(QContactOrganization::DefinitionName), QLatin1String(QContactOrganization::FieldName))); |
|
104 m_contactDisplayLabelDetails.append(contactSecondaryDisplayLabelDetails); |
|
105 |
99 |
106 //Group |
100 //Group |
107 QList<QPair<QLatin1String, QLatin1String> > preferredGroupDisplayLabelDetails; |
101 QList<QPair<QLatin1String, QLatin1String> > preferredGroupDisplayLabelDetails; |
108 preferredGroupDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), QLatin1String(QContactName::FieldCustomLabel))); |
102 preferredGroupDisplayLabelDetails.append(qMakePair(QLatin1String(QContactName::DefinitionName), QLatin1String(QContactName::FieldCustomLabel))); |
109 m_groupDisplayLabelDetails.append(preferredGroupDisplayLabelDetails); |
103 m_groupDisplayLabelDetails.append(preferredGroupDisplayLabelDetails); |
173 else{ //read the value and append it to the display label |
167 else{ //read the value and append it to the display label |
174 QString label = contactDetail.value(detailPairList.at(j).second); |
168 QString label = contactDetail.value(detailPairList.at(j).second); |
175 |
169 |
176 if(!label.isEmpty()) |
170 if(!label.isEmpty()) |
177 { |
171 { |
|
172 #ifdef SYMBIAN_BACKEND_USE_SQLITE |
178 // Inlcude a comma if needed in the display label |
173 // Inlcude a comma if needed in the display label |
179 if (m_nameOrder == CntOrderLastCommaFirst) |
174 if (m_nameOrder == CntOrderLastCommaFirst) |
180 displayLabel.append(comma()); |
175 displayLabel.append(comma()); |
|
176 #endif |
181 displayLabel.append(delimiter()); |
177 displayLabel.append(delimiter()); |
182 displayLabel.append(label); |
178 displayLabel.append(label); |
183 } |
179 } |
184 } |
180 } |
185 } |
181 } |