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) (unidiff)
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 )
146void Filter::restore( KConfig *config ) 146void Filter::restore( KConfig *config )
147{ 147{
148 mName = config->readEntry( "Name", "<internal error>" ); 148 mName = config->readEntry( "Name", "<internal error>" );
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
155void Filter::save( KConfig *config, QString baseGroup, Filter::List &list ) 155void Filter::save( KConfig *config, QString baseGroup, Filter::List &list )
156{ 156{
157 { 157 {
158 KConfigGroupSaver s( config, baseGroup ); 158 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 @@
36 36
37 @todo This class should be switched to use shared data. 37 @todo This class should be switched to use shared data.
38 */ 38 */
39class Filter 39class 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;
46 46
47 enum MatchRule { Matching = 0, NotMatching = 1 }; 47 enum MatchRule { Matching = 0, NotMatching = 1 };
48 48
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 )
93 mMatchRuleGroup->setButton( 1 ); 93 mMatchRuleGroup->setButton( 1 );
94 94
95 int c = filter.criteria() ; 95 int c = filter.criteria() ;
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
102Filter FilterEditDialog::filter() 101Filter FilterEditDialog::filter()
103{ 102{
104 Filter filter; 103 Filter filter;
105 104
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
260 new QLabel( i18n("Model(opt.): "), temphb ); 260 new QLabel( i18n("Model(opt.): "), temphb );
261 mPhoneModel = new QLineEdit( temphb); 261 mPhoneModel = new QLineEdit( temphb);
262 lay->addWidget( temphb ); 262 lay->addWidget( temphb );
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 );
270 lay->addWidget( cancel ); 270 lay->addWidget( cancel );
271 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 271 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
272 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 272 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
@@ -562,12 +562,14 @@ void KABCore::saveSettings()
562 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 562 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
563#endif //KAB_EMBEDDED 563#endif //KAB_EMBEDDED
564 mExtensionManager->saveSettings(); 564 mExtensionManager->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
570KABC::AddressBook *KABCore::addressBook() const 572KABC::AddressBook *KABCore::addressBook() const
571{ 573{
572 return mAddressBook; 574 return mAddressBook;
573} 575}
@@ -2682,12 +2684,13 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
2682 2684
2683 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2685 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2684 bool remCh, locCh; 2686 bool remCh, locCh;
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);
2691 if ( mode <= SYNC_PREF_ASK ) 2694 if ( mode <= SYNC_PREF_ASK )
2692 return 0; 2695 return 0;
2693 } else { 2696 } else {
@@ -2759,14 +2762,15 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i
2759 return 2; 2762 return 2;
2760 break; 2763 break;
2761 case SYNC_PREF_ASK: 2764 case SYNC_PREF_ASK:
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 {
2770 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this ); 2774 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this );
2771 result = acd.executeD(localIsNew); 2775 result = acd.executeD(localIsNew);
2772 return result; 2776 return result;
@@ -3003,16 +3007,18 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3003 if ( incCounter % modulo == 0 ) 3007 if ( incCounter % modulo == 0 )
3004 syncManager->showProgressBar(incCounter); 3008 syncManager->showProgressBar(incCounter);
3005 uid = el[ incCounter ]; 3009 uid = el[ incCounter ];
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
3016 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3022 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3017 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 3023 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
3018 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3024 // 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 )
224 return; 224 return;
225 225
226 if (mModified == true) 226 if (mModified == true)
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();
234} 234}
235 235
236#ifndef KAB_EMBEDDED 236#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 )
280 // Update the inc search widget to show the fields in the new active 280 // Update the inc search widget to show the fields in the new active
281 // view. 281 // view.
282 mCore->setSearchFields( mActiveView->fields() ); 282 mCore->setSearchFields( mActiveView->fields() );
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
295//US added another method with no parameter, since my moc compiler does not support default parameters. 294//US added another method with no parameter, since my moc compiler does not support default parameters.
296void ViewManager::refreshView() 295void ViewManager::refreshView()
297{ 296{