summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/contact.h4
-rw-r--r--library/backend/timeconversion.cpp15
-rw-r--r--library/library.pro2
3 files changed, 16 insertions, 5 deletions
diff --git a/library/backend/contact.h b/library/backend/contact.h
index 4999430..2294986 100644
--- a/library/backend/contact.h
+++ b/library/backend/contact.h
@@ -174,74 +174,74 @@ public:
174 QString spouse() const { return find( Qtopia::Spouse ); } 174 QString spouse() const { return find( Qtopia::Spouse ); }
175 QString gender() const { return find( Qtopia::Gender ); } 175 QString gender() const { return find( Qtopia::Gender ); }
176 QString birthday() const { return find( Qtopia::Birthday ); } 176 QString birthday() const { return find( Qtopia::Birthday ); }
177 QString anniversary() const { return find( Qtopia::Anniversary ); } 177 QString anniversary() const { return find( Qtopia::Anniversary ); }
178 QString nickname() const { return find( Qtopia::Nickname ); } 178 QString nickname() const { return find( Qtopia::Nickname ); }
179 QString children() const { return find( Qtopia::Children ); } 179 QString children() const { return find( Qtopia::Children ); }
180 QStringList childrenList() const; 180 QStringList childrenList() const;
181 181
182 // other 182 // other
183 QString notes() const { return find( Qtopia::Notes ); } 183 QString notes() const { return find( Qtopia::Notes ); }
184 QString groups() const { return find( Qtopia::Groups ); } 184 QString groups() const { return find( Qtopia::Groups ); }
185 QStringList groupList() const; 185 QStringList groupList() const;
186 186
187// // custom 187// // custom
188// const QString &customField( const QString &key ) 188// const QString &customField( const QString &key )
189// { return find( Custom- + key ); } 189// { return find( Custom- + key ); }
190 190
191 static QStringList fields(); 191 static QStringList fields();
192 static QStringList trfields(); 192 static QStringList trfields();
193 193
194 QString toRichText() const; 194 QString toRichText() const;
195 QMap<int, QString> toMap() const; 195 QMap<int, QString> toMap() const;
196 QString field( int key ) const { return find( key ); } 196 QString field( int key ) const { return find( key ); }
197 197
198 198
199 // journaling... 199 // journaling...
200 void saveJournal( journal_action action, const QString &key = QString::null ); 200 void saveJournal( journal_action action, const QString &key = QString::null );
201 void save( QString &buf ) const; 201 void save( QString &buf ) const;
202 202
203 void setUid( int i ) 203 void setUid( int i )
204{ Record::setUid(i); replace( Qtopia::AddressUid , QString::number(i)); } 204{ Record::setUid(i); replace( Qtopia::AddressUid , QString::number(i)); }
205 205
206 void setEmails( const QString &v );
207 QString emails() const { return find( Qtopia::Emails ); }
206private: 208private:
207 friend class AbEditor; 209 friend class AbEditor;
208 friend class AbTable; 210 friend class AbTable;
209 friend class AddressBookAccessPrivate; 211 friend class AddressBookAccessPrivate;
210 friend class XMLIO; 212 friend class XMLIO;
211 213
212 QString emailSeparator() const { return " "; } 214 QString emailSeparator() const { return " "; }
213 // the emails should be seperated by a comma 215 // the emails should be seperated by a comma
214 void setEmails( const QString &v );
215 QString emails() const { return find( Qtopia::Emails ); }
216 216
217 void insert( int key, const QString &value ); 217 void insert( int key, const QString &value );
218 void replace( int key, const QString &value ); 218 void replace( int key, const QString &value );
219 QString find( int key ) const; 219 QString find( int key ) const;
220 220
221 QString displayAddress( const QString &street, 221 QString displayAddress( const QString &street,
222 const QString &city, 222 const QString &city,
223 const QString &state, 223 const QString &state,
224 const QString &zip, 224 const QString &zip,
225 const QString &country ) const; 225 const QString &country ) const;
226 226
227 Qtopia::UidGen &uidGen() { return sUidGen; } 227 Qtopia::UidGen &uidGen() { return sUidGen; }
228 static Qtopia::UidGen sUidGen; 228 static Qtopia::UidGen sUidGen;
229 QMap<int, QString> mMap; 229 QMap<int, QString> mMap;
230 ContactPrivate *d; 230 ContactPrivate *d;
231}; 231};
232 232
233// these methods are inlined to keep binary compatability with Qtopia 1.5 233// these methods are inlined to keep binary compatability with Qtopia 1.5
234inline void Contact::insertEmail( const QString &v ) 234inline void Contact::insertEmail( const QString &v )
235{ 235{
236 //qDebug("insertEmail %s", v.latin1()); 236 //qDebug("insertEmail %s", v.latin1());
237 QString e = v.simplifyWhiteSpace(); 237 QString e = v.simplifyWhiteSpace();
238 QString def = defaultEmail(); 238 QString def = defaultEmail();
239 239
240 // if no default, set it as the default email and don't insert 240 // if no default, set it as the default email and don't insert
241 if ( def.isEmpty() ) { 241 if ( def.isEmpty() ) {
242 setDefaultEmail( e ); // will insert into the list for us 242 setDefaultEmail( e ); // will insert into the list for us
243 return; 243 return;
244 } 244 }
245 245
246 // otherwise, insert assuming doesn't already exist 246 // otherwise, insert assuming doesn't already exist
247 QString emailsStr = find( Qtopia::Emails ); 247 QString emailsStr = find( Qtopia::Emails );
diff --git a/library/backend/timeconversion.cpp b/library/backend/timeconversion.cpp
index 3c25922..df7b0d5 100644
--- a/library/backend/timeconversion.cpp
+++ b/library/backend/timeconversion.cpp
@@ -1,68 +1,77 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qglobal.h> 21#include <qglobal.h>
22#include <qtopia/timeconversion.h> 22#include <qtopia/timeconversion.h>
23#include <qregexp.h> 23#include <qregexp.h>
24#include <stdlib.h> 24#include <stdlib.h>
25 25
26QString TimeConversion::toString( const QDate &d ) 26QString TimeConversion::toString( const QDate &d )
27{ 27{
28 QString r = QString::number( d.day() ) + "." + 28 QString empty;
29 if ( d.isNull() )
30 return empty;
31
32 QString r = QString::number( d.day() ) + "." +
29 QString::number( d.month() ) + "." + 33 QString::number( d.month() ) + "." +
30 QString::number( d.year() ); 34 QString::number( d.year() );
31 //qDebug("TimeConversion::toString %s", r.latin1()); 35 //qDebug("TimeConversion::toString %s", r.latin1());
32 return r; 36
37 return r;
33} 38}
34 39
35QDate TimeConversion::fromString( const QString &datestr ) 40QDate TimeConversion::fromString( const QString &datestr )
36{ 41{
42 QDate empty;
43 if ( datestr.isEmpty() )
44 return empty;
45
37 int monthPos = datestr.find('.'); 46 int monthPos = datestr.find('.');
38 int yearPos = datestr.find('.', monthPos+1 ); 47 int yearPos = datestr.find('.', monthPos+1 );
39 if ( monthPos == -1 || yearPos == -1 ) { 48 if ( monthPos == -1 || yearPos == -1 ) {
40 qDebug("fromString didn't find . in str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, yearPos ); 49 qDebug("fromString didn't find . in str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, yearPos );
41 return QDate(); 50 return QDate();
42 } 51 }
43 int d = datestr.left( monthPos ).toInt(); 52 int d = datestr.left( monthPos ).toInt();
44 int m = datestr.mid( monthPos+1, yearPos - monthPos - 1 ).toInt(); 53 int m = datestr.mid( monthPos+1, yearPos - monthPos - 1 ).toInt();
45 int y = datestr.mid( yearPos+1 ).toInt(); 54 int y = datestr.mid( yearPos+1 ).toInt();
46 QDate date ( y,m,d ); 55 QDate date ( y,m,d );
47 //qDebug("TimeConversion::fromString ymd = %s => %d %d %d; mpos = %d ypos = %d", datestr.latin1(), y, m, d, monthPos, yearPos); 56 //qDebug("TimeConversion::fromString ymd = %s => %d %d %d; mpos = %d ypos = %d", datestr.latin1(), y, m, d, monthPos, yearPos);
48 return date; 57 return date;
49} 58}
50 59
51time_t TimeConversion::toUTC( const QDateTime& dt ) 60time_t TimeConversion::toUTC( const QDateTime& dt )
52{ 61{
53 time_t tmp; 62 time_t tmp;
54 struct tm *lt; 63 struct tm *lt;
55 64
56#if defined(_OS_WIN32) || defined (Q_OS_WIN32) || defined (Q_OS_WIN64) 65#if defined(_OS_WIN32) || defined (Q_OS_WIN32) || defined (Q_OS_WIN64)
57 _tzset(); 66 _tzset();
58#else 67#else
59 tzset(); 68 tzset();
60#endif 69#endif
61 70
62 // get a tm structure from the system to get the correct tz_name 71 // get a tm structure from the system to get the correct tz_name
63 tmp = time( 0 ); 72 tmp = time( 0 );
64 lt = localtime( &tmp ); 73 lt = localtime( &tmp );
65 74
66 lt->tm_sec = dt.time().second(); 75 lt->tm_sec = dt.time().second();
67 lt->tm_min = dt.time().minute(); 76 lt->tm_min = dt.time().minute();
68 lt->tm_hour = dt.time().hour(); 77 lt->tm_hour = dt.time().hour();
diff --git a/library/library.pro b/library/library.pro
index fba98f8..142c609 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -84,58 +84,60 @@ SOURCES = calendar.cpp \
84 tzselect.cpp \ 84 tzselect.cpp \
85 qmath.c \ 85 qmath.c \
86 datebookdb.cpp \ 86 datebookdb.cpp \
87 alarmserver.cpp \ 87 alarmserver.cpp \
88 password.cpp \ 88 password.cpp \
89 process.cpp \ 89 process.cpp \
90 process_unix.cpp \ 90 process_unix.cpp \
91 timestring.cpp \ 91 timestring.cpp \
92 fontdatabase.cpp \ 92 fontdatabase.cpp \
93 power.cpp \ 93 power.cpp \
94 storage.cpp \ 94 storage.cpp \
95 qpemessagebox.cpp \ 95 qpemessagebox.cpp \
96 backend/timeconversion.cpp \ 96 backend/timeconversion.cpp \
97 qpedebug.cpp \ 97 qpedebug.cpp \
98 qpemenubar.cpp \ 98 qpemenubar.cpp \
99 qpetoolbar.cpp \ 99 qpetoolbar.cpp \
100 backend/categories.cpp \ 100 backend/categories.cpp \
101 backend/stringutil.cpp \ 101 backend/stringutil.cpp \
102 backend/palmtoprecord.cpp \ 102 backend/palmtoprecord.cpp \
103 backend/task.cpp \ 103 backend/task.cpp \
104 backend/event.cpp \ 104 backend/event.cpp \
105 backend/contact.cpp \ 105 backend/contact.cpp \
106 categorymenu.cpp \ 106 categorymenu.cpp \
107 categoryedit_p.cpp \ 107 categoryedit_p.cpp \
108 categoryselect.cpp \ 108 categoryselect.cpp \
109 categorywidget.cpp \ 109 categorywidget.cpp \
110 ir.cpp \ 110 ir.cpp \
111 backend/vcc_yacc.cpp \ 111 backend/vcc_yacc.cpp \
112 backend/vobject.cpp \ 112 backend/vobject.cpp \
113 findwidget_p.cpp \ 113 findwidget_p.cpp \
114 finddialog.cpp \ 114 finddialog.cpp \
115 lnkproperties.cpp 115 lnkproperties.cpp
116# QPE crashes on my Notebook if it tries to play sound
117DEFINES = QT_NO_SOUND
116# Qt 3 compatibility 118# Qt 3 compatibility
117HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h 119HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h
118SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp 120SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp
119INCLUDEPATH += $(OPIEDIR)/include backend 121INCLUDEPATH += $(OPIEDIR)/include backend
120 LIBS += -ldl -lcrypt -lm 122 LIBS += -ldl -lcrypt -lm
121INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui 123INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui
122 TARGET = qpe 124 TARGET = qpe
123 DESTDIR = $(QTDIR)/lib$(PROJMAK) 125 DESTDIR = $(QTDIR)/lib$(PROJMAK)
124# This is set by configure$(OPIEDIR). 126# This is set by configure$(OPIEDIR).
125 VERSION = 1.5.0.1 127 VERSION = 1.5.0.1
126 128
127TRANSLATIONS = ../i18n/de/libqpe.ts \ 129TRANSLATIONS = ../i18n/de/libqpe.ts \
128 ../i18n/en/libqpe.ts \ 130 ../i18n/en/libqpe.ts \
129 ../i18n/es/libqpe.ts \ 131 ../i18n/es/libqpe.ts \
130 ../i18n/fr/libqpe.ts \ 132 ../i18n/fr/libqpe.ts \
131 ../i18n/hu/libqpe.ts \ 133 ../i18n/hu/libqpe.ts \
132 ../i18n/ja/libqpe.ts \ 134 ../i18n/ja/libqpe.ts \
133 ../i18n/ko/libqpe.ts \ 135 ../i18n/ko/libqpe.ts \
134 ../i18n/no/libqpe.ts \ 136 ../i18n/no/libqpe.ts \
135 ../i18n/pl/libqpe.ts \ 137 ../i18n/pl/libqpe.ts \
136 ../i18n/pt/libqpe.ts \ 138 ../i18n/pt/libqpe.ts \
137 ../i18n/pt_BR/libqpe.ts \ 139 ../i18n/pt_BR/libqpe.ts \
138 ../i18n/sl/libqpe.ts \ 140 ../i18n/sl/libqpe.ts \
139 ../i18n/zh_CN/libqpe.ts \ 141 ../i18n/zh_CN/libqpe.ts \
140 ../i18n/it/libqpe.ts \ 142 ../i18n/it/libqpe.ts \
141 ../i18n/zh_TW/libqpe.ts 143 ../i18n/zh_TW/libqpe.ts