author | ulf69 <ulf69> | 2004-07-13 15:07:00 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-13 15:07:00 (UTC) |
commit | 02380b50374340283fe9dd0f804254ee17374347 (patch) (unidiff) | |
tree | 83928927651c22dd0231195f84b0614ba6442254 | |
parent | f88d48384d2c012fbaa3ffaa613d6eaa3694fab7 (diff) | |
download | kdepimpi-02380b50374340283fe9dd0f804254ee17374347.zip kdepimpi-02380b50374340283fe9dd0f804254ee17374347.tar.gz kdepimpi-02380b50374340283fe9dd0f804254ee17374347.tar.bz2 |
more changes to resolve the "other" problematic.
e.g. home+pref was shown as "other".
-rw-r--r-- | kabc/phonenumber.cpp | 107 |
1 files changed, 47 insertions, 60 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 04b1168..3f641d1 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp | |||
@@ -137,67 +137,54 @@ QString PhoneNumber::label( int type ) | |||
137 | 137 | ||
138 | QString PhoneNumber::typeLabel( int type ) | 138 | QString PhoneNumber::typeLabel( int type ) |
139 | { | 139 | { |
140 | switch ( type ) { | 140 | QString typeString; |
141 | case Home: | 141 | |
142 | return i18n("Home phone", "Home"); | 142 | if ((type & Home) == Home) |
143 | break; | 143 | typeString += i18n("Home"); |
144 | case Work: | 144 | else if ((type & Work) == Work) |
145 | return i18n("Work phone", "Work"); | 145 | typeString += i18n("Work"); |
146 | break; | 146 | |
147 | case Msg: | 147 | if (!typeString.isEmpty()) |
148 | return i18n("Messenger"); | 148 | typeString += " "; |
149 | break; | 149 | |
150 | case Pref: | 150 | if ((type & Cell) == Cell) |
151 | return i18n("Preferred Number"); | 151 | typeString += i18n("Mobile"); |
152 | break; | 152 | else if ((type & Fax) == Fax) |
153 | case Voice: | 153 | typeString += i18n("Fax"); |
154 | return i18n("Voice"); | 154 | else if ((type & Msg) == Msg) |
155 | break; | 155 | typeString += i18n("Messenger"); |
156 | case Fax: | 156 | else if ((type & Voice) == Voice) { |
157 | return i18n("Fax"); | 157 | // add nothing in case of the Voice flag |
158 | break; | 158 | // typeString += i18n("Voice"); |
159 | case Cell: | 159 | } |
160 | return i18n("Mobile Phone" ); | 160 | else if ((type & Video) == Video) |
161 | break; | 161 | typeString += i18n("Video"); |
162 | case Cell | Home: | 162 | else if ((type & Bbs) == Bbs) |
163 | return i18n("Home Mobile" ); | 163 | typeString += i18n("Mailbox"); |
164 | break; | 164 | else if ((type & Modem) == Modem) |
165 | case Cell | Work: | 165 | typeString += i18n("Modem"); |
166 | return i18n("Home Mobile" ); | 166 | else if ((type & Car) == Car) |
167 | break; | 167 | typeString += i18n("Car"); |
168 | case Video: | 168 | else if ((type & Isdn) == Isdn) |
169 | return i18n("Video"); | 169 | typeString += i18n("ISDN"); |
170 | break; | 170 | else if ((type & Pcs) == Pcs) |
171 | case Bbs: | 171 | typeString += i18n("PCS"); |
172 | return i18n("Mailbox"); | 172 | else if ((type & Pager) == Pager) |
173 | break; | 173 | typeString += i18n("Pager"); |
174 | case Modem: | 174 | |
175 | return i18n("Modem"); | 175 | // add the prefered flag |
176 | break; | 176 | if (!typeString.isEmpty()) |
177 | case Car: | 177 | typeString += " "; |
178 | return i18n("Car Phone", "Car" ); | 178 | |
179 | break; | 179 | if ((type & Pref) == Pref) |
180 | case Isdn: | 180 | typeString += i18n("(Preferred)"); |
181 | return i18n("ISDN"); | 181 | |
182 | break; | 182 | //if we still have no match, return "other" |
183 | case Pcs: | 183 | if (typeString.isEmpty()) |
184 | return i18n("PCS"); | ||
185 | break; | ||
186 | case Pager: | ||
187 | return i18n("Pager"); | ||
188 | break; | ||
189 | case Work | Pager: | ||
190 | return i18n("Work Pager"); | ||
191 | break; | ||
192 | case Home | Fax: | ||
193 | return i18n("Home Fax"); | ||
194 | break; | ||
195 | case Work | Fax: | ||
196 | return i18n("Work Fax"); | ||
197 | break; | ||
198 | default: | ||
199 | return i18n("Other"); | 184 | return i18n("Other"); |
200 | } | 185 | |
186 | |||
187 | return typeString; | ||
201 | } | 188 | } |
202 | 189 | ||
203 | QDataStream &KABC::operator<<( QDataStream &s, const PhoneNumber &phone ) | 190 | QDataStream &KABC::operator<<( QDataStream &s, const PhoneNumber &phone ) |