Diffstat (limited to 'libopie2/opiepim/ocontactfields.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/ocontactfields.cpp | 233 |
1 files changed, 122 insertions, 111 deletions
diff --git a/libopie2/opiepim/ocontactfields.cpp b/libopie2/opiepim/ocontactfields.cpp index 7206f0d..0f08a5a 100644 --- a/libopie2/opiepim/ocontactfields.cpp +++ b/libopie2/opiepim/ocontactfields.cpp | |||
@@ -2,223 +2,232 @@ | |||
2 | #include "ocontactfields.h" | 2 | #include "ocontactfields.h" |
3 | 3 | ||
4 | #include <qstringlist.h> | 4 | #include <qstringlist.h> |
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | 6 | ||
7 | // We should use our own enum in the future .. | 7 | // We should use our own enum in the future .. |
8 | #include <qpe/recordfields.h> | 8 | #include <qpe/recordfields.h> |
9 | #include <qpe/config.h> | 9 | #include <qpe/config.h> |
10 | #include <opie/ocontact.h> | 10 | #include <opie/ocontact.h> |
11 | 11 | ||
12 | /*! | 12 | /*! |
13 | \internal | 13 | \internal |
14 | Returns a list of details field names for a contact. | 14 | Returns a list of personal field names for a contact. |
15 | */ | 15 | */ |
16 | QStringList OContactFields::untrdetailsfields( bool sorted ) | 16 | QStringList OContactFields::personalfields( bool sorted, bool translated ) |
17 | { | 17 | { |
18 | QStringList list; | 18 | QStringList list; |
19 | QMap<int, QString> mapIdToStr = idToUntrFields(); | 19 | QMap<int, QString> mapIdToStr; |
20 | if ( translated ) | ||
21 | mapIdToStr = idToTrFields(); | ||
22 | else | ||
23 | mapIdToStr = idToUntrFields(); | ||
20 | 24 | ||
21 | list.append( mapIdToStr[ Qtopia::Office ] ); | 25 | list.append( mapIdToStr[ Qtopia::AddressUid ] ); |
22 | list.append( mapIdToStr[ Qtopia::Profession ] ); | 26 | list.append( mapIdToStr[ Qtopia::AddressCategory ] ); |
23 | list.append( mapIdToStr[ Qtopia::Assistant ] ); | ||
24 | list.append( mapIdToStr[ Qtopia::Manager ] ); | ||
25 | 27 | ||
26 | list.append( mapIdToStr[ Qtopia::Spouse ] ); | 28 | list.append( mapIdToStr[ Qtopia::Title ] ); |
27 | list.append( mapIdToStr[ Qtopia::Gender ] ); | 29 | list.append( mapIdToStr[ Qtopia::FirstName ] ); |
28 | list.append( mapIdToStr[ Qtopia::Birthday ] ); | 30 | list.append( mapIdToStr[ Qtopia::MiddleName ] ); |
29 | list.append( mapIdToStr[ Qtopia::Anniversary ] ); | 31 | list.append( mapIdToStr[ Qtopia::LastName ] ); |
30 | list.append( mapIdToStr[ Qtopia::Nickname ] ); | 32 | list.append( mapIdToStr[ Qtopia::Suffix ] ); |
31 | list.append( mapIdToStr[ Qtopia::Children ] ); | 33 | list.append( mapIdToStr[ Qtopia::FileAs ] ); |
34 | |||
35 | list.append( mapIdToStr[ Qtopia::JobTitle ] ); | ||
36 | list.append( mapIdToStr[ Qtopia::Department ] ); | ||
37 | list.append( mapIdToStr[ Qtopia::Company ] ); | ||
38 | |||
39 | list.append( mapIdToStr[ Qtopia::Notes ] ); | ||
40 | list.append( mapIdToStr[ Qtopia::Groups ] ); | ||
32 | 41 | ||
33 | if (sorted) list.sort(); | 42 | if (sorted) list.sort(); |
34 | return list; | 43 | return list; |
35 | } | 44 | } |
36 | 45 | ||
37 | /*! | 46 | /*! |
38 | \internal | 47 | \internal |
39 | Returns a translated list of details field names for a contact. | 48 | Returns a list of details field names for a contact. |
40 | */ | 49 | */ |
41 | QStringList OContactFields::trdetailsfields( bool sorted ) | 50 | QStringList OContactFields::detailsfields( bool sorted, bool translated ) |
42 | { | 51 | { |
43 | QStringList list; | 52 | QStringList list; |
44 | QMap<int, QString> mapIdToStr = idToTrFields(); | 53 | QMap<int, QString> mapIdToStr; |
54 | if ( translated ) | ||
55 | mapIdToStr = idToTrFields(); | ||
56 | else | ||
57 | mapIdToStr = idToUntrFields(); | ||
45 | 58 | ||
46 | list.append( mapIdToStr[Qtopia::Office] ); | 59 | list.append( mapIdToStr[ Qtopia::Office ] ); |
47 | list.append( mapIdToStr[Qtopia::Profession] ); | 60 | list.append( mapIdToStr[ Qtopia::Profession ] ); |
48 | list.append( mapIdToStr[Qtopia::Assistant] ); | 61 | list.append( mapIdToStr[ Qtopia::Assistant ] ); |
49 | list.append( mapIdToStr[Qtopia::Manager] ); | 62 | list.append( mapIdToStr[ Qtopia::Manager ] ); |
50 | 63 | ||
51 | list.append( mapIdToStr[Qtopia::Spouse] ); | 64 | list.append( mapIdToStr[ Qtopia::Spouse ] ); |
52 | list.append( mapIdToStr[Qtopia::Gender] ); | 65 | list.append( mapIdToStr[ Qtopia::Gender ] ); |
53 | list.append( mapIdToStr[Qtopia::Birthday] ); | 66 | list.append( mapIdToStr[ Qtopia::Birthday ] ); |
54 | list.append( mapIdToStr[Qtopia::Anniversary] ); | 67 | list.append( mapIdToStr[ Qtopia::Anniversary ] ); |
55 | list.append( mapIdToStr[Qtopia::Nickname] ); | 68 | list.append( mapIdToStr[ Qtopia::Nickname ] ); |
56 | list.append( mapIdToStr[Qtopia::Children] ); | 69 | list.append( mapIdToStr[ Qtopia::Children ] ); |
57 | 70 | ||
58 | if (sorted) list.sort(); | 71 | if (sorted) list.sort(); |
59 | return list; | 72 | return list; |
60 | } | 73 | } |
61 | 74 | ||
62 | |||
63 | /*! | 75 | /*! |
64 | \internal | 76 | \internal |
65 | Returns a translated list of phone field names for a contact. | 77 | Returns a list of phone field names for a contact. |
66 | */ | 78 | */ |
67 | QStringList OContactFields::trphonefields( bool sorted ) | 79 | QStringList OContactFields::phonefields( bool sorted, bool translated ) |
68 | { | 80 | { |
69 | QStringList list; | 81 | QStringList list; |
70 | QMap<int, QString> mapIdToStr = idToTrFields(); | 82 | QMap<int, QString> mapIdToStr; |
83 | if ( translated ) | ||
84 | mapIdToStr = idToTrFields(); | ||
85 | else | ||
86 | mapIdToStr = idToUntrFields(); | ||
71 | 87 | ||
72 | list.append( mapIdToStr[Qtopia::BusinessPhone] ); | 88 | list.append( mapIdToStr[Qtopia::BusinessPhone] ); |
73 | list.append( mapIdToStr[Qtopia::BusinessFax] ); | 89 | list.append( mapIdToStr[Qtopia::BusinessFax] ); |
74 | list.append( mapIdToStr[Qtopia::BusinessMobile] ); | 90 | list.append( mapIdToStr[Qtopia::BusinessMobile] ); |
75 | list.append( mapIdToStr[Qtopia::BusinessPager] ); | 91 | list.append( mapIdToStr[Qtopia::BusinessPager] ); |
76 | list.append( mapIdToStr[Qtopia::BusinessWebPage] ); | 92 | list.append( mapIdToStr[Qtopia::BusinessWebPage] ); |
77 | 93 | ||
78 | list.append( mapIdToStr[Qtopia::DefaultEmail] ); | 94 | list.append( mapIdToStr[Qtopia::DefaultEmail] ); |
79 | list.append( mapIdToStr[Qtopia::Emails] ); | 95 | list.append( mapIdToStr[Qtopia::Emails] ); |
80 | 96 | ||
81 | list.append( mapIdToStr[Qtopia::HomePhone] ); | 97 | list.append( mapIdToStr[Qtopia::HomePhone] ); |
82 | list.append( mapIdToStr[Qtopia::HomeFax] ); | 98 | list.append( mapIdToStr[Qtopia::HomeFax] ); |
83 | list.append( mapIdToStr[Qtopia::HomeMobile] ); | 99 | list.append( mapIdToStr[Qtopia::HomeMobile] ); |
84 | // list.append( mapIdToStr[Qtopia::HomePager] ); | 100 | // list.append( mapIdToStr[Qtopia::HomePager] ); |
85 | list.append( mapIdToStr[Qtopia::HomeWebPage] ); | 101 | list.append( mapIdToStr[Qtopia::HomeWebPage] ); |
86 | 102 | ||
87 | if (sorted) list.sort(); | 103 | if (sorted) list.sort(); |
88 | 104 | ||
89 | return list; | 105 | return list; |
90 | } | 106 | } |
91 | 107 | ||
92 | |||
93 | /*! | 108 | /*! |
94 | \internal | 109 | \internal |
95 | Returns a list of phone field names for a contact. | 110 | Returns a list of field names for a contact. |
96 | */ | 111 | */ |
97 | QStringList OContactFields::untrphonefields( bool sorted ) | 112 | QStringList OContactFields::fields( bool sorted, bool translated ) |
98 | { | 113 | { |
99 | QStringList list; | 114 | QStringList list; |
100 | QMap<int, QString> mapIdToStr = idToUntrFields(); | 115 | QMap<int, QString> mapIdToStr; |
101 | 116 | if ( translated ) | |
102 | list.append( mapIdToStr[ Qtopia::BusinessPhone ] ); | 117 | mapIdToStr = idToTrFields(); |
103 | list.append( mapIdToStr[ Qtopia::BusinessFax ] ); | 118 | else |
104 | list.append( mapIdToStr[ Qtopia::BusinessMobile ] ); | 119 | mapIdToStr = idToUntrFields(); |
105 | list.append( mapIdToStr[ Qtopia::BusinessPager ] ); | ||
106 | list.append( mapIdToStr[ Qtopia::BusinessWebPage ] ); | ||
107 | |||
108 | list.append( mapIdToStr[ Qtopia::DefaultEmail ] ); | ||
109 | list.append( mapIdToStr[ Qtopia::Emails ] ); | ||
110 | 120 | ||
111 | list.append( mapIdToStr[ Qtopia::HomePhone ] ); | 121 | list += personalfields( sorted, translated ); |
112 | list.append( mapIdToStr[ Qtopia::HomeFax ] ); | ||
113 | list.append( mapIdToStr[ Qtopia::HomeMobile ] ); | ||
114 | //list.append( mapIdToStr[Qtopia::HomePager] ); | ||
115 | list.append( mapIdToStr[Qtopia::HomeWebPage] ); | ||
116 | 122 | ||
117 | if (sorted) list.sort(); | 123 | list += phonefields( sorted, translated ); |
118 | |||
119 | return list; | ||
120 | } | ||
121 | |||
122 | |||
123 | /*! | ||
124 | \internal | ||
125 | Returns a translated list of field names for a contact. | ||
126 | */ | ||
127 | QStringList OContactFields::trfields( bool sorted ) | ||
128 | { | ||
129 | QStringList list; | ||
130 | QMap<int, QString> mapIdToStr = idToTrFields(); | ||
131 | |||
132 | list.append( mapIdToStr[Qtopia::Title]); | ||
133 | list.append( mapIdToStr[Qtopia::FirstName] ); | ||
134 | list.append( mapIdToStr[Qtopia::MiddleName] ); | ||
135 | list.append( mapIdToStr[Qtopia::LastName] ); | ||
136 | list.append( mapIdToStr[Qtopia::Suffix] ); | ||
137 | list.append( mapIdToStr[Qtopia::FileAs] ); | ||
138 | |||
139 | list.append( mapIdToStr[Qtopia::JobTitle] ); | ||
140 | list.append( mapIdToStr[Qtopia::Department] ); | ||
141 | list.append( mapIdToStr[Qtopia::Company] ); | ||
142 | |||
143 | list += trphonefields( sorted ); | ||
144 | 124 | ||
145 | list.append( mapIdToStr[Qtopia::BusinessStreet] ); | 125 | list.append( mapIdToStr[Qtopia::BusinessStreet] ); |
146 | list.append( mapIdToStr[Qtopia::BusinessCity] ); | 126 | list.append( mapIdToStr[Qtopia::BusinessCity] ); |
147 | list.append( mapIdToStr[Qtopia::BusinessState] ); | 127 | list.append( mapIdToStr[Qtopia::BusinessState] ); |
148 | list.append( mapIdToStr[Qtopia::BusinessZip] ); | 128 | list.append( mapIdToStr[Qtopia::BusinessZip] ); |
149 | list.append( mapIdToStr[Qtopia::BusinessCountry] ); | 129 | list.append( mapIdToStr[Qtopia::BusinessCountry] ); |
150 | 130 | ||
151 | list.append( mapIdToStr[Qtopia::HomeStreet] ); | 131 | list.append( mapIdToStr[Qtopia::HomeStreet] ); |
152 | list.append( mapIdToStr[Qtopia::HomeCity] ); | 132 | list.append( mapIdToStr[Qtopia::HomeCity] ); |
153 | list.append( mapIdToStr[Qtopia::HomeState] ); | 133 | list.append( mapIdToStr[Qtopia::HomeState] ); |
154 | list.append( mapIdToStr[Qtopia::HomeZip] ); | 134 | list.append( mapIdToStr[Qtopia::HomeZip] ); |
155 | list.append( mapIdToStr[Qtopia::HomeCountry] ); | 135 | list.append( mapIdToStr[Qtopia::HomeCountry] ); |
156 | 136 | ||
157 | list += trdetailsfields( sorted ); | 137 | list += detailsfields( sorted, translated ); |
158 | |||
159 | list.append( mapIdToStr[Qtopia::Notes] ); | ||
160 | list.append( mapIdToStr[Qtopia::Groups] ); | ||
161 | 138 | ||
162 | if (sorted) list.sort(); | 139 | if (sorted) list.sort(); |
163 | 140 | ||
164 | return list; | 141 | return list; |
165 | } | 142 | } |
166 | 143 | ||
144 | |||
167 | /*! | 145 | /*! |
168 | \internal | 146 | \internal |
169 | Returns an untranslated list of field names for a contact. | 147 | Returns an untranslated list of personal field names for a contact. |
170 | */ | 148 | */ |
171 | QStringList OContactFields::untrfields( bool sorted ) | 149 | QStringList OContactFields::untrpersonalfields( bool sorted ) |
172 | { | 150 | { |
173 | QStringList list; | 151 | return personalfields( sorted, false ); |
174 | QMap<int, QString> mapIdToStr = idToUntrFields(); | 152 | } |
175 | 153 | ||
176 | list.append( mapIdToStr[ Qtopia::AddressUid ] ); | ||
177 | list.append( mapIdToStr[ Qtopia::AddressCategory ] ); | ||
178 | 154 | ||
179 | list.append( mapIdToStr[ Qtopia::Title ] ); | 155 | /*! |
180 | list.append( mapIdToStr[ Qtopia::FirstName ] ); | 156 | \internal |
181 | list.append( mapIdToStr[ Qtopia::MiddleName ] ); | 157 | Returns a translated list of personal field names for a contact. |
182 | list.append( mapIdToStr[ Qtopia::LastName ] ); | 158 | */ |
183 | list.append( mapIdToStr[ Qtopia::Suffix ] ); | 159 | QStringList OContactFields::trpersonalfields( bool sorted ) |
184 | list.append( mapIdToStr[ Qtopia::FileAs ] ); | 160 | { |
161 | return personalfields( sorted, true ); | ||
162 | } | ||
185 | 163 | ||
186 | list.append( mapIdToStr[ Qtopia::JobTitle ] ); | ||
187 | list.append( mapIdToStr[ Qtopia::Department ] ); | ||
188 | list.append( mapIdToStr[ Qtopia::Company ] ); | ||
189 | 164 | ||
190 | list += untrphonefields( sorted ); | 165 | /*! |
166 | \internal | ||
167 | Returns an untranslated list of details field names for a contact. | ||
168 | */ | ||
169 | QStringList OContactFields::untrdetailsfields( bool sorted ) | ||
170 | { | ||
171 | return detailsfields( sorted, false ); | ||
172 | } | ||
191 | 173 | ||
192 | list.append( mapIdToStr[ Qtopia::BusinessStreet ] ); | ||
193 | list.append( mapIdToStr[ Qtopia::BusinessCity ] ); | ||
194 | list.append( mapIdToStr[ Qtopia::BusinessState ] ); | ||
195 | list.append( mapIdToStr[ Qtopia::BusinessZip ] ); | ||
196 | list.append( mapIdToStr[ Qtopia::BusinessCountry ] ); | ||
197 | 174 | ||
198 | list.append( mapIdToStr[ Qtopia::HomeStreet ] ); | 175 | /*! |
199 | list.append( mapIdToStr[ Qtopia::HomeCity ] ); | 176 | \internal |
200 | list.append( mapIdToStr[ Qtopia::HomeState ] ); | 177 | Returns a translated list of details field names for a contact. |
201 | list.append( mapIdToStr[ Qtopia::HomeZip ] ); | 178 | */ |
202 | list.append( mapIdToStr[ Qtopia::HomeCountry ] ); | 179 | QStringList OContactFields::trdetailsfields( bool sorted ) |
180 | { | ||
181 | return detailsfields( sorted, true ); | ||
182 | } | ||
203 | 183 | ||
204 | list += untrdetailsfields( sorted ); | ||
205 | 184 | ||
206 | list.append( mapIdToStr[ Qtopia::Notes ] ); | 185 | /*! |
207 | list.append( mapIdToStr[ Qtopia::Groups ] ); | 186 | \internal |
187 | Returns a translated list of phone field names for a contact. | ||
188 | */ | ||
189 | QStringList OContactFields::trphonefields( bool sorted ) | ||
190 | { | ||
191 | return phonefields( sorted, true ); | ||
192 | } | ||
208 | 193 | ||
209 | if (sorted) list.sort(); | 194 | /*! |
195 | \internal | ||
196 | Returns an untranslated list of phone field names for a contact. | ||
197 | */ | ||
198 | QStringList OContactFields::untrphonefields( bool sorted ) | ||
199 | { | ||
200 | return phonefields( sorted, false ); | ||
201 | } | ||
210 | 202 | ||
211 | return list; | 203 | |
204 | /*! | ||
205 | \internal | ||
206 | Returns a translated list of field names for a contact. | ||
207 | */ | ||
208 | QStringList OContactFields::trfields( bool sorted ) | ||
209 | { | ||
210 | return fields( sorted, true ); | ||
211 | } | ||
212 | |||
213 | /*! | ||
214 | \internal | ||
215 | Returns an untranslated list of field names for a contact. | ||
216 | */ | ||
217 | QStringList OContactFields::untrfields( bool sorted ) | ||
218 | { | ||
219 | return fields( sorted, false ); | ||
212 | } | 220 | } |
221 | |||
213 | QMap<int, QString> OContactFields::idToTrFields() | 222 | QMap<int, QString> OContactFields::idToTrFields() |
214 | { | 223 | { |
215 | QMap<int, QString> ret_map; | 224 | QMap<int, QString> ret_map; |
216 | 225 | ||
217 | ret_map.insert( Qtopia::AddressUid, QObject::tr( "User Id" ) ); | 226 | ret_map.insert( Qtopia::AddressUid, QObject::tr( "User Id" ) ); |
218 | ret_map.insert( Qtopia::AddressCategory, QObject::tr( "Categories" ) ); | 227 | ret_map.insert( Qtopia::AddressCategory, QObject::tr( "Categories" ) ); |
219 | 228 | ||
220 | ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") ); | 229 | ret_map.insert( Qtopia::Title, QObject::tr( "Name Title") ); |
221 | ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); | 230 | ret_map.insert( Qtopia::FirstName, QObject::tr( "First Name" ) ); |
222 | ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); | 231 | ret_map.insert( Qtopia::MiddleName, QObject::tr( "Middle Name" ) ); |
223 | ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); | 232 | ret_map.insert( Qtopia::LastName, QObject::tr( "Last Name" ) ); |
224 | ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" )); | 233 | ret_map.insert( Qtopia::Suffix, QObject::tr( "Suffix" )); |
@@ -320,25 +329,25 @@ QMap<int, QString> OContactFields::idToUntrFields() | |||
320 | ret_map.insert( Qtopia::Manager, "Manager" ); | 329 | ret_map.insert( Qtopia::Manager, "Manager" ); |
321 | 330 | ||
322 | // home | 331 | // home |
323 | ret_map.insert( Qtopia::HomeStreet, "Home Street" ); | 332 | ret_map.insert( Qtopia::HomeStreet, "Home Street" ); |
324 | ret_map.insert( Qtopia::HomeCity, "Home City" ); | 333 | ret_map.insert( Qtopia::HomeCity, "Home City" ); |
325 | ret_map.insert( Qtopia::HomeState, "Home State" ); | 334 | ret_map.insert( Qtopia::HomeState, "Home State" ); |
326 | ret_map.insert( Qtopia::HomeZip, "Home Zip" ); | 335 | ret_map.insert( Qtopia::HomeZip, "Home Zip" ); |
327 | ret_map.insert( Qtopia::HomeCountry, "Home Country" ); | 336 | ret_map.insert( Qtopia::HomeCountry, "Home Country" ); |
328 | ret_map.insert( Qtopia::HomeWebPage, "Home Web Page" ); | 337 | ret_map.insert( Qtopia::HomeWebPage, "Home Web Page" ); |
329 | 338 | ||
330 | //personal | 339 | //personal |
331 | ret_map.insert( Qtopia::Spouse, "Spouse" ); | 340 | ret_map.insert( Qtopia::Spouse, "Spouse" ); |
332 | ret_map.insert( Qtopia::Gender, "Gender" ); | 341 | ret_map.insert( Qtopia::Gender, "Gender" ); |
333 | ret_map.insert( Qtopia::Birthday, "Birthday" ); | 342 | ret_map.insert( Qtopia::Birthday, "Birthday" ); |
334 | ret_map.insert( Qtopia::Anniversary, "Anniversary" ); | 343 | ret_map.insert( Qtopia::Anniversary, "Anniversary" ); |
335 | ret_map.insert( Qtopia::Nickname, "Nickname" ); | 344 | ret_map.insert( Qtopia::Nickname, "Nickname" ); |
336 | ret_map.insert( Qtopia::Children, "Children" ); | 345 | ret_map.insert( Qtopia::Children, "Children" ); |
337 | 346 | ||
338 | // other | 347 | // other |
339 | ret_map.insert( Qtopia::Notes, "Notes" ); | 348 | ret_map.insert( Qtopia::Notes, "Notes" ); |
340 | ret_map.insert( Qtopia::Groups, "Groups" ); | 349 | ret_map.insert( Qtopia::Groups, "Groups" ); |
341 | 350 | ||
342 | 351 | ||
343 | return ret_map; | 352 | return ret_map; |
344 | } | 353 | } |
@@ -348,24 +357,26 @@ QMap<QString, int> OContactFields::trFieldsToId() | |||
348 | QMap<int, QString> idtostr = idToTrFields(); | 357 | QMap<int, QString> idtostr = idToTrFields(); |
349 | QMap<QString, int> ret_map; | 358 | QMap<QString, int> ret_map; |
350 | 359 | ||
351 | 360 | ||
352 | QMap<int, QString>::Iterator it; | 361 | QMap<int, QString>::Iterator it; |
353 | for( it = idtostr.begin(); it != idtostr.end(); ++it ) | 362 | for( it = idtostr.begin(); it != idtostr.end(); ++it ) |
354 | ret_map.insert( *it, it.key() ); | 363 | ret_map.insert( *it, it.key() ); |
355 | 364 | ||
356 | 365 | ||
357 | return ret_map; | 366 | return ret_map; |
358 | } | 367 | } |
359 | 368 | ||
369 | /* ======================================================================= */ | ||
370 | |||
360 | QMap<QString, int> OContactFields::untrFieldsToId() | 371 | QMap<QString, int> OContactFields::untrFieldsToId() |
361 | { | 372 | { |
362 | QMap<int, QString> idtostr = idToUntrFields(); | 373 | QMap<int, QString> idtostr = idToUntrFields(); |
363 | QMap<QString, int> ret_map; | 374 | QMap<QString, int> ret_map; |
364 | 375 | ||
365 | 376 | ||
366 | QMap<int, QString>::Iterator it; | 377 | QMap<int, QString>::Iterator it; |
367 | for( it = idtostr.begin(); it != idtostr.end(); ++it ) | 378 | for( it = idtostr.begin(); it != idtostr.end(); ++it ) |
368 | ret_map.insert( *it, it.key() ); | 379 | ret_map.insert( *it, it.key() ); |
369 | 380 | ||
370 | 381 | ||
371 | return ret_map; | 382 | return ret_map; |