summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp5
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,
56 QString &strAll ); 56 QString &strAll );
57 57
58// helper convert from file format to comma delimited... 58// helper convert from file format to comma delimited...
59//void parseEmailTo( const QString &strDefaultEmail, 59//void parseEmailTo( const QString &strDefaultEmail,
60 // const QString &strOtherEmail, QString &strBack ); 60 // const QString &strOtherEmail, QString &strBack );
61 61
62 ContactEditor::ContactEditor(const OContact &entry, 62 ContactEditor::ContactEditor(const OContact &entry,
63 QWidget *parent, 63 QWidget *parent,
64 const char *name, 64 const char *name,
65 WFlags fl ) 65 WFlags fl )
66 : QDialog( parent, name, TRUE, fl ), 66 : QDialog( parent, name, TRUE, fl ),
67 m_personalView ( false ) 67 m_personalView ( false )
68
68{ 69{
69 70
70 init(); 71 init();
71 setEntry( entry ); 72 setEntry( entry );
73
74 cmbDefaultEmail = 0;
72} 75}
73 76
74ContactEditor::~ContactEditor() { 77ContactEditor::~ContactEditor() {
75} 78}
76 79
77void ContactEditor::init() { 80void ContactEditor::init() {
78 81
79 useFullName = true; 82 useFullName = true;
80 83
81 uint i = 0; 84 uint i = 0;
82 85
83 QStringList trlChooserNames; 86 QStringList trlChooserNames;
@@ -622,25 +625,25 @@ void ContactEditor::init() {
622} 625}
623 626
624void ContactEditor::defaultEmailChanged(int i){ 627void ContactEditor::defaultEmailChanged(int i){
625 qDebug("defaultEmailChanged"); 628 qDebug("defaultEmailChanged");
626 int index = cmbChooserField1->currentItem(); 629 int index = cmbChooserField1->currentItem();
627 slChooserValues[index] = cmbDefaultEmail->text(i); 630 slChooserValues[index] = cmbDefaultEmail->text(i);
628 631
629} 632}
630 633
631void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) { 634void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) {
632 635
633 if (slChooserNames[index] == "Default Email"){ 636 if (slChooserNames[index] == "Default Email"){
634 delete cmbDefaultEmail; 637 if (cmbDefaultEmail) delete cmbDefaultEmail;
635 cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); 638 cmbDefaultEmail = new QComboBox(inputWid->parentWidget());
636 cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); 639 cmbDefaultEmail->setGeometry(inputWid->frameGeometry());
637 cmbDefaultEmail->insertStringList(ent.emailList()); 640 cmbDefaultEmail->insertStringList(ent.emailList());
638 connect(cmbDefaultEmail,SIGNAL(activated(int)), 641 connect(cmbDefaultEmail,SIGNAL(activated(int)),
639 SLOT(defaultEmailChanged(int))); 642 SLOT(defaultEmailChanged(int)));
640 QString demail = ent.defaultEmail(); 643 QString demail = ent.defaultEmail();
641 for ( int i = 0; i < cmbDefaultEmail->count(); i++) 644 for ( int i = 0; i < cmbDefaultEmail->count(); i++)
642 if ( cmbDefaultEmail->text( i ) == demail ) 645 if ( cmbDefaultEmail->text( i ) == demail )
643 cmbDefaultEmail->setCurrentItem( i ); 646 cmbDefaultEmail->setCurrentItem( i );
644 647
645 cmbDefaultEmail->show(); 648 cmbDefaultEmail->show();
646 } 649 }