-rw-r--r-- | libopie/pim/ocontact.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index 9cccfc8..96a5f65 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp | |||
@@ -1,40 +1,38 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) | 3 | ** Copyright (C) 2002-2003 by Stefan Eilers (eilers.stefan@epost.de) |
4 | ** | ||
5 | ** This file is part of the Qtopia Environment. | ||
6 | ** | 4 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 5 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 6 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 7 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 8 | ** packaging of this file. |
11 | ** | 9 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 12 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 13 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 14 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 15 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 16 | ** not clear to you. |
19 | ** | 17 | ** |
20 | **********************************************************************/ | 18 | **********************************************************************/ |
21 | 19 | ||
22 | #define QTOPIA_INTERNAL_CONTACT_MRE | 20 | #define QTOPIA_INTERNAL_CONTACT_MRE |
23 | 21 | ||
24 | #include "ocontact.h" | 22 | #include "ocontact.h" |
25 | #include "opimresolver.h" | 23 | #include "opimresolver.h" |
26 | 24 | ||
27 | #include <qpe/stringutil.h> | 25 | #include <qpe/stringutil.h> |
28 | #include <qpe/timeconversion.h> | 26 | #include "oconversion.h" |
29 | #include <qpe/timestring.h> | 27 | #include <qpe/timestring.h> |
30 | 28 | ||
31 | #include <qobject.h> | 29 | #include <qobject.h> |
32 | #include <qregexp.h> | 30 | #include <qregexp.h> |
33 | #include <qstylesheet.h> | 31 | #include <qstylesheet.h> |
34 | #include <qfileinfo.h> | 32 | #include <qfileinfo.h> |
35 | #include <qmap.h> | 33 | #include <qmap.h> |
36 | 34 | ||
37 | #include <stdio.h> | 35 | #include <stdio.h> |
38 | 36 | ||
39 | /*! | 37 | /*! |
40 | \class Contact contact.h | 38 | \class Contact contact.h |
@@ -1008,69 +1006,69 @@ class QString OContact::recordField( int pos ) const | |||
1008 | Sets the birthday for the contact to \a date. If date is null | 1006 | Sets the birthday for the contact to \a date. If date is null |
1009 | the current stored date will be removed. | 1007 | the current stored date will be removed. |
1010 | */ | 1008 | */ |
1011 | void OContact::setBirthday( const QDate &v ) | 1009 | void OContact::setBirthday( const QDate &v ) |
1012 | { | 1010 | { |
1013 | if ( v.isNull() ){ | 1011 | if ( v.isNull() ){ |
1014 | qWarning( "Remove Birthday"); | 1012 | qWarning( "Remove Birthday"); |
1015 | replace( Qtopia::Birthday, QString::null ); | 1013 | replace( Qtopia::Birthday, QString::null ); |
1016 | return; | 1014 | return; |
1017 | } | 1015 | } |
1018 | 1016 | ||
1019 | if ( v.isValid() ) | 1017 | if ( v.isValid() ) |
1020 | replace( Qtopia::Birthday, TimeConversion::toString( v ) ); | 1018 | replace( Qtopia::Birthday, OConversion::dateToString( v ) ); |
1021 | 1019 | ||
1022 | } | 1020 | } |
1023 | 1021 | ||
1024 | 1022 | ||
1025 | /*! \fn void OContact::setAnniversary( const QDate &date ) | 1023 | /*! \fn void OContact::setAnniversary( const QDate &date ) |
1026 | Sets the anniversary of the contact to \a date. If date is | 1024 | Sets the anniversary of the contact to \a date. If date is |
1027 | null, the current stored date will be removed. | 1025 | null, the current stored date will be removed. |
1028 | */ | 1026 | */ |
1029 | void OContact::setAnniversary( const QDate &v ) | 1027 | void OContact::setAnniversary( const QDate &v ) |
1030 | { | 1028 | { |
1031 | if ( v.isNull() ){ | 1029 | if ( v.isNull() ){ |
1032 | qWarning( "Remove Anniversary"); | 1030 | qWarning( "Remove Anniversary"); |
1033 | replace( Qtopia::Anniversary, QString::null ); | 1031 | replace( Qtopia::Anniversary, QString::null ); |
1034 | return; | 1032 | return; |
1035 | } | 1033 | } |
1036 | 1034 | ||
1037 | if ( v.isValid() ) | 1035 | if ( v.isValid() ) |
1038 | replace( Qtopia::Anniversary, TimeConversion::toString( v ) ); | 1036 | replace( Qtopia::Anniversary, OConversion::dateToString( v ) ); |
1039 | } | 1037 | } |
1040 | 1038 | ||
1041 | /*! \fn QDate OContact::birthday() const | 1039 | /*! \fn QDate OContact::birthday() const |
1042 | Returns the birthday of the contact. | 1040 | Returns the birthday of the contact. |
1043 | */ | 1041 | */ |
1044 | QDate OContact::birthday() const | 1042 | QDate OContact::birthday() const |
1045 | { | 1043 | { |
1046 | QString str = find( Qtopia::Birthday ); | 1044 | QString str = find( Qtopia::Birthday ); |
1047 | qWarning ("Birthday %s", str.latin1() ); | 1045 | qWarning ("Birthday %s", str.latin1() ); |
1048 | if ( !str.isEmpty() ) | 1046 | if ( !str.isEmpty() ) |
1049 | return TimeConversion::fromString ( str ); | 1047 | return OConversion::dateFromString ( str ); |
1050 | else | 1048 | else |
1051 | return QDate(); | 1049 | return QDate(); |
1052 | } | 1050 | } |
1053 | 1051 | ||
1054 | 1052 | ||
1055 | /*! \fn QDate OContact::anniversary() const | 1053 | /*! \fn QDate OContact::anniversary() const |
1056 | Returns the anniversary of the contact. | 1054 | Returns the anniversary of the contact. |
1057 | */ | 1055 | */ |
1058 | QDate OContact::anniversary() const | 1056 | QDate OContact::anniversary() const |
1059 | { | 1057 | { |
1060 | QDate empty; | 1058 | QDate empty; |
1061 | QString str = find( Qtopia::Anniversary ); | 1059 | QString str = find( Qtopia::Anniversary ); |
1062 | qWarning ("Anniversary %s", str.latin1() ); | 1060 | qWarning ("Anniversary %s", str.latin1() ); |
1063 | if ( !str.isEmpty() ) | 1061 | if ( !str.isEmpty() ) |
1064 | return TimeConversion::fromString ( str ); | 1062 | return OConversion::dateFromString ( str ); |
1065 | else | 1063 | else |
1066 | return empty; | 1064 | return empty; |
1067 | } | 1065 | } |
1068 | 1066 | ||
1069 | 1067 | ||
1070 | void OContact::insertEmail( const QString &v ) | 1068 | void OContact::insertEmail( const QString &v ) |
1071 | { | 1069 | { |
1072 | //qDebug("insertEmail %s", v.latin1()); | 1070 | //qDebug("insertEmail %s", v.latin1()); |
1073 | QString e = v.simplifyWhiteSpace(); | 1071 | QString e = v.simplifyWhiteSpace(); |
1074 | QString def = defaultEmail(); | 1072 | QString def = defaultEmail(); |
1075 | 1073 | ||
1076 | // if no default, set it as the default email and don't insert | 1074 | // if no default, set it as the default email and don't insert |