summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp31
-rw-r--r--kaddressbook/imagewidget.cpp5
-rw-r--r--kaddressbook/kabcore.cpp7
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp2
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