summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore 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 @@
44#include <qpopupmenu.h> 44#include <qpopupmenu.h>
45#include <qlistbox.h> 45#include <qlistbox.h>
46#include <qhbox.h> 46#include <qhbox.h>
47#include <qaction.h> 47#include <qaction.h>
48#include <qiconset.h> 48#include <qiconset.h>
49 49
50#include <assert.h>
51
50static inline bool containsAlphaNum( const QString &str ); 52static inline bool containsAlphaNum( const QString &str );
51static inline bool constainsWhiteSpace( const QString &str ); 53static inline bool constainsWhiteSpace( const QString &str );
52 54
53// helper functions, convert our comma delimited list to proper 55// helper functions, convert our comma delimited list to proper
54// file format... 56// file format...
55void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 57void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
@@ -91,12 +93,31 @@ void ContactEditor::init() {
91 } 93 }
92 94
93 trlChooserNames = OContactFields::trphonefields( false ); 95 trlChooserNames = OContactFields::trphonefields( false );
94 slChooserNames = OContactFields::untrphonefields( false ); 96 slChooserNames = OContactFields::untrphonefields( false );
95 slDynamicEntries = OContactFields::untrdetailsfields( false ); 97 slDynamicEntries = OContactFields::untrdetailsfields( false );
96 trlDynamicEntries = OContactFields::trdetailsfields( false ); 98 trlDynamicEntries = OContactFields::trdetailsfields( false );
99
100 // Ok, we have to remove elements from the list of dynamic entries
101 // which are now stored in special (not dynamic) widgets..
102 // Otherwise we will get problems with field assignments! (se)
103 slDynamicEntries.remove("Anniversary");
104 slDynamicEntries.remove("Birthday");
105 slDynamicEntries.remove("Gender");
106
107 // The same with translated fields.. But I will
108 // use the translation map to avoid mismatches..
109 QMap<int, QString> translMap = OContactFields::idToTrFields();
110 trlDynamicEntries.remove( translMap[Qtopia::Anniversary] );
111 trlDynamicEntries.remove( translMap[Qtopia::Birthday] );
112 trlDynamicEntries.remove( translMap[Qtopia::Gender] );
113
114 // Last Check to be sure..
115 assert( slDynamicEntries.count() == trlDynamicEntries.count() );
116 assert( slChooserNames.count() == trlChooserNames.count() );
117
97 for (i = 0; i < slChooserNames.count(); i++) 118 for (i = 0; i < slChooserNames.count(); i++)
98 slChooserValues.append(""); 119 slChooserValues.append("");
99 120
100 121
101 QVBoxLayout *vb = new QVBoxLayout( this ); 122 QVBoxLayout *vb = new QVBoxLayout( this );
102 123
@@ -1173,12 +1194,15 @@ void ContactEditor::setEntry( const OContact &entry ) {
1173 slBusinessAddress[6] = ent.businessCountry(); 1194 slBusinessAddress[6] = ent.businessCountry();
1174//} 1195//}
1175 1196
1176 QStringList::ConstIterator it; 1197 QStringList::ConstIterator it;
1177 QListIterator<QLineEdit> itLE( listValue ); 1198 QListIterator<QLineEdit> itLE( listValue );
1178 for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { 1199 for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) {
1200
1201 qWarning(" Filling dynamic Field: %s", (*it).latin1() );
1202
1179 if ( *it == "Department" ) 1203 if ( *it == "Department" )
1180 (*itLE)->setText( ent.department() ); 1204 (*itLE)->setText( ent.department() );
1181 1205
1182 if ( *it == "Company" ) 1206 if ( *it == "Company" )
1183 (*itLE)->setText( ent.company() ); 1207 (*itLE)->setText( ent.company() );
1184 1208
@@ -1194,14 +1218,16 @@ void ContactEditor::setEntry( const OContact &entry ) {
1194 if ( *it == "Manager" ) 1218 if ( *it == "Manager" )
1195 (*itLE)->setText( ent.manager() ); 1219 (*itLE)->setText( ent.manager() );
1196 1220
1197 if ( *it == "Spouse" ) 1221 if ( *it == "Spouse" )
1198 (*itLE)->setText( ent.spouse() ); 1222 (*itLE)->setText( ent.spouse() );
1199 1223
1200 if ( *it == "Nickname" ) 1224 if ( *it == "Nickname" ){
1225 qWarning("**** Nichname: %s", ent.nickname().latin1() );
1201 (*itLE)->setText( ent.nickname() ); 1226 (*itLE)->setText( ent.nickname() );
1227 }
1202 1228
1203 if ( *it == "Children" ) 1229 if ( *it == "Children" )
1204 (*itLE)->setText( ent.children() ); 1230 (*itLE)->setText( ent.children() );
1205 1231
1206 } 1232 }
1207 1233