From cc01384d8c2b421d5f455f32631d8c2ec4b7e844 Mon Sep 17 00:00:00 2001 From: eilers Date: Sun, 27 Oct 2002 16:18:51 +0000 Subject: OContact now uses QDate to avoid wrong interpreted strings A lot of inline functions moved into the library.. --- (limited to 'core') diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 4feadeb..5222f16 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -450,10 +451,10 @@ QString AbTable::findContactContact( const OContact &entry, int /* row */ ) value = entry.gender(); break; case Qtopia::Birthday: - value = entry.birthday(); + value = TimeString::numberDateString( entry.birthday() ); break; case Qtopia::Anniversary: - value = entry.anniversary(); + value = TimeString::numberDateString( entry.anniversary() ); break; case Qtopia::Nickname: value = entry.nickname(); diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 52ab0f2..e034b35 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2002 Michael R. Crawford + * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) * * This file is an add-on for the OPIE Palmtop Environment * @@ -1108,20 +1109,6 @@ void ContactEditor::loadFields() { if ( *it == "Children" ) (*lit)->setText( tr( "Children" ) ); } - // Set DatePicker - qWarning ("**Info: %s", ent.birthday().latin1() ); - if ( !ent.birthday().isEmpty() ){ - birthdayButton->setText( ent.birthday() ); - birthdayPicker->setDate( TimeConversion::fromString ( ent.birthday() ) ); - } else - birthdayButton->setText( tr ("Unknown") ); - - qWarning ("**Info: %s", ent.anniversary().latin1() ); - if ( !ent.anniversary().isEmpty() ){ - anniversaryButton->setText( ent.anniversary() ); - anniversaryPicker->setDate( TimeConversion::fromString ( ent.birthday() ) ); - } else - anniversaryButton->setText( tr ("Unknown") ); } @@ -1601,7 +1588,20 @@ void ContactEditor::setEntry( const OContact &entry ) { slotAddressTypeChange( cmbAddress->currentItem() ); - loadFields(); + // loadFields(); :SX + + // Set DatePicker + if ( !ent.birthday().isNull() ){ + birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); + birthdayPicker->setDate( ent.birthday() ); + } else + birthdayButton->setText( tr ("Unknown") ); + + if ( !ent.anniversary().isNull() ){ + anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); + anniversaryPicker->setDate( ent.anniversary() ); + } else + anniversaryButton->setText( tr ("Unknown") ); } @@ -1891,7 +1891,7 @@ void ContactEditor::slotAnniversaryDateChanged( int year, int month, int day) date.setYMD( year, month, day ); QString dateString = TimeString::numberDateString( date ); anniversaryButton->setText( dateString ); - ent.setAnniversary ( dateString ); + ent.setAnniversary ( date ); } void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) @@ -1900,5 +1900,5 @@ void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) date.setYMD( year, month, day ); QString dateString = TimeString::numberDateString( date ); birthdayButton->setText( dateString ); - ent.setBirthday ( dateString ); + ent.setBirthday ( date ); } -- cgit v0.9.0.2