summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/otodoaccessvcal.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/otodoaccessvcal.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp
index 3577e14..6415952 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.cpp
+++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp
@@ -6,30 +6,38 @@
6 6
7#include "otodoaccessvcal.h" 7#include "otodoaccessvcal.h"
8 8
9namespace { 9namespace {
10 static OTodo eventByVObj( VObject *obj ){ 10 static OTodo eventByVObj( VObject *obj ){
11 OTodo event; 11 OTodo event;
12 VObject *ob; 12 VObject *ob;
13 QCString name; 13 QCString name;
14 // no uid, attendees, ... and no fun 14 // no uid, attendees, ... and no fun
15 // description 15 // description
16 if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){ 16 if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){
17 name = vObjectStringZValue( ob ); 17 name = vObjectStringZValue( ob );
18#if 0
18 event.setDescription( name ); 19 event.setDescription( name );
20#else
21 event.setSummary( name );
22#endif
19 } 23 }
20 // summary 24 // summary
21 if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) { 25 if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) {
22 name = vObjectStringZValue( ob ); 26 name = vObjectStringZValue( ob );
27#if 0
23 event.setSummary( name ); 28 event.setSummary( name );
29#else
30 event.setDescription( name );
31#endif
24 } 32 }
25 // completed 33 // completed
26 if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){ 34 if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){
27 name = vObjectStringZValue( ob ); 35 name = vObjectStringZValue( ob );
28 if( name == "COMPLETED" ){ 36 if( name == "COMPLETED" ){
29 event.setCompleted( true ); 37 event.setCompleted( true );
30 }else{ 38 }else{
31 event.setCompleted( false ); 39 event.setCompleted( false );
32 } 40 }
33 }else 41 }else
34 event.setCompleted( false ); 42 event.setCompleted( false );
35 // priority 43 // priority
@@ -65,29 +73,45 @@ namespace {
65 TimeConversion::toISO8601( date ) ); 73 TimeConversion::toISO8601( date ) );
66 } 74 }
67 75
68 if( event.isCompleted() ) 76 if( event.isCompleted() )
69 addPropValue( task, VCStatusProp, "COMPLETED"); 77 addPropValue( task, VCStatusProp, "COMPLETED");
70 78
71 QString string = QString::number(event.priority() ); 79 QString string = QString::number(event.priority() );
72 addPropValue( task, VCPriorityProp, string.local8Bit() ); 80 addPropValue( task, VCPriorityProp, string.local8Bit() );
73 81
74 addPropValue( task, VCCategoriesProp, 82 addPropValue( task, VCCategoriesProp,
75 event.idsToString( event.categories() ).local8Bit() ); 83 event.idsToString( event.categories() ).local8Bit() );
76 84
85#if 0
86
87 // There seems a misrepresentation between summary in otodoevent
88 // and summary in vcard.
89 // The same with description..
90 // Description is summary and vice versa.. Argh.. (eilers)
91
92
77 addPropValue( task, VCDescriptionProp, 93 addPropValue( task, VCDescriptionProp,
78 event.description().local8Bit() ); 94 event.description().local8Bit() );
79 95
80 addPropValue( task, VCSummaryProp, 96 addPropValue( task, VCSummaryProp,
81 event.summary().local8Bit() ); 97 event.summary().local8Bit() );
98
99#else
100 addPropValue( task, VCDescriptionProp,
101 event.summary().local8Bit() );
102
103 addPropValue( task, VCSummaryProp,
104 event.description().local8Bit() );
105#endif
82 return task; 106 return task;
83}; 107};
84} 108}
85 109
86OTodoAccessVCal::OTodoAccessVCal( const QString& path ) 110OTodoAccessVCal::OTodoAccessVCal( const QString& path )
87 : m_dirty(false), m_file( path ) 111 : m_dirty(false), m_file( path )
88{ 112{
89} 113}
90OTodoAccessVCal::~OTodoAccessVCal() { 114OTodoAccessVCal::~OTodoAccessVCal() {
91} 115}
92bool OTodoAccessVCal::load() { 116bool OTodoAccessVCal::load() {
93 m_map.clear(); 117 m_map.clear();
@@ -176,25 +200,25 @@ QArray<int> OTodoAccessVCal::sorted( bool, int, int, int ) {
176 return ar; 200 return ar;
177} 201}
178QArray<int> OTodoAccessVCal::allRecords()const { 202QArray<int> OTodoAccessVCal::allRecords()const {
179 QArray<int> ar( m_map.count() ); 203 QArray<int> ar( m_map.count() );
180 QMap<int, OTodo>::ConstIterator it; 204 QMap<int, OTodo>::ConstIterator it;
181 int i = 0; 205 int i = 0;
182 for ( it = m_map.begin(); it != m_map.end(); ++it ) { 206 for ( it = m_map.begin(); it != m_map.end(); ++it ) {
183 ar[i] = it.key(); 207 ar[i] = it.key();
184 i++; 208 i++;
185 } 209 }
186 return ar; 210 return ar;
187} 211}
188QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp &r)const { 212QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp& /* r */)const {
189 QArray<int> ar(0); 213 QArray<int> ar(0);
190 return ar; 214 return ar;
191} 215}
192QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) { 216QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) {
193 QArray<int> ar(0); 217 QArray<int> ar(0);
194 return ar; 218 return ar;
195} 219}
196QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& , 220QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& ,
197 const QDate& , 221 const QDate& ,
198 bool ) { 222 bool ) {
199 QArray<int> ar(0); 223 QArray<int> ar(0);
200 return ar; 224 return ar;