summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-07-13 15:00:05 (UTC)
committer ulf69 <ulf69>2004-07-13 15:00:05 (UTC)
commit65848bf858dae95799ec8ed883c23faa48ff8566 (patch) (side-by-side diff)
tree74835d0d68caa5570b344b8494281786d00e57d5
parenteb1ab908047072aa4fb224ab7da6e147d4dcf1e0 (diff)
downloadkdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.zip
kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.tar.gz
kdepimpi-65848bf858dae95799ec8ed883c23faa48ff8566.tar.bz2
changed output of gender field. Now it can have the values "male", "female" or ""
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverter.cpp11
-rw-r--r--kaddressbook/kabcore.cpp3
2 files changed, 11 insertions, 3 deletions
diff --git a/kabc/converter/opie/opieconverter.cpp b/kabc/converter/opie/opieconverter.cpp
index 0b6a55e..46e14dd 100644
--- a/kabc/converter/opie/opieconverter.cpp
+++ b/kabc/converter/opie/opieconverter.cpp
@@ -201,5 +201,8 @@ bool OpieConverter::opieToAddressee( const OContact &contact, Addressee &addr )
//personal
addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() );
- addr.insertCustom( "KADDRESSBOOK", "X-Gender", contact.gender() );
+ if (contact.gender() == 1)
+ addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female" );
+ else if (contact.gender() == 2)
+ addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male" );
if (contact.anniversary().isValid()) {
@@ -320,5 +323,9 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
//personal
contact.setSpouse(addr.custom( "KADDRESSBOOK", "X-Spouse" ));
- contact.setGender(addr.custom( "KADDRESSBOOK", "X-Gender" ));
+ QString gend = addr.custom( "KADDRESSBOOK", "X-Gender" );
+ if (gend == "female")
+ contact.setGender("1");
+ else if (gend == "male")
+ contact.setGender("2");
QDate dt = KGlobal::locale()->readDate(
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1a34e4d..8daca33 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -164,5 +164,6 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
"X-Anniversary", "KADDRESSBOOK" );
-//US added this field to become compatible with Opie addressbook
+ //US added this field to become compatible with Opie/qtopia addressbook
+ // values can be "female" or "male" or "". An empty field represents undefined.
mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
"X-Gender", "KADDRESSBOOK" );