summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (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
-rw-r--r--kaddressbook/filter.cpp2
-rw-r--r--kaddressbook/filter.h2
-rw-r--r--kaddressbook/filtereditdialog.cpp1
-rw-r--r--kaddressbook/kabcore.cpp16
-rw-r--r--kaddressbook/kaddressbookmain.cpp2
-rw-r--r--kaddressbook/viewmanager.cpp3
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
@@ -919,16 +919,19 @@ void AddressBook::preExternSync( AddressBook* aBook, const QString& csd , bool i
void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool setID)
{
//qDebug("AddressBook::postExternSync ");
AddressBook::Iterator it;
+ int foundEmpty = 0;
for ( it = begin(); it != end(); ++it ) {
//qDebug("check uid %s ", (*it).uid().latin1() );
if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ||
(*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ||
(*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) {
Addressee ad = aBook->findByUid( ( (*it).uid() ));
if ( ad.isEmpty() ) {
- qDebug("postExternSync:ERROR addressee is empty: %s ", (*it).uid().latin1());
+ ++foundEmpty;
+ //qDebug("postExternSync:addressee is empty: %s ", (*it).uid().latin1());
+ //qDebug("-- formatted name %s ",(*it).formattedName().latin1() );
} else {
(*it).setIDStr(":");
if ( setID ) {
if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID )
@@ -941,8 +944,12 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool
aBook->insertAddressee( ad , false);
}
}
}
+ if ( foundEmpty ) {
+ qDebug("postExternSync:%d empty addressees found:\n probably filtered out by incoming sync filter.",foundEmpty );
+ }
+
}
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
@@ -254,15 +254,15 @@ void Addressee::computeCsum(const QString &dev)
for ( iii = 0; iii < t.count(); ++iii)
l.append( t[iii] );
t = mData->custom;
t.sort();
- for ( iii = 0; iii < t.count(); ++iii)
+ for ( iii = 0; iii < t.count(); ++iii)
if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) {
int find = t[iii].find (':')+1;
//qDebug("lennnn %d %d ", find, t[iii].length());
if ( find < t[iii].length())
- l.append( t[iii] );
-
+ l.append( t[iii] );
+
}
KABC::Address::List::Iterator addressIter;
for ( addressIter = mData->addresses.begin(); addressIter != mData->addresses.end();
++addressIter ) {
@@ -271,13 +271,15 @@ void Addressee::computeCsum(const QString &dev)
for ( iii = 0; iii < t.count(); ++iii)
l.append( t[iii] );
}
uint cs = getCsum4List(l);
+
#if 0
for ( iii = 0; iii < l.count(); ++iii)
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 ));
}
void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
diff --git a/kabc/secrecy.h b/kabc/secrecy.h
index 8f2f736..b2ff565 100644
--- a/kabc/secrecy.h
+++ b/kabc/secrecy.h
@@ -58,9 +58,9 @@ public:
* Constructor.
*
* @param type The secrecy type, @see Types.
*/
- Secrecy( int type = Invalid );
+ Secrecy( int type = Public );
bool operator==( const Secrecy & ) const;
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
@@ -171,9 +171,9 @@ VCard::_parse()
for (; it != l.end(); ++it) {
cur = (*it);
++it;
while ( it!= l.end() && (*it).at(0) == ' ' && (*it).length()!= 1) {
- cur += (*it) ;
+ cur += (*it).mid(1) ;
++it;
}
--it;
refolded.append(cur);
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index 9cb4c2d..7a869fa 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -148,9 +148,9 @@ void Filter::restore( KConfig *config )
mName = config->readEntry( "Name", "<internal error>" );
mEnabled = config->readBoolEntry( "Enabled", true );
mCategoryList = config->readListEntry( "Categories" );
mMatchRule = (MatchRule)config->readNumEntry( "MatchRule", Matching );
- mCriteria = config->readNumEntry( "Criteria", (ShowPublic | ShowPrivate| ShowConfidential) );
+ mCriteria = config->readNumEntry( "Criteria", (ShowPublic | ShowPrivate| ShowConfidential ) );
}
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
@@ -38,9 +38,9 @@
*/
class Filter
{
public:
- enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4};
+ enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 };
void setCriteria(int c) { mCriteria = c ;}
int criteria() const { return mCriteria;}
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
@@ -95,9 +95,8 @@ void FilterEditDialog::setFilter( const Filter &filter )
int c = filter.criteria() ;
mPublic->setChecked(c &Filter::ShowPublic);
mPrivate->setChecked(c & Filter::ShowPrivate);
mConfidential->setChecked(c & Filter::ShowConfidential);
-
}
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
@@ -262,9 +262,9 @@ class KAex2phonePrefs : public QDialog
lay->addWidget( temphb );
// mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
// lay->addWidget( mWriteToSim );
lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
- lab->setAlignment (AlignHCenter );
+ lab->setAlignment (AlignHCenter);
QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
@@ -564,8 +564,10 @@ void KABCore::saveSettings()
mExtensionManager->saveSettings();
mViewManager->saveSettings();
KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
+ KABPrefs::instance()->writeConfig();
+ qDebug("KABPrefs::instance()->writeConfig() ");
}
KABC::AddressBook *KABCore::addressBook() const
{
@@ -2684,8 +2686,9 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
bool remCh, locCh;
remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
//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 )
@@ -2761,10 +2764,11 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
case SYNC_PREF_ASK:
//qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
if ( lastSync > remoteMod )
return 1;
- if ( lastSync > localMod )
+ if ( lastSync > localMod ) {
return 2;
+ }
localIsNew = localMod >= remoteMod;
//qDebug("conflict! ************************************** ");
{
KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this );
@@ -3005,12 +3009,14 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
uid = el[ incCounter ];
bool skipIncidence = false;
if ( uid.left(19) == QString("last-syncAddressee-") )
skipIncidence = true;
- if ( !filterOUT.name().isEmpty() && ! filterOUT.filterAddressee( inL ) )
- skipIncidence = true;
- if ( !skipIncidence ) {
+ if ( ! skipIncidence ) {
inL = local->findByUid( uid );
+ if ( (!filterOUT.name().isEmpty()) && (! filterOUT.filterAddressee( inL ) ) )
+ skipIncidence = true;
+ }
+ if ( !skipIncidence ) {
if ( !inL.resource() || inL.resource()->includeInSync() ) {
inR = remote->findByUid( uid );
if ( inR.isEmpty() ) { // no conflict ********** add or delete local
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index 2832257..519dc92 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -226,9 +226,9 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce )
if (mModified == true)
{
save();
mCore->saveSettings();
- KABPrefs::instance()->writeConfig();
+ //KABPrefs::instance()->writeConfig();
}
ce->accept();
}
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 9c3a641..4be860e 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -282,14 +282,13 @@ void ViewManager::setActiveView( const QString &name )
mCore->setSearchFields( mActiveView->fields() );
//US performance optimization. setActiveFilter calls also mActiveView->refresh()
//US mActiveView->refresh();
-
+ mCore->saveSettings();
}
else
{
qDebug("ViewManager::setActiveView: unable to find view" );
- kdDebug(5720) << "ViewManager::setActiveView: unable to find view\n";
}
}
//US added another method with no parameter, since my moc compiler does not support default parameters.