summaryrefslogtreecommitdiffabout
path: root/kabc
authorzautrix <zautrix>2005-01-17 12:18:59 (UTC)
committer zautrix <zautrix>2005-01-17 12:18:59 (UTC)
commit6b166ece0a576e9be9c71a61fab5424d75a9301f (patch) (unidiff)
treeb88bf3e82cafc0ac279eb46b8ebc61f112083032 /kabc
parent376ffdba71ab4d7d7988229f38678394a54e5576 (diff)
downloadkdepimpi-6b166ece0a576e9be9c71a61fab5424d75a9301f.zip
kdepimpi-6b166ece0a576e9be9c71a61fab5424d75a9301f.tar.gz
kdepimpi-6b166ece0a576e9be9c71a61fab5424d75a9301f.tar.bz2
many AB fixes
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp9
-rw-r--r--kabc/addressee.cpp8
-rw-r--r--kabc/secrecy.h2
-rw-r--r--kabc/vcard/VCardv.cpp2
4 files changed, 15 insertions, 6 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 8487ff3..4de7da2 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -920,6 +920,7 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool
920{ 920{
921 //qDebug("AddressBook::postExternSync "); 921 //qDebug("AddressBook::postExternSync ");
922 AddressBook::Iterator it; 922 AddressBook::Iterator it;
923 int foundEmpty = 0;
923 for ( it = begin(); it != end(); ++it ) { 924 for ( it = begin(); it != end(); ++it ) {
924 //qDebug("check uid %s ", (*it).uid().latin1() ); 925 //qDebug("check uid %s ", (*it).uid().latin1() );
925 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || 926 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ||
@@ -927,7 +928,9 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool
927 (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) { 928 (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) {
928 Addressee ad = aBook->findByUid( ( (*it).uid() )); 929 Addressee ad = aBook->findByUid( ( (*it).uid() ));
929 if ( ad.isEmpty() ) { 930 if ( ad.isEmpty() ) {
930 qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1()); 931 ++foundEmpty;
932 //qDebug("postExternSync:addressee is empty: %s ", (*it).uid().latin1());
933 //qDebug("-- formatted name %s ",(*it).formattedName().latin1() );
931 } else { 934 } else {
932 (*it).setIDStr(":"); 935 (*it).setIDStr(":");
933 if ( setID ) { 936 if ( setID ) {
@@ -942,6 +945,10 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool
942 } 945 }
943 } 946 }
944 } 947 }
948 if ( foundEmpty ) {
949 qDebug("postExternSync:%d empty addressees found:\n probably filtered out by incoming sync filter.",foundEmpty );
950 }
951
945} 952}
946 953
947bool AddressBook::containsExternalUid( const QString& uid ) 954bool AddressBook::containsExternalUid( const QString& uid )
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 568dfc4..d60cd6b 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -255,13 +255,13 @@ void Addressee::computeCsum(const QString &dev)
255 l.append( t[iii] ); 255 l.append( t[iii] );
256 t = mData->custom; 256 t = mData->custom;
257 t.sort(); 257 t.sort();
258 for ( iii = 0; iii < t.count(); ++iii) 258 for ( iii = 0; iii < t.count(); ++iii)
259 if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) { 259 if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) {
260 int find = t[iii].find (':')+1; 260 int find = t[iii].find (':')+1;
261 //qDebug("lennnn %d %d ", find, t[iii].length()); 261 //qDebug("lennnn %d %d ", find, t[iii].length());
262 if ( find < t[iii].length()) 262 if ( find < t[iii].length())
263 l.append( t[iii] ); 263 l.append( t[iii] );
264 264
265 } 265 }
266 KABC::Address::List::Iterator addressIter; 266 KABC::Address::List::Iterator addressIter;
267 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end(); 267 for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end();
@@ -272,11 +272,13 @@ void Addressee::computeCsum(const QString &dev)
272 l.append( t[iii] ); 272 l.append( t[iii] );
273 } 273 }
274 uint cs = getCsum4List(l); 274 uint cs = getCsum4List(l);
275
275#if 0 276#if 0
276 for ( iii = 0; iii < l.count(); ++iii) 277 for ( iii = 0; iii < l.count(); ++iii)
277 qDebug("%d***%s***",iii,l[iii].latin1()); 278 qDebug("%d***%s***",iii,l[iii].latin1());
278 qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); 279 qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() );
279#endif 280#endif
281
280 setCsum( dev, QString::number (cs )); 282 setCsum( dev, QString::number (cs ));
281} 283}
282 284
diff --git a/kabc/secrecy.h b/kabc/secrecy.h
index 8f2f736..b2ff565 100644
--- a/kabc/secrecy.h
+++ b/kabc/secrecy.h
@@ -59,7 +59,7 @@ public:
59 * 59 *
60 * @param type The secrecy type, @see Types. 60 * @param type The secrecy type, @see Types.
61 */ 61 */
62 Secrecy( int type = Invalid ); 62 Secrecy( int type = Public );
63 63
64 bool operator==( const Secrecy & ) const; 64 bool operator==( const Secrecy & ) const;
65 bool operator!=( const Secrecy & ) const; 65 bool operator!=( const Secrecy & ) const;
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
index 1166aac..bad2ef1 100644
--- a/kabc/vcard/VCardv.cpp
+++ b/kabc/vcard/VCardv.cpp
@@ -172,7 +172,7 @@ VCard::_parse()
172 cur = (*it); 172 cur = (*it);
173 ++it; 173 ++it;
174 while ( it!= l.end() && (*it).at(0) == ' '&& (*it).length()!= 1) { 174 while ( it!= l.end() && (*it).at(0) == ' '&& (*it).length()!= 1) {
175 cur += (*it) ; 175 cur += (*it).mid(1) ;
176 ++it; 176 ++it;
177 } 177 }
178 --it; 178 --it;