-rw-r--r-- | kabc/addressbook.cpp | 9 | ||||
-rw-r--r-- | kabc/addressee.cpp | 8 | ||||
-rw-r--r-- | kabc/secrecy.h | 2 | ||||
-rw-r--r-- | kabc/vcard/VCardv.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/filter.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/filter.h | 2 | ||||
-rw-r--r-- | kaddressbook/filtereditdialog.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 16 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 3 |
10 files changed, 30 insertions, 17 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 | ||
947 | bool AddressBook::containsExternalUid( const QString& uid ) | 954 | bool 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; |
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp index 9cb4c2d..7a869fa 100644 --- a/kaddressbook/filter.cpp +++ b/kaddressbook/filter.cpp | |||
@@ -149,7 +149,7 @@ void Filter::restore( KConfig *config ) | |||
149 | mEnabled = config->readBoolEntry( "Enabled", true ); | 149 | mEnabled = config->readBoolEntry( "Enabled", true ); |
150 | mCategoryList = config->readListEntry( "Categories" ); | 150 | mCategoryList = config->readListEntry( "Categories" ); |
151 | mMatchRule = (MatchRule)config->readNumEntry( "MatchRule", Matching ); | 151 | mMatchRule = (MatchRule)config->readNumEntry( "MatchRule", Matching ); |
152 | mCriteria = config->readNumEntry( "Criteria", (ShowPublic | ShowPrivate| ShowConfidential) ); | 152 | mCriteria = config->readNumEntry( "Criteria", (ShowPublic | ShowPrivate| ShowConfidential ) ); |
153 | } | 153 | } |
154 | 154 | ||
155 | void Filter::save( KConfig *config, QString baseGroup, Filter::List &list ) | 155 | void Filter::save( KConfig *config, QString baseGroup, Filter::List &list ) |
diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h index 26870d7..93f1352 100644 --- a/kaddressbook/filter.h +++ b/kaddressbook/filter.h | |||
@@ -39,7 +39,7 @@ | |||
39 | class Filter | 39 | class Filter |
40 | { | 40 | { |
41 | public: | 41 | public: |
42 | enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4}; | 42 | enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 }; |
43 | void setCriteria(int c) { mCriteria = c ;} | 43 | void setCriteria(int c) { mCriteria = c ;} |
44 | int criteria() const { return mCriteria;} | 44 | int criteria() const { return mCriteria;} |
45 | typedef QValueList<Filter> List; | 45 | typedef QValueList<Filter> List; |
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp index 987f234..1194406 100644 --- a/kaddressbook/filtereditdialog.cpp +++ b/kaddressbook/filtereditdialog.cpp | |||
@@ -96,7 +96,6 @@ void FilterEditDialog::setFilter( const Filter &filter ) | |||
96 | mPublic->setChecked(c &Filter::ShowPublic); | 96 | mPublic->setChecked(c &Filter::ShowPublic); |
97 | mPrivate->setChecked(c & Filter::ShowPrivate); | 97 | mPrivate->setChecked(c & Filter::ShowPrivate); |
98 | mConfidential->setChecked(c & Filter::ShowConfidential); | 98 | mConfidential->setChecked(c & Filter::ShowConfidential); |
99 | |||
100 | } | 99 | } |
101 | 100 | ||
102 | Filter FilterEditDialog::filter() | 101 | Filter FilterEditDialog::filter() |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index e61f65f..aa04631 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -263,7 +263,7 @@ class KAex2phonePrefs : public QDialog | |||
263 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); | 263 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); |
264 | // lay->addWidget( mWriteToSim ); | 264 | // lay->addWidget( mWriteToSim ); |
265 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); | 265 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); |
266 | lab->setAlignment (AlignHCenter ); | 266 | lab->setAlignment (AlignHCenter); |
267 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 267 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
268 | lay->addWidget( ok ); | 268 | lay->addWidget( ok ); |
269 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 269 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
@@ -565,6 +565,8 @@ void KABCore::saveSettings() | |||
565 | mViewManager->saveSettings(); | 565 | mViewManager->saveSettings(); |
566 | 566 | ||
567 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 567 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
568 | KABPrefs::instance()->writeConfig(); | ||
569 | qDebug("KABPrefs::instance()->writeConfig() "); | ||
568 | } | 570 | } |
569 | 571 | ||
570 | KABC::AddressBook *KABCore::addressBook() const | 572 | KABC::AddressBook *KABCore::addressBook() const |
@@ -2685,6 +2687,7 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i | |||
2685 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); | 2687 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); |
2686 | //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); | 2688 | //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); |
2687 | locCh = ( localMod > mLastAddressbookSync ); | 2689 | locCh = ( localMod > mLastAddressbookSync ); |
2690 | //qDebug("cahnged rem %d loc %d",remCh, locCh ); | ||
2688 | if ( !remCh && ! locCh ) { | 2691 | if ( !remCh && ! locCh ) { |
2689 | //qDebug("both not changed "); | 2692 | //qDebug("both not changed "); |
2690 | lastSync = localMod.addDays(1); | 2693 | lastSync = localMod.addDays(1); |
@@ -2762,8 +2765,9 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i | |||
2762 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); | 2765 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); |
2763 | if ( lastSync > remoteMod ) | 2766 | if ( lastSync > remoteMod ) |
2764 | return 1; | 2767 | return 1; |
2765 | if ( lastSync > localMod ) | 2768 | if ( lastSync > localMod ) { |
2766 | return 2; | 2769 | return 2; |
2770 | } | ||
2767 | localIsNew = localMod >= remoteMod; | 2771 | localIsNew = localMod >= remoteMod; |
2768 | //qDebug("conflict! ************************************** "); | 2772 | //qDebug("conflict! ************************************** "); |
2769 | { | 2773 | { |
@@ -3006,10 +3010,12 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
3006 | bool skipIncidence = false; | 3010 | bool skipIncidence = false; |
3007 | if ( uid.left(19) == QString("last-syncAddressee-") ) | 3011 | if ( uid.left(19) == QString("last-syncAddressee-") ) |
3008 | skipIncidence = true; | 3012 | skipIncidence = true; |
3009 | if ( !filterOUT.name().isEmpty() && ! filterOUT.filterAddressee( inL ) ) | 3013 | if ( ! skipIncidence ) { |
3010 | skipIncidence = true; | ||
3011 | if ( !skipIncidence ) { | ||
3012 | inL = local->findByUid( uid ); | 3014 | inL = local->findByUid( uid ); |
3015 | if ( (!filterOUT.name().isEmpty()) && (! filterOUT.filterAddressee( inL ) ) ) | ||
3016 | skipIncidence = true; | ||
3017 | } | ||
3018 | if ( !skipIncidence ) { | ||
3013 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 3019 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
3014 | inR = remote->findByUid( uid ); | 3020 | inR = remote->findByUid( uid ); |
3015 | if ( inR.isEmpty() ) { // no conflict ********** add or delete local | 3021 | if ( inR.isEmpty() ) { // no conflict ********** add or delete local |
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 2832257..519dc92 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -227,7 +227,7 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce ) | |||
227 | { | 227 | { |
228 | save(); | 228 | save(); |
229 | mCore->saveSettings(); | 229 | mCore->saveSettings(); |
230 | KABPrefs::instance()->writeConfig(); | 230 | //KABPrefs::instance()->writeConfig(); |
231 | } | 231 | } |
232 | 232 | ||
233 | ce->accept(); | 233 | ce->accept(); |
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 9c3a641..4be860e 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -283,12 +283,11 @@ void ViewManager::setActiveView( const QString &name ) | |||
283 | 283 | ||
284 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() | 284 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() |
285 | //US mActiveView->refresh(); | 285 | //US mActiveView->refresh(); |
286 | 286 | mCore->saveSettings(); | |
287 | } | 287 | } |
288 | else | 288 | else |
289 | { | 289 | { |
290 | qDebug("ViewManager::setActiveView: unable to find view" ); | 290 | qDebug("ViewManager::setActiveView: unable to find view" ); |
291 | kdDebug(5720) << "ViewManager::setActiveView: unable to find view\n"; | ||
292 | } | 291 | } |
293 | } | 292 | } |
294 | 293 | ||