summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Unidiff
Diffstat (limited to 'kabc/addressee.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index bfcfab5..18b4d58 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -191,16 +191,17 @@ ulong Addressee::getCsum4List( const QStringList & attList)
191 for ( k = 0; k < j; ++k ) { 191 for ( k = 0; k < j; ++k ) {
192 int mul = k +1; 192 int mul = k +1;
193 add = s[k].unicode (); 193 add = s[k].unicode ();
194 if ( k < 16 ) 194 if ( k < 16 )
195 mul = mul * mul; 195 mul = mul * mul;
196 int ii = i+1; 196 int ii = i+1;
197 add = add * mul *ii*ii*ii; 197 add = add * mul *ii*ii*ii;
198 cSum += add; 198 cSum += add;
199 //qDebug("csum: %d %d %d", i,k,cSum);
199 } 200 }
200 } 201 }
201 202
202 } 203 }
203 //QString dump = attList.join(","); 204 //QString dump = attList.join(",");
204 //qDebug("csum: %d %s", cSum,dump.latin1()); 205 //qDebug("csum: %d %s", cSum,dump.latin1());
205 206
206 return cSum; 207 return cSum;
@@ -223,19 +224,42 @@ void Addressee::computeCsum(const QString &dev)
223 if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); 224 if ( mData->geo.isValid() ) l.append( mData->geo.asString() );
224 if ( !mData->title .isEmpty() ) l.append( mData->title ); 225 if ( !mData->title .isEmpty() ) l.append( mData->title );
225 if ( !mData->role.isEmpty() ) l.append( mData->role ); 226 if ( !mData->role.isEmpty() ) l.append( mData->role );
226 if ( !mData->organization.isEmpty() ) l.append( mData->organization ); 227 if ( !mData->organization.isEmpty() ) l.append( mData->organization );
227 if ( !mData->note.isEmpty() ) l.append( mData->note ); 228 if ( !mData->note.isEmpty() ) l.append( mData->note );
228 if ( !mData->productId.isEmpty() ) l.append(mData->productId ); 229 if ( !mData->productId.isEmpty() ) l.append(mData->productId );
229 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); 230 if ( !mData->sortString.isEmpty() ) l.append( mData->sortString );
230 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); 231 if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString());
231 // if ( !mData->logo.isEmpty() ) l.append( ); 232 if ( !mData->logo.undefined() ) {
232 //if ( !mData->photo.isEmpty() ) l.append( ); 233 if ( !mData->logo.isIntern() )
233 //if ( !mData->sound.isEmpty() ) l.append( ); 234 l.append( mData->logo.url() );
235 else
236 l.append( QString::number(mData->logo.data().width()* mData->logo.data().height()));
237 } else {
238 l.append( "nologo");
239 }
240 if ( !mData->photo.undefined() ) {
241 if ( !mData->photo.isIntern() )
242 l.append( mData->photo.url() );
243 else
244 l.append( QString::number(mData->photo.data().width()* mData->photo.data().height()));
245 } else {
246 l.append( "nophoto");
247 }
248#if 0
249 if ( !mData->sound.undefined() ) {
250 if ( !mData->sound.isIntern() )
251 l.append( mData->sound.url() );
252 else
253 l.append( QString(mData->sound.data().with()* mData->sound.data().height()));
254 } else {
255 l.append( "nosound");
256 }
257#endif
234 //if ( !mData->agent.isEmpty() ) l.append( ); 258 //if ( !mData->agent.isEmpty() ) l.append( );
235 if ( mData->url.isValid() ) 259 if ( mData->url.isValid() )
236 if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() ); 260 if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() );
237 KABC::PhoneNumber::List phoneNumbers; 261 KABC::PhoneNumber::List phoneNumbers;
238 KABC::PhoneNumber::List::Iterator phoneIter; 262 KABC::PhoneNumber::List::Iterator phoneIter;
239 263
240 QStringList t; 264 QStringList t;
241 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end(); 265 for ( phoneIter = mData->phoneNumbers.begin(); phoneIter != mData->phoneNumbers.end();
@@ -273,16 +297,17 @@ void Addressee::computeCsum(const QString &dev)
273 } 297 }
274 uint cs = getCsum4List(l); 298 uint cs = getCsum4List(l);
275 299
276#if 0 300#if 0
277 for ( iii = 0; iii < l.count(); ++iii) 301 for ( iii = 0; iii < l.count(); ++iii)
278 qDebug("%d***%s***",iii,l[iii].latin1()); 302 qDebug("%d***%s***",iii,l[iii].latin1());
279 qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); 303 qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() );
280#endif 304#endif
305
281 306
282 setCsum( dev, QString::number (cs )); 307 setCsum( dev, QString::number (cs ));
283} 308}
284 309
285void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) 310void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
286{ 311{
287 // merge all standard non-outlook fields. 312 // merge all standard non-outlook fields.
288 //if isSubSet (e.g. mobile phone sync) merge all fields 313 //if isSubSet (e.g. mobile phone sync) merge all fields