summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
authorzautrix <zautrix>2004-10-28 07:46:21 (UTC)
committer zautrix <zautrix>2004-10-28 07:46:21 (UTC)
commitaada2527dee908aa96bfc16f5faddd3b29372bee (patch) (unidiff)
tree7ca9bbe5dc64684ec94110becf63d80ae9ad0edd /kaddressbook/viewmanager.cpp
parent2fe1a56682ef4dc1fa0a30f764c7313b583631c5 (diff)
downloadkdepimpi-aada2527dee908aa96bfc16f5faddd3b29372bee.zip
kdepimpi-aada2527dee908aa96bfc16f5faddd3b29372bee.tar.gz
kdepimpi-aada2527dee908aa96bfc16f5faddd3b29372bee.tar.bz2
compile fixes
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 3d0c275..0d91c12 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -85,49 +85,49 @@ ViewManager::~ViewManager()
85 unloadViews(); 85 unloadViews();
86 mViewFactoryDict.clear(); 86 mViewFactoryDict.clear();
87} 87}
88void ViewManager::scrollUP() 88void ViewManager::scrollUP()
89{ 89{
90 if ( mActiveView ) 90 if ( mActiveView )
91 mActiveView->scrollUP(); 91 mActiveView->scrollUP();
92} 92}
93void ViewManager::scrollDOWN() 93void ViewManager::scrollDOWN()
94{ 94{
95 if ( mActiveView ) 95 if ( mActiveView )
96 mActiveView->scrollDOWN(); 96 mActiveView->scrollDOWN();
97} 97}
98void ViewManager::restoreSettings() 98void ViewManager::restoreSettings()
99{ 99{
100 mViewNameList = KABPrefs::instance()->mViewNames; 100 mViewNameList = KABPrefs::instance()->mViewNames;
101 QString activeViewName = KABPrefs::instance()->mCurrentView; 101 QString activeViewName = KABPrefs::instance()->mCurrentView;
102 102
103 mActionSelectView->setItems( mViewNameList ); 103 mActionSelectView->setItems( mViewNameList );
104 104
105 // Filter 105 // Filter
106 mFilterList = Filter::restore( mCore->config(), "Filter" ); 106 mFilterList = Filter::restore( mCore->config(), "Filter" );
107 mActionSelectFilter->setItems( filterNames() ); 107 mActionSelectFilter->setItems( filterNames() );
108 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 108 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
109 mActionSelectFilter->setComboWidth( 100 ); 109 mActionSelectFilter->setComboWidth( 150 );
110 // Tell the views to reread their config, since they may have 110 // Tell the views to reread their config, since they may have
111 // been modified by global settings 111 // been modified by global settings
112 QString _oldgroup = mCore->config()->group(); 112 QString _oldgroup = mCore->config()->group();
113 113
114 QDictIterator<KAddressBookView> it( mViewDict ); 114 QDictIterator<KAddressBookView> it( mViewDict );
115 for ( it.toFirst(); it.current(); ++it ) { 115 for ( it.toFirst(); it.current(); ++it ) {
116 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 116 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
117 it.current()->readConfig( mCore->config() ); 117 it.current()->readConfig( mCore->config() );
118 } 118 }
119 setActiveView( activeViewName ); 119 setActiveView( activeViewName );
120 120
121 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 121 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
122} 122}
123 123
124void ViewManager::saveSettings() 124void ViewManager::saveSettings()
125{ 125{
126 QString _oldgroup = mCore->config()->group(); 126 QString _oldgroup = mCore->config()->group();
127 127
128 QDictIterator<KAddressBookView> it( mViewDict ); 128 QDictIterator<KAddressBookView> it( mViewDict );
129 for ( it.toFirst(); it.current(); ++it ) { 129 for ( it.toFirst(); it.current(); ++it ) {
130 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 130 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
131#ifdef DESKTOP_VERSION 131#ifdef DESKTOP_VERSION
132 (*it)->writeConfig( mCore->config() ); 132 (*it)->writeConfig( mCore->config() );
133#else 133#else
@@ -576,49 +576,49 @@ void ViewManager::setActiveFilter( int index )
576 currentFilter = mFilterList[ index - 1 ]; 576 currentFilter = mFilterList[ index - 1 ];
577 577
578 // Check if we have a view. Since the filter combo is created before 578 // Check if we have a view. Since the filter combo is created before
579 // the view, this slot could be called before there is a valid view. 579 // the view, this slot could be called before there is a valid view.
580 if ( mActiveView ) { 580 if ( mActiveView ) {
581 mActiveView->setFilter( currentFilter ); 581 mActiveView->setFilter( currentFilter );
582 mActiveView->refresh(); 582 mActiveView->refresh();
583 emit selected( QString::null ); 583 emit selected( QString::null );
584 } 584 }
585} 585}
586 586
587void ViewManager::configureFilters() 587void ViewManager::configureFilters()
588{ 588{
589 FilterDialog dlg( this ); 589 FilterDialog dlg( this );
590 590
591 dlg.setFilters( mFilterList ); 591 dlg.setFilters( mFilterList );
592 592
593 if ( dlg.exec() ) 593 if ( dlg.exec() )
594 mFilterList = dlg.filters(); 594 mFilterList = dlg.filters();
595 595
596 uint pos = mActionSelectFilter->currentItem(); 596 uint pos = mActionSelectFilter->currentItem();
597 mActionSelectFilter->setItems( filterNames() ); 597 mActionSelectFilter->setItems( filterNames() );
598 mActionSelectFilter->setCurrentItem( pos ); 598 mActionSelectFilter->setCurrentItem( pos );
599 setActiveFilter( pos ); 599 setActiveFilter( pos );
600 //mActionSelectFilter->setComboWidth( 150 ); 600 mActionSelectFilter->setComboWidth( 150 );
601} 601}
602 602
603QStringList ViewManager::filterNames() const 603QStringList ViewManager::filterNames() const
604{ 604{
605 QStringList names( i18n( "No Filter" ) ); 605 QStringList names( i18n( "No Filter" ) );
606 606
607 Filter::List::ConstIterator it; 607 Filter::List::ConstIterator it;
608 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 608 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
609 names.append( (*it).name() ); 609 names.append( (*it).name() );
610 610
611 return names; 611 return names;
612} 612}
613 613
614int ViewManager::filterPosition( const QString &name ) const 614int ViewManager::filterPosition( const QString &name ) const
615{ 615{
616 int pos = 0; 616 int pos = 0;
617 617
618 Filter::List::ConstIterator it; 618 Filter::List::ConstIterator it;
619 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos ) 619 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
620 if ( name == (*it).name() ) 620 if ( name == (*it).name() )
621 return pos + 1; 621 return pos + 1;
622 622
623 return 0; 623 return 0;
624} 624}