summaryrefslogtreecommitdiffabout
path: root/kabc/phonenumber.cpp
Unidiff
Diffstat (limited to 'kabc/phonenumber.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/phonenumber.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 12b9b09..1752745 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -203,64 +203,88 @@ QString PhoneNumber::typeLabel() const
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}
235
236#if 0
237Home| Pref i18n("Home") Home
238Work| Pref i18n("Work") Business
239Cell i18n("Mobile") Mobile
240Pcs|Pref i18n("SiP") Radio
241Pcs|Voice i18n("VoIP") TTY/TTD
242Home i18n("Home2") Home 2
243Work i18n("Work2") Business 2
244Car i18n("Mobile2") Car
245Pcs i18n("SiP2") Telex
246Work| Msg | Voice i18n("Assistent") Assistent
247Work| Msg i18n("Company") Company
248Home | Fax i18n("Fax (Home)") Home Fax
249Work| Fax i18n("Fax (Work)") Business Fax
250Fax i18n("Fax (Other)") Other Fax
251Pager i18n("Pager") Pager
252Isdn i18n("ISDN") Isdn
253Msg i18n("Callback") Callback
254Pref i18n("Primary") Primary
255Voice; i18n("Other") Other
256
257#endif
258
235QStringList PhoneNumber::supportedTypeListNames() 259QStringList PhoneNumber::supportedTypeListNames()
236{ 260{
237 static QStringList list; 261 static QStringList list;
238 if ( list.count() == 0 ) 262 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"); 263 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; 264 return list;
241} 265}
242 266
243int PhoneNumber::typeListIndex4Type(int type ) 267int PhoneNumber::typeListIndex4Type(int type )
244{ 268{
245 TypeList list = supportedTypeList(); 269 TypeList list = supportedTypeList();
246 int i = 0; 270 int i = 0;
247 while ( i < list.count() ) { 271 while ( i < list.count() ) {
248 if ( list [i] == type ) 272 if ( list [i] == type )
249 return i; 273 return i;
250 ++i; 274 ++i;
251 } 275 }
252 return list.count()-1; 276 return list.count()-1;
253} 277}
254 278
255QString PhoneNumber::label( int type ) 279QString PhoneNumber::label( int type )
256{ 280{
257 return typeLabel( type ); 281 return typeLabel( type );
258} 282}
259 283
260QString PhoneNumber::typeLabel( int type ) 284QString PhoneNumber::typeLabel( int type )
261{ 285{
262 if ((type & Cell) == Cell) 286 if ((type & Cell) == Cell)
263 return i18n("Mobile"); 287 return i18n("Mobile");
264 if ((type & Home) == Home) { 288 if ((type & Home) == Home) {
265 if ((type & Pref) == Pref) 289 if ((type & Pref) == Pref)
266 return i18n("Home"); 290 return i18n("Home");