equal
deleted
inserted
replaced
124 * \a detailList contains the details to be read from the contact |
124 * \a detailList contains the details to be read from the contact |
125 * \return synthesised display label |
125 * \return synthesised display label |
126 */ |
126 */ |
127 QString CntDisplayLabel::generateDisplayLabel( const QContact &contact, const QList<QList<QPair<QLatin1String, QLatin1String> > > detailList) const |
127 QString CntDisplayLabel::generateDisplayLabel( const QContact &contact, const QList<QList<QPair<QLatin1String, QLatin1String> > > detailList) const |
128 { |
128 { |
|
129 // Default to empty display label. It is up to the client to create a |
|
130 // localised presentation of a contact without a name. |
129 QString displayLabel(""); |
131 QString displayLabel(""); |
130 |
132 |
131 //loop through the details and create display label |
133 //loop through the details and create display label |
132 for(int i = 0; i < detailList.count() && displayLabel.isEmpty(); i++ ) |
134 for(int i = 0; i < detailList.count() && displayLabel.isEmpty(); i++ ) |
133 { |
135 { |
151 } |
153 } |
152 } |
154 } |
153 } |
155 } |
154 } |
156 } |
155 |
157 |
156 //no display label, set default value |
|
157 if(displayLabel.isEmpty()) |
|
158 { |
|
159 //should the unnamned be read from somewhere? |
|
160 displayLabel = unNamned(); |
|
161 } |
|
162 |
|
163 return displayLabel; |
158 return displayLabel; |
164 } |
159 } |
165 |
160 |
166 /*! |
161 /*! |
167 * delemiter to be used in display label |
162 * delemiter to be used in display label |
169 */ |
164 */ |
170 QString CntDisplayLabel::delimiter() const |
165 QString CntDisplayLabel::delimiter() const |
171 { |
166 { |
172 //this will be variated in the future. |
167 //this will be variated in the future. |
173 return " "; |
168 return " "; |
174 } |
|
175 |
|
176 /*! |
|
177 * return the name used for unknown contacts |
|
178 */ |
|
179 QString CntDisplayLabel::unNamned() const |
|
180 { |
|
181 return "Unnamed"; |
|
182 } |
169 } |
183 |
170 |
184 /*! |
171 /*! |
185 * Returns the details to be used for contact filtering |
172 * Returns the details to be used for contact filtering |
186 */ |
173 */ |