-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 7338eeb..f125edb 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -44,52 +44,55 @@ #include <qpopupmenu.h> #include <qlistbox.h> #include <qhbox.h> #include <qaction.h> #include <qiconset.h> static inline bool containsAlphaNum( const QString &str ); static inline bool constainsWhiteSpace( const QString &str ); // helper functions, convert our comma delimited list to proper // file format... void parseEmailFrom( const QString &txt, QString &strDefaultEmail, QString &strAll ); // helper convert from file format to comma delimited... //void parseEmailTo( const QString &strDefaultEmail, // const QString &strOtherEmail, QString &strBack ); ContactEditor::ContactEditor( const OContact &entry, QWidget *parent, const char *name, WFlags fl ) : QDialog( parent, name, TRUE, fl ), m_personalView ( false ) + { init(); setEntry( entry ); + + cmbDefaultEmail = 0; } ContactEditor::~ContactEditor() { } void ContactEditor::init() { useFullName = true; uint i = 0; QStringList trlChooserNames; for (i = 0; i <= 6; i++) { slHomeAddress.append( "" ); slBusinessAddress.append( "" ); } trlChooserNames = OContactFields::trphonefields(); slChooserNames = OContactFields::untrphonefields(); slDynamicEntries = OContactFields::untrdetailsfields(); trlDynamicEntries = OContactFields::trdetailsfields(); for (i = 0; i < slChooserNames.count(); i++) slChooserValues.append(""); @@ -610,49 +613,49 @@ void ContactEditor::init() { connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); connect( cmbChooserField4, SIGNAL(activated(int)), this, SLOT(slotCmbChooser4Change(int)) ); connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); new QPEDialogListener(this); setPersonalView ( m_personalView ); } void ContactEditor::defaultEmailChanged(int i){ qDebug("defaultEmailChanged"); int index = cmbChooserField1->currentItem(); slChooserValues[index] = cmbDefaultEmail->text(i); } void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) { if (slChooserNames[index] == "Default Email"){ - delete cmbDefaultEmail; + if (cmbDefaultEmail) delete cmbDefaultEmail; cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); cmbDefaultEmail->insertStringList(ent.emailList()); connect(cmbDefaultEmail,SIGNAL(activated(int)), SLOT(defaultEmailChanged(int))); QString demail = ent.defaultEmail(); for ( int i = 0; i < cmbDefaultEmail->count(); i++) if ( cmbDefaultEmail->text( i ) == demail ) cmbDefaultEmail->setCurrentItem( i ); cmbDefaultEmail->show(); } slChooserValues[index] = textChanged; } void ContactEditor::slotChooser1Change( const QString &textChanged ) { chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1); } void ContactEditor::slotChooser2Change( const QString &textChanged ) { chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2); |