summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxportselectdialog.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index e134f97..278cab0 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -130,95 +130,99 @@ void XXPortSelectDialog::tagSelected()
130 if ( (*filterIt).filterAddressee( *it ) ) 130 if ( (*filterIt).filterAddressee( *it ) )
131 (*it).setTagged( true ); 131 (*it).setTagged( true );
132 } 132 }
133 } else if ( mUseCategories->isChecked() ) { 133 } else if ( mUseCategories->isChecked() ) {
134 QStringList categorieList = categories(); 134 QStringList categorieList = categories();
135 KABC::AddressBook::Iterator it; 135 KABC::AddressBook::Iterator it;
136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
137 QStringList tmp( (*it).categories() ); 137 QStringList tmp( (*it).categories() );
138 QStringList::Iterator tmpIt; 138 QStringList::Iterator tmpIt;
139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
140 if ( categorieList.contains( *tmpIt ) ) { 140 if ( categorieList.contains( *tmpIt ) ) {
141 (*it).setTagged( true ); 141 (*it).setTagged( true );
142 break; 142 break;
143 } 143 }
144 } 144 }
145 } else { 145 } else {
146 // create a string list of all entries: 146 // create a string list of all entries:
147 KABC::AddressBook::Iterator it; 147 KABC::AddressBook::Iterator it;
148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) 148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
149 (*it).setTagged( true ); 149 (*it).setTagged( true );
150 } 150 }
151} 151}
152KABC::AddresseeList XXPortSelectDialog::contacts() 152KABC::AddresseeList XXPortSelectDialog::contacts()
153{ 153{
154 154
155 KABC::AddresseeList list; 155 KABC::AddresseeList list;
156 if ( mUseSelection->isChecked() ) { 156 if ( mUseSelection->isChecked() ) {
157 QStringList::Iterator it; 157 QStringList::Iterator it;
158 QStringList selection = mCore->selectedUIDs(); 158 QStringList selection = mCore->selectedUIDs();
159 for ( it = selection.begin(); it != selection.end(); ++it ) { 159 for ( it = selection.begin(); it != selection.end(); ++it ) {
160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); 160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
161 if ( !addr.isEmpty() ) 161 if ( !addr.isEmpty() )
162 list.append( addr ); 162 if ( addr.uid().left( 19 ) != QString("last-syncAddressee-") )
163 list.append( addr );
163 } 164 }
164 } else if ( mUseFilters->isChecked() ) { 165 } else if ( mUseFilters->isChecked() ) {
165 // find contacts that can pass selected filter 166 // find contacts that can pass selected filter
166 Filter::List::Iterator filterIt; 167 Filter::List::Iterator filterIt;
167 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 168 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
168 if ( (*filterIt).name() == mFiltersCombo->currentText() ) 169 if ( (*filterIt).name() == mFiltersCombo->currentText() )
169 break; 170 break;
170 171
171 KABC::AddressBook::Iterator it; 172 KABC::AddressBook::Iterator it;
172 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 173 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
173 if ( (*filterIt).filterAddressee( *it ) ) 174 if ( (*filterIt).filterAddressee( *it ) )
174 list.append( *it ); 175 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
176 list.append( *it );
175 } 177 }
176 } else if ( mUseCategories->isChecked() ) { 178 } else if ( mUseCategories->isChecked() ) {
177 QStringList categorieList = categories(); 179 QStringList categorieList = categories();
178 KABC::AddressBook::Iterator it; 180 KABC::AddressBook::Iterator it;
179 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 181 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
180 QStringList tmp( (*it).categories() ); 182 QStringList tmp( (*it).categories() );
181 QStringList::Iterator tmpIt; 183 QStringList::Iterator tmpIt;
182 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 184 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
183 if ( categorieList.contains( *tmpIt ) ) { 185 if ( categorieList.contains( *tmpIt ) ) {
184 list.append( *it ); 186 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
187 list.append( *it );
185 break; 188 break;
186 } 189 }
187 } 190 }
188 } else { 191 } else {
189 // create a string list of all entries: 192 // create a string list of all entries:
190 KABC::AddressBook::Iterator it; 193 KABC::AddressBook::Iterator it;
191 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) 194 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
192 list.append( *it ); 195 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
196 list.append( *it );
193 } 197 }
194 198
195 if ( mUseSorting ) { 199 if ( mUseSorting ) {
196 list.setReverseSorting( mSortTypeCombo->currentItem() == 1 ); 200 list.setReverseSorting( mSortTypeCombo->currentItem() == 1 );
197 uint pos = mFieldCombo->currentItem(); 201 uint pos = mFieldCombo->currentItem();
198 if ( pos < mFields.count() ) 202 if ( pos < mFields.count() )
199 list.sortByField( mFields[ pos ] ); 203 list.sortByField( mFields[ pos ] );
200 } 204 }
201 205
202 return list; 206 return list;
203} 207}
204 208
205QStringList XXPortSelectDialog::categories() const 209QStringList XXPortSelectDialog::categories() const
206{ 210{
207 QStringList list; 211 QStringList list;
208 212
209 QListViewItemIterator it( mCategoriesView ); 213 QListViewItemIterator it( mCategoriesView );
210 for ( ; it.current(); ++it ) { 214 for ( ; it.current(); ++it ) {
211 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); 215 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current());
212 if ( qcli->isOn() ) 216 if ( qcli->isOn() )
213 list.append( it.current()->text( 0 ) ); 217 list.append( it.current()->text( 0 ) );
214 } 218 }
215 219
216 return list; 220 return list;
217} 221}
218 222
219void XXPortSelectDialog::filterChanged( int ) 223void XXPortSelectDialog::filterChanged( int )
220{ 224{
221 mUseFilters->setChecked( true ); 225 mUseFilters->setChecked( true );
222} 226}
223 227
224void XXPortSelectDialog::categoryClicked( QListViewItem *i ) 228void XXPortSelectDialog::categoryClicked( QListViewItem *i )