author | eilers <eilers> | 2002-12-27 13:03:34 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-12-27 13:03:34 (UTC) |
commit | 158fd475abbc652613d5eed362dae79f94b17803 (patch) (unidiff) | |
tree | 60b38278a274ac97d0ebb1226cfd881418d735bf | |
parent | 8ae81608ed194e36236ea68c5fbed54ac6c0275c (diff) | |
download | opie-158fd475abbc652613d5eed362dae79f94b17803.zip opie-158fd475abbc652613d5eed362dae79f94b17803.tar.gz opie-158fd475abbc652613d5eed362dae79f94b17803.tar.bz2 |
Fixing nullpointer crash if "emails" selected
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 1b83308..b68d88c 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -658,42 +658,46 @@ void ContactEditor::populateDefaultEmailCmb(){ | |||
658 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ | 658 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ |
659 | cmbDefaultEmail->setCurrentItem( i ); | 659 | cmbDefaultEmail->setCurrentItem( i ); |
660 | qDebug("set"); | 660 | qDebug("set"); |
661 | } | 661 | } |
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||
665 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid, int widgetPos ) { | 665 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid, int widgetPos ) { |
666 | QString type = slChooserNames[index]; | 666 | QString type = slChooserNames[index]; |
667 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",type.latin1(),textChanged.latin1(), index, widgetPos ); | 667 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i",type.latin1(),textChanged.latin1(), index, widgetPos ); |
668 | if ( type == "Default Email"){ | 668 | if ( type == "Default Email"){ |
669 | defaultEmail = textChanged; | 669 | defaultEmail = textChanged; |
670 | if (cmbDefaultEmail) delete cmbDefaultEmail; | 670 | if (cmbDefaultEmail){ |
671 | delete cmbDefaultEmail; | ||
672 | cmbDefaultEmail = 0l; | ||
673 | } | ||
671 | cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); | 674 | cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); |
672 | cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); | 675 | cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); |
673 | cmbDefaultEmail->show(); | 676 | cmbDefaultEmail->show(); |
674 | populateDefaultEmailCmb(); | 677 | populateDefaultEmailCmb(); |
675 | connect(cmbDefaultEmail,SIGNAL(activated(int)), | 678 | connect(cmbDefaultEmail,SIGNAL(activated(int)), |
676 | SLOT(defaultEmailChanged(int))); | 679 | SLOT(defaultEmailChanged(int))); |
677 | defaultEmailChooserPosition = widgetPos; | 680 | defaultEmailChooserPosition = widgetPos; |
678 | }else if (defaultEmailChooserPosition == widgetPos){ | 681 | }else if (defaultEmailChooserPosition == widgetPos){ |
679 | qDebug("cmbDefaultEmail->hide()"); | 682 | qDebug("cmbDefaultEmail->hide()"); |
680 | if (cmbDefaultEmail) cmbDefaultEmail->hide(); | 683 | if (cmbDefaultEmail) cmbDefaultEmail->hide(); |
681 | widgetPos=-1; | 684 | widgetPos=-1; |
682 | }else if (type == "Emails"){ | 685 | }else if (type == "Emails"){ |
683 | qDebug("emails"); | 686 | qDebug("emails"); |
684 | QString de; | 687 | QString de; |
685 | emails = QStringList::split (",", textChanged ); | 688 | emails = QStringList::split (",", textChanged ); |
686 | 689 | ||
687 | populateDefaultEmailCmb(); | 690 | if ( cmbDefaultEmail ) |
691 | populateDefaultEmailCmb(); | ||
688 | } | 692 | } |
689 | 693 | ||
690 | 694 | ||
691 | 695 | ||
692 | slChooserValues[index] = textChanged; | 696 | slChooserValues[index] = textChanged; |
693 | 697 | ||
694 | } | 698 | } |
695 | 699 | ||
696 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 700 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
697 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); | 701 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
698 | } | 702 | } |
699 | 703 | ||