summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-01-17 12:18:59 (UTC)
committer zautrix <zautrix>2005-01-17 12:18:59 (UTC)
commit6b166ece0a576e9be9c71a61fab5424d75a9301f (patch) (side-by-side diff)
treeb88bf3e82cafc0ac279eb46b8ebc61f112083032 /kaddressbook
parent376ffdba71ab4d7d7988229f38678394a54e5576 (diff)
downloadkdepimpi-6b166ece0a576e9be9c71a61fab5424d75a9301f.zip
kdepimpi-6b166ece0a576e9be9c71a61fab5424d75a9301f.tar.gz
kdepimpi-6b166ece0a576e9be9c71a61fab5424d75a9301f.tar.bz2
many AB fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-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
6 files changed, 15 insertions, 11 deletions
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index 9cb4c2d..7a869fa 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -146,13 +146,13 @@ void Filter::save( KConfig *config )
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 )
{
{
KConfigGroupSaver s( config, baseGroup );
diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h
index 26870d7..93f1352 100644
--- a/kaddressbook/filter.h
+++ b/kaddressbook/filter.h
@@ -36,13 +36,13 @@
@todo This class should be switched to use shared data.
*/
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;
enum MatchRule { Matching = 0, NotMatching = 1 };
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp
index 987f234..1194406 100644
--- a/kaddressbook/filtereditdialog.cpp
+++ b/kaddressbook/filtereditdialog.cpp
@@ -93,13 +93,12 @@ void FilterEditDialog::setFilter( const Filter &filter )
mMatchRuleGroup->setButton( 1 );
int c = filter.criteria() ;
mPublic->setChecked(c &Filter::ShowPublic);
mPrivate->setChecked(c & Filter::ShowPrivate);
mConfidential->setChecked(c & Filter::ShowConfidential);
-
}
Filter FilterEditDialog::filter()
{
Filter filter;
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index e61f65f..aa04631 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -260,13 +260,13 @@ class KAex2phonePrefs : public QDialog
new QLabel( i18n("Model(opt.): "), temphb );
mPhoneModel = new QLineEdit( temphb);
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 );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
@@ -562,12 +562,14 @@ void KABCore::saveSettings()
KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
#endif //KAB_EMBEDDED
mExtensionManager->saveSettings();
mViewManager->saveSettings();
KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
+ KABPrefs::instance()->writeConfig();
+ qDebug("KABPrefs::instance()->writeConfig() ");
}
KABC::AddressBook *KABCore::addressBook() const
{
return mAddressBook;
}
@@ -2682,12 +2684,13 @@ 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() );
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 {
@@ -2759,14 +2762,15 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
return 2;
break;
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 );
result = acd.executeD(localIsNew);
return result;
@@ -3003,16 +3007,18 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
if ( incCounter % modulo == 0 )
syncManager->showProgressBar(incCounter);
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 ) {
if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
// pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index 2832257..519dc92 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -224,13 +224,13 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce )
return;
if (mModified == true)
{
save();
mCore->saveSettings();
- KABPrefs::instance()->writeConfig();
+ //KABPrefs::instance()->writeConfig();
}
ce->accept();
}
#ifndef KAB_EMBEDDED
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 9c3a641..4be860e 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -280,18 +280,17 @@ void ViewManager::setActiveView( const QString &name )
// Update the inc search widget to show the fields in the new active
// view.
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.
void ViewManager::refreshView()
{