summaryrefslogtreecommitdiff
path: root/libopie
Side-by-side diff
Diffstat (limited to 'libopie') (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
@@ -443,3 +443,3 @@ QString OContact::toRichText() const
text += "<b><h3><img src=\"addressbook/AddressBook\">" + Qtopia::escapeString(value) + "</h3></b>";
-
+
if ( !(value = jobTitle()).isEmpty() )
@@ -984,9 +984,3 @@ QString OContact::type() const
-// Definition is missing ! (se)
-QMap<QString,QString> OContact::toExtraMap() const
-{
- qWarning ("Function not implemented: OContact::toExtraMap()");
- QMap <QString,QString> useless;
- return useless;
-}
+
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
@@ -238,3 +238,3 @@ QString OEvent::toRichText()const {
QString text, value;
-
+
// description
@@ -245,3 +245,3 @@ QString OEvent::toRichText()const {
text += "</h3></b><br><hr><br>";
-
+
// location
@@ -276,3 +276,3 @@ QString OEvent::toRichText()const {
}
-
+
// categories
@@ -283,3 +283,3 @@ QString OEvent::toRichText()const {
}
-
+
//notes
@@ -362,5 +362,2 @@ QMap<int, QString> OEvent::toMap()const {
}
-QMap<QString, QString> OEvent::toExtraMap()const {
- return QMap<QString, QString>();
-}
int OEvent::parent()const {
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
@@ -134,3 +134,2 @@ public:
QMap<int, QString> toMap()const;
- QMap<QString, QString> toExtraMap()const;
QString recordField(int )const;
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
@@ -176 +176,7 @@ int OPimRecord::lastHitField()const{
}
+QMap<QString, QString> OPimRecord::toExtraMap()const {
+ return customMap;
+}
+void OPimRecord::setExtraMap( const QMap<QString, QString>& map) {
+ customMap = map;
+}
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
@@ -8,3 +8,8 @@
+/*
+ * we need to get customMap which is private...
+ */
+#define private protected
#include <qpe/palmtoprecord.h>
+#undef private
@@ -96,3 +101,4 @@ public:
*/
- virtual QMap<QString, QString> toExtraMap()const = 0;
+ QMap<QString, QString> toExtraMap()const;
+ void setExtraMap( const QMap<QString, QString>& );
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
@@ -281,3 +281,3 @@ QString OTodo::toRichText() const
text += "</h3></b><br><hr><br>";
-
+
// description
@@ -308,3 +308,3 @@ QString OTodo::toRichText() const
text += "<br>";
-
+
// progress
@@ -312,3 +312,3 @@ QString OTodo::toRichText() const
+ QString::number( progress() ) + " %<br>";
-
+
// due date
@@ -317,3 +317,3 @@ QString OTodo::toRichText() const
int off = QDate::currentDate().daysTo( dd );
-
+
text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\"";
@@ -328,3 +328,3 @@ QString OTodo::toRichText() const
}
-
+
// categories
@@ -462,5 +462,2 @@ QMap<int, QString> OTodo::toMap() const {
-QMap<QString, QString> OTodo::toExtraMap()const {
- return data->extra;
-}
/**
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
@@ -195,3 +195,2 @@ public:
QString toShortText()const;
- QMap<QString, QString> toExtraMap()const;
QString recordField(int id )const;
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
@@ -499,2 +499,3 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
default:
+ ev.setCustomField( attr, val );
break;
@@ -502,2 +503,23 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
}
+
+// from PalmtopRecord... GPL ### FIXME
+namespace {
+QString customToXml(const QMap<QString, QString>& customMap )
+{
+ //qWarning(QString("writing custom %1").arg(customMap.count()));
+ QString buf(" ");
+ for ( QMap<QString, QString>::ConstIterator cit = customMap.begin();
+ cit != customMap.end(); ++cit) {
+// qWarning(".ITEM.");
+ buf += cit.key();
+ buf += "=\"";
+ buf += Qtopia::escapeString(cit.data());
+ buf += "\" ";
+ }
+ return buf;
+}
+
+
+}
+
QString OTodoAccessXML::toString( const OTodo& ev )const {
@@ -583,2 +605,3 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
}
+ str += customToXml( ev.toExtraMap() );