-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 @@ -56,28 +56,31 @@ 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; @@ -622,25 +625,25 @@ void ContactEditor::init() { } 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(); } |