-rw-r--r-- | kaddressbook/imagewidget.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index 1e9743c..d0f52ea 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -227,32 +227,33 @@ void ImageWidget::setLogo( const KABC::Picture &logo ) KABC::Picture ImageWidget::logo() const { KABC::Picture logo; if ( mUseLogoUrl->isChecked() ) logo.setUrl( mLogoUrl->url() ); else { QPixmap *px = mLogoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) logo.setData( px->convertToImage().scaleHeight( 140 ) ); else logo.setData( px->convertToImage().scaleWidth( 100 ) ); #else //KAB_EMBEDDED + if (px->isNull() != true ) logo.setData( px->convertToImage() ); #endif //KAB_EMBEDDED logo.setType( "PNG" ); } } return logo; } void ImageWidget::removePhoto() { setPhoto(KABC::Picture() ); } void ImageWidget::removeLogo() { diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index d970ff1..e88706e 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1175,32 +1175,36 @@ void KABCore::setModified( bool modified ) if ( modified ) mJumpButtonBar->recreateButtons(); mViewManager->refreshView(); } bool KABCore::modified() const { return mModified; } 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 ) { Command *command = 0; QString uid; // check if it exists already KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); if ( origAddr.isEmpty() ) command = new PwNewCommand( mAddressBook, addr ); else { command = new PwEditCommand( mAddressBook, origAddr, addr ); uid = addr.uid(); } @@ -2700,33 +2704,34 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i // int zaurusUid() const; // void setZaurusStat(int id); // int zaurusStat() const; // 0 equal // 1 take local // 2 take remote // 3 cancel QDateTime lastSync = mLastAddressbookSync; QDateTime localMod = local->revision(); QDateTime remoteMod = remote->revision(); QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 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 ) { //qDebug("both not changed "); lastSync = localMod.addDays(1); if ( mode <= SYNC_PREF_ASK ) return 0; } else { if ( locCh ) { //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); lastSync = localMod.addDays( -1 ); if ( !remCh ) remoteMod =( lastSync.addDays( -1 ) ); } else { //qDebug(" not loc changed "); lastSync = localMod.addDays( 1 ); 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 @@ -144,33 +144,33 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) return; } QString pattern = s.lower()+"*"; QRegExp re; re.setWildcard(true); // most people understand these better. re.setCaseSensitive(false); re.setPattern( pattern ); if (!re.isValid()) return; KABC::Addressee::List addresseeList = addressees(); KABC::Addressee::List::Iterator it; if ( field ) { for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 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 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); } } else { KABC::Field::List fieldList = allFields(); KABC::Field::List::ConstIterator fieldIt; for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { #if QT_VERSION >= 300 if (re.search((*fieldIt)->value( *it ).lower()) != -1) #else |