summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxportselectdialog.cpp
authorzautrix <zautrix>2005-01-17 18:22:47 (UTC)
committer zautrix <zautrix>2005-01-17 18:22:47 (UTC)
commit32479683283fc9f20d369ac9671ba0f8a33d3381 (patch) (unidiff)
tree0d764657db915bd2d2bf2fb751800eb14515626b /kaddressbook/xxportselectdialog.cpp
parent11e05160cda1571a208edbabc71f6d94e394d829 (diff)
downloadkdepimpi-32479683283fc9f20d369ac9671ba0f8a33d3381.zip
kdepimpi-32479683283fc9f20d369ac9671ba0f8a33d3381.tar.gz
kdepimpi-32479683283fc9f20d369ac9671ba0f8a33d3381.tar.bz2
fast set formatted name
Diffstat (limited to 'kaddressbook/xxportselectdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxportselectdialog.cpp48
1 files changed, 44 insertions, 4 deletions
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index 6282453..e7bc8c0 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -56,3 +56,3 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
56 QWidget* parent, const char* name ) 56 QWidget* parent, const char* name )
57 : KDialogBase( Plain, i18n( "Choose which contacts to select" ), Help | Ok | Cancel, 57 : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel,
58 Ok, parent, name, true, true ), mCore( core ), 58 Ok, parent, name, true, true ), mCore( core ),
@@ -111,5 +111,44 @@ QStringList XXPortSelectDialog::uids()
111} 111}
112void XXPortSelectDialog::tagSelected()
113{
114 if ( mUseSelection->isChecked() ) {
115
116 QStringList selection = mCore->selectedUIDs();
117 KABC::AddressBook::Iterator it;
118 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
119 if ( selection.findIndex((*it).uid()) >= 0 )
120 (*it).setTagged( true );
121 }
122 } else if ( mUseFilters->isChecked() ) {
123 // find contacts that can pass selected filter
124 Filter::List::Iterator filterIt;
125 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
126 if ( (*filterIt).name() == mFiltersCombo->currentText() )
127 break;
128 KABC::AddressBook::Iterator it;
129 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
130 if ( (*filterIt).filterAddressee( *it ) )
131 (*it).setTagged( true );
132 }
133 } else if ( mUseCategories->isChecked() ) {
134 QStringList categorieList = categories();
135 KABC::AddressBook::Iterator it;
136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
137 QStringList tmp( (*it).categories() );
138 QStringList::Iterator tmpIt;
139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
140 if ( categorieList.contains( *tmpIt ) ) {
141 (*it).setTagged( true );
142 break;
143 }
144 }
145 } else {
146 // create a string list of all entries:
147 KABC::AddressBook::Iterator it;
148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
149 (*it).setTagged( true );
150 }
151}
112KABC::AddresseeList XXPortSelectDialog::contacts() 152KABC::AddresseeList XXPortSelectDialog::contacts()
113{ 153{
114 QStringList selection = mCore->selectedUIDs();
115 154
@@ -118,2 +157,3 @@ KABC::AddresseeList XXPortSelectDialog::contacts()
118 QStringList::Iterator it; 157 QStringList::Iterator it;
158 QStringList selection = mCore->selectedUIDs();
119 for ( it = selection.begin(); it != selection.end(); ++it ) { 159 for ( it = selection.begin(); it != selection.end(); ++it ) {
@@ -248,4 +288,4 @@ void XXPortSelectDialog::initGUI()
248 288
249 // if (QApplication::desktop()->height() == 480 ) 289 if (QApplication::desktop()->height() == 480 )
250 // mCategoriesView->setMaximumHeight( 240 ); 290 mCategoriesView->setMaximumHeight( 240 );
251 topLayout->addWidget( mButtonGroup ); 291 topLayout->addWidget( mButtonGroup );