summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp28
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
@@ -44,12 +44,14 @@
#include <qpopupmenu.h>
#include <qlistbox.h>
#include <qhbox.h>
#include <qaction.h>
#include <qiconset.h>
+#include <assert.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,
@@ -91,12 +93,31 @@ void ContactEditor::init() {
}
trlChooserNames = OContactFields::trphonefields( false );
slChooserNames = OContactFields::untrphonefields( false );
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("");
QVBoxLayout *vb = new QVBoxLayout( this );
@@ -1173,12 +1194,15 @@ void ContactEditor::setEntry( const OContact &entry ) {
slBusinessAddress[6] = ent.businessCountry();
//}
QStringList::ConstIterator it;
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() );
if ( *it == "Company" )
(*itLE)->setText( ent.company() );
@@ -1194,14 +1218,16 @@ void ContactEditor::setEntry( const OContact &entry ) {
if ( *it == "Manager" )
(*itLE)->setText( ent.manager() );
if ( *it == "Spouse" )
(*itLE)->setText( ent.spouse() );
- if ( *it == "Nickname" )
+ if ( *it == "Nickname" ){
+ qWarning("**** Nichname: %s", ent.nickname().latin1() );
(*itLE)->setText( ent.nickname() );
+ }
if ( *it == "Children" )
(*itLE)->setText( ent.children() );
}