summaryrefslogtreecommitdiff
path: root/library/backend
Unidiff
Diffstat (limited to 'library/backend') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/contact.h4
-rw-r--r--library/backend/timeconversion.cpp15
2 files changed, 14 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
@@ -203,6 +203,8 @@ public:
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;
@@ -211,8 +213,6 @@ private:
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 );
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
@@ -25,15 +25,24 @@
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 ) {