summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 0157721..3a2dc5f 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -53,346 +53,353 @@ struct Addressee::AddresseeData : public KShared
53 QString givenName; 53 QString givenName;
54 QString additionalName; 54 QString additionalName;
55 QString prefix; 55 QString prefix;
56 QString suffix; 56 QString suffix;
57 QString nickName; 57 QString nickName;
58 QDateTime birthday; 58 QDateTime birthday;
59 QString mailer; 59 QString mailer;
60 TimeZone timeZone; 60 TimeZone timeZone;
61 Geo geo; 61 Geo geo;
62 QString title; 62 QString title;
63 QString role; 63 QString role;
64 QString organization; 64 QString organization;
65 QString note; 65 QString note;
66 QString productId; 66 QString productId;
67 QDateTime revision; 67 QDateTime revision;
68 QString sortString; 68 QString sortString;
69 QString externalUID; 69 QString externalUID;
70 KURL url; 70 KURL url;
71 Secrecy secrecy; 71 Secrecy secrecy;
72 Picture logo; 72 Picture logo;
73 Picture photo; 73 Picture photo;
74 Sound sound; 74 Sound sound;
75 Agent agent; 75 Agent agent;
76 QString mExternalId; 76 QString mExternalId;
77 PhoneNumber::List phoneNumbers; 77 PhoneNumber::List phoneNumbers;
78 Address::List addresses; 78 Address::List addresses;
79 Key::List keys; 79 Key::List keys;
80 QStringList emails; 80 QStringList emails;
81 QStringList categories; 81 QStringList categories;
82 QStringList custom; 82 QStringList custom;
83 int mTempSyncStat; 83 int mTempSyncStat;
84 Resource *resource; 84 Resource *resource;
85 85
86 bool empty :1; 86 bool empty :1;
87 bool changed :1; 87 bool changed :1;
88}; 88};
89 89
90Addressee::Addressee() 90Addressee::Addressee()
91{ 91{
92 mData = new AddresseeData; 92 mData = new AddresseeData;
93 mData->empty = true; 93 mData->empty = true;
94 mData->changed = false; 94 mData->changed = false;
95 mData->resource = 0; 95 mData->resource = 0;
96 mData->mExternalId = ":"; 96 mData->mExternalId = ":";
97 mData->revision = QDateTime ( QDate( 2004,1,1)); 97 mData->revision = QDateTime ( QDate( 2004,1,1));
98 mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; 98 mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL;
99} 99}
100 100
101Addressee::~Addressee() 101Addressee::~Addressee()
102{ 102{
103} 103}
104 104
105Addressee::Addressee( const Addressee &a ) 105Addressee::Addressee( const Addressee &a )
106{ 106{
107 mData = a.mData; 107 mData = a.mData;
108} 108}
109 109
110Addressee &Addressee::operator=( const Addressee &a ) 110Addressee &Addressee::operator=( const Addressee &a )
111{ 111{
112 mData = a.mData; 112 mData = a.mData;
113 return (*this); 113 return (*this);
114} 114}
115 115
116Addressee Addressee::copy() 116Addressee Addressee::copy()
117{ 117{
118 Addressee a; 118 Addressee a;
119 *(a.mData) = *mData; 119 *(a.mData) = *mData;
120 return a; 120 return a;
121} 121}
122 122
123void Addressee::detach() 123void Addressee::detach()
124{ 124{
125 if ( mData.count() == 1 ) return; 125 if ( mData.count() == 1 ) return;
126 *this = copy(); 126 *this = copy();
127} 127}
128 128
129bool Addressee::operator==( const Addressee &a ) const 129bool Addressee::operator==( const Addressee &a ) const
130{ 130{
131 if ( uid() != a.uid() ) return false; 131 if ( uid() != a.uid() ) return false;
132 if ( mData->name != a.mData->name ) return false; 132 if ( mData->name != a.mData->name ) return false;
133 if ( mData->formattedName != a.mData->formattedName ) return false; 133 if ( mData->formattedName != a.mData->formattedName ) return false;
134 if ( mData->familyName != a.mData->familyName ) return false; 134 if ( mData->familyName != a.mData->familyName ) return false;
135 if ( mData->givenName != a.mData->givenName ) return false; 135 if ( mData->givenName != a.mData->givenName ) return false;
136 if ( mData->additionalName != a.mData->additionalName ) return false; 136 if ( mData->additionalName != a.mData->additionalName ) return false;
137 if ( mData->prefix != a.mData->prefix ) return false; 137 if ( mData->prefix != a.mData->prefix ) return false;
138 if ( mData->suffix != a.mData->suffix ) return false; 138 if ( mData->suffix != a.mData->suffix ) return false;
139 if ( mData->nickName != a.mData->nickName ) return false; 139 if ( mData->nickName != a.mData->nickName ) return false;
140 if ( mData->birthday != a.mData->birthday ) return false; 140 if ( mData->birthday != a.mData->birthday ) return false;
141 if ( mData->mailer != a.mData->mailer ) return false; 141 if ( mData->mailer != a.mData->mailer ) return false;
142 if ( mData->timeZone != a.mData->timeZone ) return false; 142 if ( mData->timeZone != a.mData->timeZone ) return false;
143 if ( mData->geo != a.mData->geo ) return false; 143 if ( mData->geo != a.mData->geo ) return false;
144 if ( mData->title != a.mData->title ) return false; 144 if ( mData->title != a.mData->title ) return false;
145 if ( mData->role != a.mData->role ) return false; 145 if ( mData->role != a.mData->role ) return false;
146 if ( mData->organization != a.mData->organization ) return false; 146 if ( mData->organization != a.mData->organization ) return false;
147 if ( mData->note != a.mData->note ) return false; 147 if ( mData->note != a.mData->note ) return false;
148 if ( mData->productId != a.mData->productId ) return false; 148 if ( mData->productId != a.mData->productId ) return false;
149 if ( mData->revision != a.mData->revision ) return false; 149 //if ( mData->revision != a.mData->revision ) return false;
150 if ( mData->sortString != a.mData->sortString ) return false; 150 if ( mData->sortString != a.mData->sortString ) return false;
151 if ( mData->secrecy != a.mData->secrecy ) return false; 151 if ( mData->secrecy != a.mData->secrecy ) return false;
152 if ( mData->logo != a.mData->logo ) return false; 152 if ( mData->logo != a.mData->logo ) return false;
153 if ( mData->photo != a.mData->photo ) return false; 153 if ( mData->photo != a.mData->photo ) return false;
154 if ( mData->sound != a.mData->sound ) return false; 154 if ( mData->sound != a.mData->sound ) return false;
155 if ( mData->agent != a.mData->agent ) return false; 155 if ( mData->agent != a.mData->agent ) return false;
156 if ( ( mData->url.isValid() || a.mData->url.isValid() ) && 156 if ( ( mData->url.isValid() || a.mData->url.isValid() ) &&
157 ( mData->url != a.mData->url ) ) return false; 157 ( mData->url != a.mData->url ) ) return false;
158 if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; 158 if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false;
159 if ( mData->addresses != a.mData->addresses ) return false; 159 if ( mData->addresses != a.mData->addresses ) return false;
160 if ( mData->keys != a.mData->keys ) return false; 160 if ( mData->keys != a.mData->keys ) return false;
161 if ( mData->emails != a.mData->emails ) return false; 161 if ( mData->emails != a.mData->emails ) return false;
162 if ( mData->categories != a.mData->categories ) return false; 162 if ( mData->categories != a.mData->categories ) return false;
163 if ( mData->custom != a.mData->custom ) return false; 163 if ( mData->custom != a.mData->custom ) return false;
164 164
165 return true; 165 return true;
166} 166}
167 167
168bool Addressee::operator!=( const Addressee &a ) const 168bool Addressee::operator!=( const Addressee &a ) const
169{ 169{
170 return !( a == *this ); 170 return !( a == *this );
171} 171}
172 172
173bool Addressee::isEmpty() const 173bool Addressee::isEmpty() const
174{ 174{
175 return mData->empty; 175 return mData->empty;
176} 176}
177ulong Addressee::getCsum4List( const QStringList & attList) 177ulong Addressee::getCsum4List( const QStringList & attList)
178{ 178{
179 int max = attList.count(); 179 int max = attList.count();
180 ulong cSum = 0; 180 ulong cSum = 0;
181 int j,k,i; 181 int j,k,i;
182 int add; 182 int add;
183 for ( i = 0; i < max ; ++i ) { 183 for ( i = 0; i < max ; ++i ) {
184 QString s = attList[i]; 184 QString s = attList[i];
185 if ( ! s.isEmpty() ){ 185 if ( ! s.isEmpty() ){
186 j = s.length(); 186 j = s.length();
187 for ( k = 0; k < j; ++k ) { 187 for ( k = 0; k < j; ++k ) {
188 int mul = k +1; 188 int mul = k +1;
189 add = s[k].unicode (); 189 add = s[k].unicode ();
190 if ( k < 16 ) 190 if ( k < 16 )
191 mul = mul * mul; 191 mul = mul * mul;
192 int ii = i+1; 192 int ii = i+1;
193 add = add * mul *ii*ii*ii; 193 add = add * mul *ii*ii*ii;
194 cSum += add; 194 cSum += add;
195 } 195 }
196 } 196 }
197 197
198 } 198 }
199 //QString dump = attList.join(","); 199 //QString dump = attList.join(",");
200 //qDebug("csum: %d %s", cSum,dump.latin1()); 200 //qDebug("csum: %d %s", cSum,dump.latin1());
201 201
202 return cSum; 202 return cSum;
203 203
204} 204}
205void Addressee::computeCsum(const QString &dev) 205void Addressee::computeCsum(const QString &dev)
206{ 206{
207 QStringList l; 207 QStringList l;
208 if ( !mData->name.isEmpty() ) l.append(mData->name); 208 if ( !mData->name.isEmpty() ) l.append(mData->name);
209 if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); 209 if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName );
210 if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); 210 if ( !mData->familyName.isEmpty() ) l.append( mData->familyName );
211 if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); 211 if ( !mData->givenName.isEmpty() ) l.append(mData->givenName );
212 if ( !mData->additionalName ) l.append( mData->additionalName ); 212 if ( !mData->additionalName ) l.append( mData->additionalName );
213 if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); 213 if ( !mData->prefix.isEmpty() ) l.append( mData->prefix );
214 if ( !mData->suffix.isEmpty() ) l.append( mData->suffix ); 214 if ( !mData->suffix.isEmpty() ) l.append( mData->suffix );
215 if ( !mData->nickName.isEmpty() ) l.append( mData->nickName ); 215 if ( !mData->nickName.isEmpty() ) l.append( mData->nickName );
216 if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() ); 216 if ( mData->birthday.isValid() ) l.append( mData->birthday.toString() );
217 if ( !mData->mailer.isEmpty() ) l.append( mData->mailer ); 217 if ( !mData->mailer.isEmpty() ) l.append( mData->mailer );
218 if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); 218 if ( mData->timeZone.isValid() ) l.append( mData->timeZone.asString() );
219 if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); 219 if ( mData->geo.isValid() ) l.append( mData->geo.asString() );
220 if ( !mData->title .isEmpty() ) l.append( mData->title ); 220 if ( !mData->title .isEmpty() ) l.append( mData->title );
221 if ( !mData->role.isEmpty() ) l.append( mData->role ); 221 if ( !mData->role.isEmpty() ) l.append( mData->role );
222 if ( !mData->organization.isEmpty() ) l.append( mData->organization ); 222 if ( !mData->organization.isEmpty() ) l.append( mData->organization );
223 if ( !mData->note.isEmpty() ) l.append( mData->note ); 223 if ( !mData->note.isEmpty() ) l.append( mData->note );
224 if ( !mData->productId.isEmpty() ) l.append(mData->productId ); 224 if ( !mData->productId.isEmpty() ) l.append(mData->productId );
225 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); 225 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString );
226 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); 226 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString());
227 // if ( !mData->logo.isEmpty() ) l.append( ); 227 // if ( !mData->logo.isEmpty() ) l.append( );
228 //if ( !mData->photo.isEmpty() ) l.append( ); 228 //if ( !mData->photo.isEmpty() ) l.append( );
229 //if ( !mData->sound.isEmpty() ) l.append( ); 229 //if ( !mData->sound.isEmpty() ) l.append( );
230 //if ( !mData->agent.isEmpty() ) l.append( ); 230 //if ( !mData->agent.isEmpty() ) l.append( );
231 //if ( mData->url.isValid() ) l.append( ); 231 //if ( mData->url.isValid() ) l.append( );
232#if 0 232#if 0
233 if ( !mData->phoneNumbers.isEmpty() ) l.append( ); 233 if ( !mData->phoneNumbers.isEmpty() ) l.append( );
234 if ( !mData->addresses.isEmpty() ) l.append( ); 234 if ( !mData->addresses.isEmpty() ) l.append( );
235 //if ( !mData->keys.isEmpty() ) l.append( ); 235 //if ( !mData->keys.isEmpty() ) l.append( );
236 if ( !mData->emails.isEmpty() ) l.append( ); 236 if ( !mData->emails.isEmpty() ) l.append( );
237 if ( !mData->categories .isEmpty() ) l.append( ); 237 if ( !mData->categories .isEmpty() ) l.append( );
238 if ( !mData->custom.isEmpty() ) l.append( ); 238 if ( !mData->custom.isEmpty() ) l.append( );
239#endif 239#endif
240 KABC::PhoneNumber::List phoneNumbers; 240 KABC::PhoneNumber::List phoneNumbers;
241 KABC::PhoneNumber::List::Iterator phoneIter; 241 KABC::PhoneNumber::List::Iterator phoneIter;
242 242
243 QStringList t; 243 QStringList t;
244 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 244 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
245 ++phoneIter ) 245 ++phoneIter )
246 t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) ); 246 t.append( ( *phoneIter ).number()+QString::number( ( *phoneIter ).type() ) );
247 t.sort(); 247 t.sort();
248 uint iii; 248 uint iii;
249 for ( iii = 0; iii < t.count(); ++iii) 249 for ( iii = 0; iii < t.count(); ++iii)
250 l.append( t[iii] ); 250 l.append( t[iii] );
251 t = mData->emails; 251 t = mData->emails;
252 t.sort(); 252 t.sort();
253 for ( iii = 0; iii < t.count(); ++iii) 253 for ( iii = 0; iii < t.count(); ++iii)
254 l.append( t[iii] ); 254 l.append( t[iii] );
255 t = mData->categories; 255 t = mData->categories;
256 t.sort(); 256 t.sort();
257 for ( iii = 0; iii < t.count(); ++iii) 257 for ( iii = 0; iii < t.count(); ++iii)
258 l.append( t[iii] ); 258 l.append( t[iii] );
259 t = mData->custom; 259 t = mData->custom;
260 t.sort(); 260 t.sort();
261 for ( iii = 0; iii < t.count(); ++iii) 261 for ( iii = 0; iii < t.count(); ++iii)
262 l.append( t[iii] ); 262 l.append( t[iii] );
263 KABC::Address::List::Iterator addressIter; 263 KABC::Address::List::Iterator addressIter;
264 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); 264 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end();
265 ++addressIter ) { 265 ++addressIter ) {
266 t = (*addressIter).asList(); 266 t = (*addressIter).asList();
267 t.sort(); 267 t.sort();
268 for ( iii = 0; iii < t.count(); ++iii) 268 for ( iii = 0; iii < t.count(); ++iii)
269 l.append( t[iii] ); 269 l.append( t[iii] );
270 } 270 }
271 uint cs = getCsum4List(l); 271 uint cs = getCsum4List(l);
272 // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); 272 // qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() );
273 setCsum( dev, QString::number (cs )); 273 setCsum( dev, QString::number (cs ));
274} 274}
275 275
276void Addressee::mergeContact( const Addressee& ad ) 276void Addressee::mergeContact( const Addressee& ad )
277{ 277{
278 278
279 detach(); 279 detach();
280 if ( mData->name.isEmpty() ) mData->name = ad.mData->name; 280 if ( mData->name.isEmpty() ) mData->name = ad.mData->name;
281 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; 281 if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName;
282 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; 282 if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName;
283 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; 283 if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ;
284 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; 284 if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName;
285 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; 285 if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix;
286 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; 286 if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix;
287 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; 287 if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName;
288 if ( !mData->birthday.isValid() ) 288 if ( !mData->birthday.isValid() )
289 if ( ad.mData->birthday.isValid()) 289 if ( ad.mData->birthday.isValid())
290 mData->birthday = ad.mData->birthday; 290 mData->birthday = ad.mData->birthday;
291 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; 291 if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer;
292#if 0 292 if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone;
293 if ( !mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); 293 if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo;
294 if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); 294 if ( mData->title .isEmpty() ) mData->title = ad.mData->title ;
295 if ( !mData->title .isEmpty() ) l.append( mData->title ); 295 if ( mData->role.isEmpty() ) mData->role = ad.mData->role ;
296 if ( !mData->role.isEmpty() ) l.append( mData->role ); 296 if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ;
297 if ( !mData->organization.isEmpty() ) l.append( mData->organization ); 297 if ( mData->note.isEmpty() ) mData->note = ad.mData->note ;
298 if ( !mData->note.isEmpty() ) l.append( mData->note ); 298 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId;
299 if ( !mData->productId.isEmpty() ) l.append(mData->productId ); 299 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString;
300 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); 300 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy;
301 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); 301 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ;
302#endif 302
303 // pending:
304 // merging phonenumbers
305 // merging addresses
306 // merging emails;
307 // merging categories;
308 // merging custom;
309 // merging keys
303} 310}
304 311
305void Addressee::removeID(const QString &prof) 312void Addressee::removeID(const QString &prof)
306{ 313{
307 detach(); 314 detach();
308 mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); 315 mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof);
309 316
310} 317}
311void Addressee::setID( const QString & prof , const QString & id ) 318void Addressee::setID( const QString & prof , const QString & id )
312{ 319{
313 detach(); 320 detach();
314 mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); 321 mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id );
315 //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); 322 //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() );
316} 323}
317void Addressee::setTempSyncStat( int id ) 324void Addressee::setTempSyncStat( int id )
318{ 325{
319 if ( mData->mTempSyncStat == id ) return; 326 if ( mData->mTempSyncStat == id ) return;
320 detach(); 327 detach();
321 mData->mTempSyncStat = id; 328 mData->mTempSyncStat = id;
322} 329}
323int Addressee::tempSyncStat() const 330int Addressee::tempSyncStat() const
324{ 331{
325 return mData->mTempSyncStat; 332 return mData->mTempSyncStat;
326} 333}
327 334
328QString Addressee::getID( const QString & prof) 335QString Addressee::getID( const QString & prof)
329{ 336{
330 return KIdManager::getId ( mData->mExternalId, prof ); 337 return KIdManager::getId ( mData->mExternalId, prof );
331} 338}
332 339
333void Addressee::setCsum( const QString & prof , const QString & id ) 340void Addressee::setCsum( const QString & prof , const QString & id )
334{ 341{
335 detach(); 342 detach();
336 //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); 343 //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() );
337 mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); 344 mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id );
338 //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); 345 //qDebug("setcsum2 %s ",mData->mExternalId.latin1() );
339} 346}
340 347
341QString Addressee::getCsum( const QString & prof) 348QString Addressee::getCsum( const QString & prof)
342{ 349{
343 return KIdManager::getCsum ( mData->mExternalId, prof ); 350 return KIdManager::getCsum ( mData->mExternalId, prof );
344} 351}
345 352
346void Addressee::setIDStr( const QString & s ) 353void Addressee::setIDStr( const QString & s )
347{ 354{
348 detach(); 355 detach();
349 mData->mExternalId = s; 356 mData->mExternalId = s;
350} 357}
351 358
352QString Addressee::IDStr() const 359QString Addressee::IDStr() const
353{ 360{
354 return mData->mExternalId; 361 return mData->mExternalId;
355} 362}
356 363
357void Addressee::setExternalUID( const QString &id ) 364void Addressee::setExternalUID( const QString &id )
358{ 365{
359 if ( id == mData->externalUID ) return; 366 if ( id == mData->externalUID ) return;
360 detach(); 367 detach();
361 mData->empty = false; 368 mData->empty = false;
362 mData->externalUID = id; 369 mData->externalUID = id;
363} 370}
364 371
365QString Addressee::externalUID() const 372QString Addressee::externalUID() const
366{ 373{
367 return mData->externalUID; 374 return mData->externalUID;
368} 375}
369 376
370void Addressee::setUid( const QString &id ) 377void Addressee::setUid( const QString &id )
371{ 378{
372 if ( id == mData->uid ) return; 379 if ( id == mData->uid ) return;
373 detach(); 380 detach();
374 mData->empty = false; 381 mData->empty = false;
375 mData->uid = id; 382 mData->uid = id;
376} 383}
377 384
378QString Addressee::uid() const 385QString Addressee::uid() const
379{ 386{
380 if ( mData->uid.isEmpty() ) 387 if ( mData->uid.isEmpty() )
381 mData->uid = KApplication::randomString( 10 ); 388 mData->uid = KApplication::randomString( 10 );
382 389
383 return mData->uid; 390 return mData->uid;
384} 391}
385 392
386QString Addressee::uidLabel() 393QString Addressee::uidLabel()
387{ 394{
388 return i18n("Unique Identifier"); 395 return i18n("Unique Identifier");
389} 396}
390 397
391void Addressee::setName( const QString &name ) 398void Addressee::setName( const QString &name )
392{ 399{
393 if ( name == mData->name ) return; 400 if ( name == mData->name ) return;
394 detach(); 401 detach();
395 mData->empty = false; 402 mData->empty = false;
396 mData->name = name; 403 mData->name = name;
397} 404}
398 405