-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 254cff7..1b83308 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -48,4 +48,6 @@ #include <qiconset.h> +#include <assert.h> + static inline bool containsAlphaNum( const QString &str ); static inline bool constainsWhiteSpace( const QString &str ); @@ -95,4 +97,23 @@ void ContactEditor::init() { slDynamicEntries = OContactFields::untrdetailsfields( false ); trlDynamicEntries = OContactFields::trdetailsfields( false ); + + // Ok, we have to remove elements from the list of dynamic entries + // which are now stored in special (not dynamic) widgets.. + // Otherwise we will get problems with field assignments! (se) + slDynamicEntries.remove("Anniversary"); + slDynamicEntries.remove("Birthday"); + slDynamicEntries.remove("Gender"); + + // The same with translated fields.. But I will + // use the translation map to avoid mismatches.. + QMap<int, QString> translMap = OContactFields::idToTrFields(); + trlDynamicEntries.remove( translMap[Qtopia::Anniversary] ); + trlDynamicEntries.remove( translMap[Qtopia::Birthday] ); + trlDynamicEntries.remove( translMap[Qtopia::Gender] ); + + // Last Check to be sure.. + assert( slDynamicEntries.count() == trlDynamicEntries.count() ); + assert( slChooserNames.count() == trlChooserNames.count() ); + for (i = 0; i < slChooserNames.count(); i++) slChooserValues.append(""); @@ -1177,4 +1198,7 @@ void ContactEditor::setEntry( const OContact &entry ) { QListIterator<QLineEdit> itLE( listValue ); for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { + + qWarning(" Filling dynamic Field: %s", (*it).latin1() ); + if ( *it == "Department" ) (*itLE)->setText( ent.department() ); @@ -1198,6 +1222,8 @@ void ContactEditor::setEntry( const OContact &entry ) { (*itLE)->setText( ent.spouse() ); - if ( *it == "Nickname" ) + if ( *it == "Nickname" ){ + qWarning("**** Nichname: %s", ent.nickname().latin1() ); (*itLE)->setText( ent.nickname() ); + } if ( *it == "Children" ) |