Diffstat (limited to 'kaddressbook/xxportselectdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/xxportselectdialog.cpp | 12 |
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 @@ -114,127 +114,131 @@ void XXPortSelectDialog::tagSelected() if ( mUseSelection->isChecked() ) { QStringList selection = mCore->selectedUIDs(); KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { if ( selection.findIndex((*it).uid()) >= 0 ) (*it).setTagged( true ); } } else if ( mUseFilters->isChecked() ) { // find contacts that can pass selected filter Filter::List::Iterator filterIt; for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) if ( (*filterIt).name() == mFiltersCombo->currentText() ) break; KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { if ( (*filterIt).filterAddressee( *it ) ) (*it).setTagged( true ); } } else if ( mUseCategories->isChecked() ) { QStringList categorieList = categories(); KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { QStringList tmp( (*it).categories() ); QStringList::Iterator tmpIt; for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) if ( categorieList.contains( *tmpIt ) ) { (*it).setTagged( true ); break; } } } else { // create a string list of all entries: KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) (*it).setTagged( true ); } } KABC::AddresseeList XXPortSelectDialog::contacts() { KABC::AddresseeList list; if ( mUseSelection->isChecked() ) { QStringList::Iterator it; QStringList selection = mCore->selectedUIDs(); for ( it = selection.begin(); it != selection.end(); ++it ) { KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); if ( !addr.isEmpty() ) - list.append( addr ); + if ( addr.uid().left( 19 ) != QString("last-syncAddressee-") ) + list.append( addr ); } } else if ( mUseFilters->isChecked() ) { // find contacts that can pass selected filter Filter::List::Iterator filterIt; for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) if ( (*filterIt).name() == mFiltersCombo->currentText() ) break; KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { if ( (*filterIt).filterAddressee( *it ) ) - list.append( *it ); + if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") ) + list.append( *it ); } } else if ( mUseCategories->isChecked() ) { QStringList categorieList = categories(); KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { QStringList tmp( (*it).categories() ); QStringList::Iterator tmpIt; for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) if ( categorieList.contains( *tmpIt ) ) { - list.append( *it ); + if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") ) + list.append( *it ); break; } } } else { // create a string list of all entries: KABC::AddressBook::Iterator it; for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) - list.append( *it ); + if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") ) + list.append( *it ); } if ( mUseSorting ) { list.setReverseSorting( mSortTypeCombo->currentItem() == 1 ); uint pos = mFieldCombo->currentItem(); if ( pos < mFields.count() ) list.sortByField( mFields[ pos ] ); } return list; } QStringList XXPortSelectDialog::categories() const { QStringList list; QListViewItemIterator it( mCategoriesView ); for ( ; it.current(); ++it ) { QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); if ( qcli->isOn() ) list.append( it.current()->text( 0 ) ); } return list; } void XXPortSelectDialog::filterChanged( int ) { mUseFilters->setChecked( true ); } void XXPortSelectDialog::categoryClicked( QListViewItem *i ) { QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); if ( qcli->isOn() ) mUseCategories->setChecked( true ); } void XXPortSelectDialog::slotHelp() { #ifndef KAB_EMBEDDED kapp->invokeHelp( "import-and-export" ); #else //KAB_EMBEDDED qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); #endif //KAB_EMBEDDED } |