summaryrefslogtreecommitdiffabout
path: root/kabc/phonenumber.cpp
Unidiff
Diffstat (limited to 'kabc/phonenumber.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/phonenumber.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 897c56d..12b9b09 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -191,97 +191,97 @@ int PhoneNumber::type() const
191{ 191{
192 return mType; 192 return mType;
193} 193}
194 194
195QString PhoneNumber::typeLabel() const 195QString PhoneNumber::typeLabel() const
196{ 196{
197 QString label; 197 QString label;
198 bool first = true; 198 bool first = true;
199 199
200 TypeList list = typeList(); 200 TypeList list = typeList();
201 201
202 TypeList::Iterator it; 202 TypeList::Iterator it;
203 for ( it = list.begin(); it != list.end(); ++it ) { 203 for ( it = list.begin(); it != list.end(); ++it ) {
204 if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { 204 if ( ( type() & (*it) ) && ( (*it) != Pref ) ) {
205 label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); 205 label.append( ( first ? "" : "/" ) + typeLabel( *it ) );
206 if ( first ) 206 if ( first )
207 first = false; 207 first = false;
208 } 208 }
209 } 209 }
210 210
211 return label; 211 return label;
212} 212}
213 213
214QString PhoneNumber::label() const 214QString PhoneNumber::label() const
215{ 215{
216 return typeLabel( type() ); 216 return typeLabel( type() );
217} 217}
218 218
219PhoneNumber::TypeList PhoneNumber::typeList() 219PhoneNumber::TypeList PhoneNumber::typeList()
220{ 220{
221 TypeList list; 221 TypeList list;
222 222
223 list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video 223 list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video
224 << Bbs << Modem << Car << Isdn << Pcs << Pager; 224 << Bbs << Modem << Car << Isdn << Pcs << Pager;
225 225
226 return list; 226 return list;
227} 227}
228PhoneNumber::TypeList PhoneNumber::supportedTypeList() 228PhoneNumber::TypeList PhoneNumber::supportedTypeList()
229{ 229{
230 static TypeList list; 230 static TypeList list;
231 if ( list.count() == 0 ) 231 if ( list.count() == 0 )
232 list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< (Pcs|Voice)<< Home << Work << Car << Pcs <<(Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Msg << Pref << Voice; 232 list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< (Pcs|Voice)<< Home << Work << Car << Pcs <<(Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Msg << Pref << Voice;
233 return list; 233 return list;
234} 234}
235QStringList PhoneNumber::supportedTypeListNames() 235QStringList PhoneNumber::supportedTypeListNames()
236{ 236{
237 static QStringList list; 237 static QStringList list;
238 if ( list.count() == 0 ) 238 if ( list.count() == 0 )
239 list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("SIP2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Callback") << i18n("Primary")<< i18n("Other"); 239 list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SiP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("SiP2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Callback") << i18n("Primary")<< i18n("Other");
240 return list; 240 return list;
241} 241}
242 242
243int PhoneNumber::typeListIndex4Type(int type ) 243int PhoneNumber::typeListIndex4Type(int type )
244{ 244{
245 TypeList list = supportedTypeList(); 245 TypeList list = supportedTypeList();
246 int i = 0; 246 int i = 0;
247 while ( i < list.count() ) { 247 while ( i < list.count() ) {
248 if ( list [i] == type ) 248 if ( list [i] == type )
249 return i; 249 return i;
250 ++i; 250 ++i;
251 } 251 }
252 return list.count()-1; 252 return list.count()-1;
253} 253}
254 254
255QString PhoneNumber::label( int type ) 255QString PhoneNumber::label( int type )
256{ 256{
257 return typeLabel( type ); 257 return typeLabel( type );
258} 258}
259 259
260QString PhoneNumber::typeLabel( int type ) 260QString PhoneNumber::typeLabel( int type )
261{ 261{
262 if ((type & Cell) == Cell) 262 if ((type & Cell) == Cell)
263 return i18n("Mobile"); 263 return i18n("Mobile");
264 if ((type & Home) == Home) { 264 if ((type & Home) == Home) {
265 if ((type & Pref) == Pref) 265 if ((type & Pref) == Pref)
266 return i18n("Home"); 266 return i18n("Home");
267 if ((type & Fax) == Fax) 267 if ((type & Fax) == Fax)
268 return i18n("Fax (Home)"); 268 return i18n("Fax (Home)");
269 return i18n("Home2"); 269 return i18n("Home2");
270 } 270 }
271 271
272 if ((type & Work) == Work) { 272 if ((type & Work) == Work) {
273 if ((type & Pref) == Pref) 273 if ((type & Pref) == Pref)
274 return i18n("Work"); 274 return i18n("Work");
275 if ((type & Fax) == Fax) 275 if ((type & Fax) == Fax)
276 return i18n("Fax (Work)"); 276 return i18n("Fax (Work)");
277 if ((type & Msg) == Msg) { 277 if ((type & Msg) == Msg) {
278 if ((type & Voice) == Voice) 278 if ((type & Voice) == Voice)
279 return i18n("Assistent"); 279 return i18n("Assistent");
280 return i18n("Company"); 280 return i18n("Company");
281 } 281 }
282 return i18n("Work2"); 282 return i18n("Work2");
283 } 283 }
284 if ((type & Pcs) == Pcs) { 284 if ((type & Pcs) == Pcs) {
285 if ((type & Pref) == Pref) 285 if ((type & Pref) == Pref)
286 return i18n("SiP"); 286 return i18n("SiP");
287 if ((type & Voice) == Voice) 287 if ((type & Voice) == Voice)