summaryrefslogtreecommitdiff
path: root/libopie/pim
Unidiff
Diffstat (limited to 'libopie/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontact.cpp10
-rw-r--r--libopie/pim/oevent.cpp11
-rw-r--r--libopie/pim/oevent.h1
-rw-r--r--libopie/pim/opimrecord.cpp6
-rw-r--r--libopie/pim/opimrecord.h8
-rw-r--r--libopie/pim/otodo.cpp13
-rw-r--r--libopie/pim/otodo.h1
-rw-r--r--libopie/pim/otodoaccessxml.cpp23
8 files changed, 47 insertions, 26 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index a2fb68c..be4ce0a 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -442,5 +442,5 @@ QString OContact::toRichText() const
442 if ( !(value = fullName()).isEmpty() ) 442 if ( !(value = fullName()).isEmpty() )
443 text += "<b><h3><img src=\"addressbook/AddressBook\">" + Qtopia::escapeString(value) + "</h3></b>"; 443 text += "<b><h3><img src=\"addressbook/AddressBook\">" + Qtopia::escapeString(value) + "</h3></b>";
444 444
445 if ( !(value = jobTitle()).isEmpty() ) 445 if ( !(value = jobTitle()).isEmpty() )
446 text += Qtopia::escapeString(value) + "<br>"; 446 text += Qtopia::escapeString(value) + "<br>";
@@ -983,11 +983,5 @@ QString OContact::type() const
983} 983}
984 984
985// Definition is missing ! (se) 985
986QMap<QString,QString> OContact::toExtraMap() const
987{
988 qWarning ("Function not implemented: OContact::toExtraMap()");
989 QMap <QString,QString> useless;
990 return useless;
991}
992 986
993class QString OContact::recordField( int pos ) const 987class QString OContact::recordField( int pos ) const
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp
index e4f5d92..7bcf944 100644
--- a/libopie/pim/oevent.cpp
+++ b/libopie/pim/oevent.cpp
@@ -237,5 +237,5 @@ bool OEvent::match( const QRegExp& re )const {
237QString OEvent::toRichText()const { 237QString OEvent::toRichText()const {
238 QString text, value; 238 QString text, value;
239 239
240 // description 240 // description
241 text += "<b><h3><img src=\"datebook/DateBook\">"; 241 text += "<b><h3><img src=\"datebook/DateBook\">";
@@ -244,5 +244,5 @@ QString OEvent::toRichText()const {
244 } 244 }
245 text += "</h3></b><br><hr><br>"; 245 text += "</h3></b><br><hr><br>";
246 246
247 // location 247 // location
248 if ( !(value = location()).isEmpty() ) { 248 if ( !(value = location()).isEmpty() ) {
@@ -275,5 +275,5 @@ QString OEvent::toRichText()const {
275 } 275 }
276 } 276 }
277 277
278 // categories 278 // categories
279 if ( categoryNames("Calendar").count() ){ 279 if ( categoryNames("Calendar").count() ){
@@ -282,5 +282,5 @@ QString OEvent::toRichText()const {
282 text += "<br>"; 282 text += "<br>";
283 } 283 }
284 284
285 //notes 285 //notes
286 if ( !note().isEmpty() ) { 286 if ( !note().isEmpty() ) {
@@ -361,7 +361,4 @@ QMap<int, QString> OEvent::toMap()const {
361 return QMap<int, QString>(); 361 return QMap<int, QString>();
362} 362}
363QMap<QString, QString> OEvent::toExtraMap()const {
364 return QMap<QString, QString>();
365}
366int OEvent::parent()const { 363int OEvent::parent()const {
367 return data->parent; 364 return data->parent;
diff --git a/libopie/pim/oevent.h b/libopie/pim/oevent.h
index b696d81..30f442e 100644
--- a/libopie/pim/oevent.h
+++ b/libopie/pim/oevent.h
@@ -133,5 +133,4 @@ public:
133 133
134 QMap<int, QString> toMap()const; 134 QMap<int, QString> toMap()const;
135 QMap<QString, QString> toExtraMap()const;
136 QString recordField(int )const; 135 QString recordField(int )const;
137 136
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp
index 0c9734d..2365748 100644
--- a/libopie/pim/opimrecord.cpp
+++ b/libopie/pim/opimrecord.cpp
@@ -175,2 +175,8 @@ int OPimRecord::lastHitField()const{
175 return m_lastHit; 175 return m_lastHit;
176} 176}
177QMap<QString, QString> OPimRecord::toExtraMap()const {
178 return customMap;
179}
180void OPimRecord::setExtraMap( const QMap<QString, QString>& map) {
181 customMap = map;
182}
diff --git a/libopie/pim/opimrecord.h b/libopie/pim/opimrecord.h
index 494c78e..563b19c 100644
--- a/libopie/pim/opimrecord.h
+++ b/libopie/pim/opimrecord.h
@@ -7,5 +7,10 @@
7#include <qstringlist.h> 7#include <qstringlist.h>
8 8
9/*
10 * we need to get customMap which is private...
11 */
12#define private protected
9#include <qpe/palmtoprecord.h> 13#include <qpe/palmtoprecord.h>
14#undef private
10 15
11#include <opie/opimxrefmanager.h> 16#include <opie/opimxrefmanager.h>
@@ -95,5 +100,6 @@ public:
95 * key value representation of extra items 100 * key value representation of extra items
96 */ 101 */
97 virtual QMap<QString, QString> toExtraMap()const = 0; 102 QMap<QString, QString> toExtraMap()const;
103 void setExtraMap( const QMap<QString, QString>& );
98 104
99 /** 105 /**
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index c84eeeb..38b93f7 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -280,5 +280,5 @@ QString OTodo::toRichText() const
280 } 280 }
281 text += "</h3></b><br><hr><br>"; 281 text += "</h3></b><br><hr><br>";
282 282
283 // description 283 // description
284 if( !description().isEmpty() ){ 284 if( !description().isEmpty() ){
@@ -307,14 +307,14 @@ QString OTodo::toRichText() const
307 }; 307 };
308 text += "<br>"; 308 text += "<br>";
309 309
310 // progress 310 // progress
311 text += "<b>" + QObject::tr( "Progress:") + " </b>" 311 text += "<b>" + QObject::tr( "Progress:") + " </b>"
312 + QString::number( progress() ) + " %<br>"; 312 + QString::number( progress() ) + " %<br>";
313 313
314 // due date 314 // due date
315 if (hasDueDate() ){ 315 if (hasDueDate() ){
316 QDate dd = dueDate(); 316 QDate dd = dueDate();
317 int off = QDate::currentDate().daysTo( dd ); 317 int off = QDate::currentDate().daysTo( dd );
318 318
319 text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\""; 319 text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\"";
320 if ( off < 0 ) 320 if ( off < 0 )
@@ -327,5 +327,5 @@ QString OTodo::toRichText() const
327 text += "\">" + dd.toString() + "</font><br>"; 327 text += "\">" + dd.toString() + "</font><br>";
328 } 328 }
329 329
330 // categories 330 // categories
331 text += "<b>" + QObject::tr( "Category:") + "</b> "; 331 text += "<b>" + QObject::tr( "Category:") + "</b> ";
@@ -461,7 +461,4 @@ QMap<int, QString> OTodo::toMap() const {
461} 461}
462 462
463QMap<QString, QString> OTodo::toExtraMap()const {
464 return data->extra;
465}
466/** 463/**
467 * change or modify looks at the ref count and either 464 * change or modify looks at the ref count and either
diff --git a/libopie/pim/otodo.h b/libopie/pim/otodo.h
index 4d5ee36..f9a345a 100644
--- a/libopie/pim/otodo.h
+++ b/libopie/pim/otodo.h
@@ -194,5 +194,4 @@ public:
194 QString type()const; 194 QString type()const;
195 QString toShortText()const; 195 QString toShortText()const;
196 QMap<QString, QString> toExtraMap()const;
197 QString recordField(int id )const; 196 QString recordField(int id )const;
198 197
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp
index 2b62f0d..3d15354 100644
--- a/libopie/pim/otodoaccessxml.cpp
+++ b/libopie/pim/otodoaccessxml.cpp
@@ -498,7 +498,29 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
498 } 498 }
499 default: 499 default:
500 ev.setCustomField( attr, val );
500 break; 501 break;
501 } 502 }
502} 503}
504
505// from PalmtopRecord... GPL ### FIXME
506namespace {
507QString customToXml(const QMap<QString, QString>& customMap )
508{
509 //qWarning(QString("writing custom %1").arg(customMap.count()));
510 QString buf(" ");
511 for ( QMap<QString, QString>::ConstIterator cit = customMap.begin();
512 cit != customMap.end(); ++cit) {
513 // qWarning(".ITEM.");
514 buf += cit.key();
515 buf += "=\"";
516 buf += Qtopia::escapeString(cit.data());
517 buf += "\" ";
518 }
519 return buf;
520}
521
522
523}
524
503QString OTodoAccessXML::toString( const OTodo& ev )const { 525QString OTodoAccessXML::toString( const OTodo& ev )const {
504 QString str; 526 QString str;
@@ -582,4 +604,5 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
582 } 604 }
583 } 605 }
606 str += customToXml( ev.toExtraMap() );
584 607
585 608