author | zautrix <zautrix> | 2005-01-18 14:09:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-18 14:09:00 (UTC) |
commit | ced210b0c4643ddac6a2e80eab4c85c1994b20e0 (patch) (side-by-side diff) | |
tree | 5126b599b1213553ae71512a400f46d7b2037d92 | |
parent | 4b82a36d1b2479dd2e6f00aef45af848f6793099 (diff) | |
download | kdepimpi-ced210b0c4643ddac6a2e80eab4c85c1994b20e0.zip kdepimpi-ced210b0c4643ddac6a2e80eab4c85c1994b20e0.tar.gz kdepimpi-ced210b0c4643ddac6a2e80eab4c85c1994b20e0.tar.bz2 |
ab sync fixes
-rw-r--r-- | kabc/addressee.cpp | 31 | ||||
-rw-r--r-- | kaddressbook/imagewidget.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
4 files changed, 38 insertions, 7 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index bfcfab5..18b4d58 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -196,6 +196,7 @@ ulong Addressee::getCsum4List( const QStringList & attList) int ii = i+1; add = add * mul *ii*ii*ii; cSum += add; + //qDebug("csum: %d %d %d", i,k,cSum); } } @@ -228,9 +229,32 @@ void Addressee::computeCsum(const QString &dev) if ( !mData->productId.isEmpty() ) l.append(mData->productId ); if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); - // if ( !mData->logo.isEmpty() ) l.append( ); - //if ( !mData->photo.isEmpty() ) l.append( ); - //if ( !mData->sound.isEmpty() ) l.append( ); + if ( !mData->logo.undefined() ) { + if ( !mData->logo.isIntern() ) + l.append( mData->logo.url() ); + else + l.append( QString::number(mData->logo.data().width()* mData->logo.data().height())); + } else { + l.append( "nologo"); + } + if ( !mData->photo.undefined() ) { + if ( !mData->photo.isIntern() ) + l.append( mData->photo.url() ); + else + l.append( QString::number(mData->photo.data().width()* mData->photo.data().height())); + } else { + l.append( "nophoto"); + } +#if 0 + if ( !mData->sound.undefined() ) { + if ( !mData->sound.isIntern() ) + l.append( mData->sound.url() ); + else + l.append( QString(mData->sound.data().with()* mData->sound.data().height())); + } else { + l.append( "nosound"); + } +#endif //if ( !mData->agent.isEmpty() ) l.append( ); if ( mData->url.isValid() ) if ( ! mData->url.path().isEmpty()) l.append( mData->url.path() ); @@ -278,6 +302,7 @@ void Addressee::computeCsum(const QString &dev) qDebug("%d***%s***",iii,l[iii].latin1()); qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); #endif + setCsum( dev, QString::number (cs )); } diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index 1e9743c..d0f52ea 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -239,8 +239,9 @@ KABC::Picture ImageWidget::logo() const logo.setData( px->convertToImage().scaleHeight( 140 ) ); else logo.setData( px->convertToImage().scaleWidth( 100 ) ); -#else //KAB_EMBEDDED - logo.setData( px->convertToImage() ); +#else //KAB_EMBEDDED + if (px->isNull() != true ) + logo.setData( px->convertToImage() ); #endif //KAB_EMBEDDED logo.setType( "PNG" ); diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index d970ff1..e88706e 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1188,6 +1188,10 @@ bool KABCore::modified() const void KABCore::contactModified( const KABC::Addressee &addr ) { addrModified( addr ); +#if 0 // debug only + KABC::Addressee ad = addr; + ad.computeCsum( "123"); +#endif } void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) @@ -2713,7 +2717,8 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { bool remCh, locCh; remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); - //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); + if ( remCh ) + qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); locCh = ( localMod > mLastAddressbookSync ); //qDebug("cahnged rem %d loc %d",remCh, locCh ); if ( !remCh && ! locCh ) { diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index ecd6f05..7022dcb 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -157,7 +157,7 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; #if QT_VERSION >= 300 - if (re.search(field->value( *it ).lower()) != -1) + if (re.search(field->value( *it ).lower()) == 0) #else if (re.match(field->value( *it ).lower()) != -1) #endif |