summaryrefslogtreecommitdiffabout
path: root/kabc/phonenumber.cpp
authorzautrix <zautrix>2005-10-28 03:24:50 (UTC)
committer zautrix <zautrix>2005-10-28 03:24:50 (UTC)
commitf83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e (patch) (unidiff)
tree969e6cf85499e3b1dcaa4dc24c972b65c906cfa9 /kabc/phonenumber.cpp
parentcbda16d4966c7483d20d1b6b5a64c8af367ea732 (diff)
downloadkdepimpi-f83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e.zip
kdepimpi-f83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e.tar.gz
kdepimpi-f83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e.tar.bz2
many new bugs...
Diffstat (limited to 'kabc/phonenumber.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/phonenumber.cpp112
1 files changed, 110 insertions, 2 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 4c6231d..0d46ba7 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -67,3 +67,58 @@ bool PhoneNumber::operator!=( const PhoneNumber &p ) const
67} 67}
68void PhoneNumber::makeCompat()
69{
70 mType = getCompatType( mType );
71}
72int PhoneNumber::getCompatType( int type )
73{
74
75 if ((type & Cell) == Cell) {
76 if ((type & Work) == Work)
77 return Car;
78 return Cell;
79 }
80 if ((type & Home) == Home) {
81 if ((type & Pref) == Pref)
82 return (Home | Pref);
83 if ((type & Fax) == Fax)
84 return (Home | Fax);
85 return (Home);
86 }
87 if ((type & Work) == Work) {
88 if ((type & Pref) == Pref)
89 return (Work| Pref);
90 if ((type & Fax) == Fax)
91 return (Fax |Work);
92 if ((type & Msg) == Msg) {
93 if ((type & Voice) == Voice)
94 return ( Msg | Voice |Work);
95 return ( Msg | Work);
96 }
97 return Work;
98 }
99 if ((type & Pcs) == Pcs) {
100 if ((type & Pref) == Pref)
101 return Pcs | Pref;
102 return Pcs;
103 }
104 if ((type & Car) == Car)
105 return Car;
106 if ((type & Pager) == Pager)
107 return Pager;
108 if ((type & Isdn) == Isdn)
109 return Isdn;
110 if ((type & Video) == Video)
111 return Video;
112
113 if ((type & Msg) == Msg)
114 return Msg;
115 if ((type & Fax) == Fax)
116 return Fax;
117
118 if ((type & Pref) == Pref)
119 return Pref;
68 120
121 return Voice;
122
123}
69bool PhoneNumber::simplifyNumber() 124bool PhoneNumber::simplifyNumber()
@@ -165,3 +220,3 @@ PhoneNumber::TypeList PhoneNumber::typeList()
165 list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video 220 list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video
166 << Bbs << Modem << Car << Isdn << Pcs << Pager << Sip; 221 << Bbs << Modem << Car << Isdn << Pcs << Pager;
167 222
@@ -177,4 +232,56 @@ QString PhoneNumber::typeLabel( int type )
177{ 232{
178 QString typeString; 233 if ((type & Cell) == Cell)
234 return i18n("Mobile");
235 if ((type & Home) == Home) {
236 if ((type & Pref) == Pref)
237 return i18n("Home");
238 if ((type & Fax) == Fax)
239 return i18n("Fax (Home)");
240 return i18n("Home2");
241 }
179 242
243 if ((type & Work) == Work) {
244 if ((type & Pref) == Pref)
245 return i18n("Work");
246 if ((type & Fax) == Fax)
247 return i18n("Fax (Work)");
248 if ((type & Msg) == Msg) {
249 if ((type & Voice) == Voice)
250 return i18n("Assistent");
251 return i18n("Company");
252 }
253 return i18n("Work2");
254 }
255 if ((type & Pcs) == Pcs) {
256 if ((type & Pref) == Pref)
257 return i18n("SIP");
258 return i18n("VoIP");
259 }
260 if ((type & Car) == Car)
261 return i18n("Mobile2 (Work)");
262 if ((type & Pager) == Pager)
263 return i18n("Pager");
264 if ((type & Isdn) == Isdn)
265 return i18n("ISDN");
266 if ((type & Video) == Video)
267 return i18n("Video");
268
269 if ((type & Msg) == Msg)
270 return i18n("Callback");
271 if ((type & Fax) == Fax)
272 return i18n("Fax (Other)");
273
274 if ((type & Pref) == Pref)
275 return i18n("Primary");
276
277
278 return i18n("Other");
279
280
281#if 0
282
283
284
285 QString typeString;
286
180 287
@@ -222,2 +329,3 @@ QString PhoneNumber::typeLabel( int type )
222 return typeString.stripWhiteSpace(); 329 return typeString.stripWhiteSpace();
330#endif
223} 331}