author | ulf69 <ulf69> | 2004-06-29 05:22:55 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-06-29 05:22:55 (UTC) |
commit | 822dcc26ab3b70952679a1e12a010549659b6351 (patch) (side-by-side diff) | |
tree | 334efa1aa742545c0ad0afdad681e8fe0cb29eb0 | |
parent | 6cbf4bfe5ee3b706d7b50324b5300db76eef89d6 (diff) | |
download | kdepimpi-822dcc26ab3b70952679a1e12a010549659b6351.zip kdepimpi-822dcc26ab3b70952679a1e12a010549659b6351.tar.gz kdepimpi-822dcc26ab3b70952679a1e12a010549659b6351.tar.bz2 |
removed KAB_EMBEDDED references
-rw-r--r-- | kabc/distributionlisteditor.cpp | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/kabc/distributionlisteditor.cpp b/kabc/distributionlisteditor.cpp index 569dc96..8b485d8 100644 --- a/kabc/distributionlisteditor.cpp +++ b/kabc/distributionlisteditor.cpp @@ -22,35 +22,33 @@ #include <qlayout.h> #include <qpushbutton.h> #include <qcombobox.h> #include <qinputdialog.h> #include <qbuttongroup.h> #include <qradiobutton.h> #include <klocale.h> #include <kdebug.h> #include "addressbook.h" #include "addresseedialog.h" #include "distributionlist.h" #include "distributionlisteditor.h" -#ifndef KAB_EMBEDDED -#include "distributionlisteditor.moc" -#endif //KAB_EMBEDDED +//US #include "distributionlisteditor.moc" using namespace KABC; EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString ¤t, QWidget *parent ) : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, parent ) { QFrame *topFrame = plainPage(); QBoxLayout *topLayout = new QVBoxLayout( topFrame ); mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), topFrame ); topLayout->addWidget( mButtonGroup ); QStringList::ConstIterator it; @@ -172,37 +170,34 @@ DistributionListEditor::DistributionListEditor( AddressBook *addressBook, QWidge updateAddresseeView(); updateNameCombo(); removeButton->setEnabled(!mManager->listNames().isEmpty()); } DistributionListEditor::~DistributionListEditor() { kdDebug(5700) << "~DistributionListEditor()" << endl; mManager->save(); delete mManager; } void DistributionListEditor::slotSelectionEntryViewChanged() { -#ifndef KAB_EMBEDDED - EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); -#else //KAB_EMBEDDED +//US EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); EditEntryItem *entryItem = (EditEntryItem *)( mEntryView->selectedItem() ); -#endif //KAB_EMBEDDED bool state = (entryItem != 0L); changeEmailButton->setEnabled(state); removeEntryButton->setEnabled(state); } void DistributionListEditor::newList() { bool ok = false; QString name = QInputDialog::getText( i18n("New Distribution List"), i18n("Please enter name:"), QLineEdit::Normal, QString::null, &ok, this ); if ( !ok || name.isEmpty() ) return; new DistributionList( mManager, name ); @@ -210,126 +205,113 @@ void DistributionListEditor::newList() mNameCombo->insertItem( name ); removeButton->setEnabled(true); updateEntryView(); } void DistributionListEditor::removeList() { delete mManager->list( mNameCombo->currentText() ); mNameCombo->removeItem( mNameCombo->currentItem() ); removeButton->setEnabled(!mManager->listNames().isEmpty()); addEntryButton->setEnabled( !mNameCombo->currentText().isEmpty()); updateEntryView(); } void DistributionListEditor::addEntry() { -#ifndef KAB_EMBEDDED +/*US AddresseeItem *addresseeItem = dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); -#else //KAB_EMBEDDED +*/ AddresseeItem *addresseeItem = (AddresseeItem *)( mAddresseeView->selectedItem() ); -#endif //KAB_EMBEDDED if( !addresseeItem ) { kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; return; } DistributionList *list = mManager->list( mNameCombo->currentText() ); if ( !list ) { kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; return; } list->insertEntry( addresseeItem->addressee() ); updateEntryView(); slotSelectionAddresseeViewChanged(); } void DistributionListEditor::removeEntry() { DistributionList *list = mManager->list( mNameCombo->currentText() ); if ( !list ) return; -#ifndef KAB_EMBEDDED - EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); -#else //KAB_EMBEDDED +//US EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); EditEntryItem *entryItem = (EditEntryItem *)( mEntryView->selectedItem() ); -#endif //KAB_EMBEDDED if ( !entryItem ) return; list->removeEntry( entryItem->addressee(), entryItem->email() ); delete entryItem; } void DistributionListEditor::changeEmail() { DistributionList *list = mManager->list( mNameCombo->currentText() ); if ( !list ) return; -#ifndef KAB_EMBEDDED - EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); -#else //KAB_EMBEDDED +//US EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); EditEntryItem *entryItem = (EditEntryItem *)( mEntryView->selectedItem() ); -#endif //KAB_EMBEDDED if ( !entryItem ) return; QString email = EmailSelectDialog::getEmail( entryItem->addressee().emails(), entryItem->email(), this ); list->removeEntry( entryItem->addressee(), entryItem->email() ); list->insertEntry( entryItem->addressee(), email ); updateEntryView(); } void DistributionListEditor::updateEntryView() { DistributionList *list = mManager->list( mNameCombo->currentText() ); if ( !list ) return; mEntryView->clear(); DistributionList::Entry::List entries = list->entries(); DistributionList::Entry::List::ConstIterator it; for( it = entries.begin(); it != entries.end(); ++it ) { new EditEntryItem( mEntryView, (*it).addressee, (*it).email ); } -#ifndef KAB_EMBEDDED - EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); -#else //KAB_EMBEDDED +//US EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); EditEntryItem *entryItem = (EditEntryItem *)( mEntryView->selectedItem() ); -#endif //KAB_EMBEDDED bool state = (entryItem != 0L); changeEmailButton->setEnabled(state); removeEntryButton->setEnabled(state); } void DistributionListEditor::updateAddresseeView() { mAddresseeView->clear(); AddressBook::Iterator it; for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { new AddresseeItem( mAddresseeView, *it ); } } void DistributionListEditor::updateNameCombo() { mNameCombo->insertStringList( mManager->listNames() ); updateEntryView(); } void DistributionListEditor::slotSelectionAddresseeViewChanged() { -#ifndef KAB_EMBEDDED - AddresseeItem *addresseeItem = dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); -#else //KAB_EMBEDDED +//US AddresseeItem *addresseeItem = dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); AddresseeItem *addresseeItem = (AddresseeItem *)( mAddresseeView->selectedItem() ); -#endif //KAB_EMBEDDED bool state = (addresseeItem != 0L); addEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); } |