summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend
authorzecke <zecke>2003-05-07 15:26:59 (UTC)
committer zecke <zecke>2003-05-07 15:26:59 (UTC)
commite150dfd5151aa59eb373aa58df5d9644c6c65b52 (patch) (unidiff)
tree4cbc036ef9bfc51d9938d6ff6a433081c0b400b8 /libopie2/opiepim/backend
parent1a550df3248342a8c863951ba733b862ca222216 (diff)
downloadopie-e150dfd5151aa59eb373aa58df5d9644c6c65b52.zip
opie-e150dfd5151aa59eb373aa58df5d9644c6c65b52.tar.gz
opie-e150dfd5151aa59eb373aa58df5d9644c6c65b52.tar.bz2
Make it possible to see what a backend supports
Diffstat (limited to 'libopie2/opiepim/backend') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccessbackend.h3
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp20
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.h2
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp16
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.h2
5 files changed, 42 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessbackend.h b/libopie2/opiepim/backend/otodoaccessbackend.h
index 7944a2c..05e8ca9 100644
--- a/libopie2/opiepim/backend/otodoaccessbackend.h
+++ b/libopie2/opiepim/backend/otodoaccessbackend.h
@@ -1,6 +1,8 @@
1#ifndef OPIE_TODO_ACCESS_BACKEND_H 1#ifndef OPIE_TODO_ACCESS_BACKEND_H
2#define OPIE_TODO_ACCESS_BACKEND_H 2#define OPIE_TODO_ACCESS_BACKEND_H
3 3
4#include <qbitarray.h>
5
4#include "otodo.h" 6#include "otodo.h"
5#include "opimaccessbackend.h" 7#include "opimaccessbackend.h"
6 8
@@ -15,6 +17,7 @@ public:
15 virtual QArray<int> sorted( bool asc, int sortOrder, int sortFilter, 17 virtual QArray<int> sorted( bool asc, int sortOrder, int sortFilter,
16 int cat ) = 0; 18 int cat ) = 0;
17 virtual void removeAllCompleted() = 0; 19 virtual void removeAllCompleted() = 0;
20 virtual QBitArray supports()const = 0;
18 21
19}; 22};
20 23
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp
index 2136283..9bc16c6 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.cpp
+++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp
@@ -199,3 +199,23 @@ QArray<int> OTodoAccessVCal::overDue() {
199 QArray<int> ar(0); 199 QArray<int> ar(0);
200 return ar; 200 return ar;
201} 201}
202QBitArray OTodoAccessVCal::supports()const {
203 static QBitArray ar = sup();
204
205 return ar;
206}
207QBitArray OTodoAccessVCal::sup() {
208 QBitArray ar ( OTodo::CompletedDate +1 );
209 ar.fill( true );
210
211 ar[OTodo::CrossReference] = false;
212 ar[OTodo::State ] = false;
213 ar[OTodo::Reminders] = false;
214 ar[OTodo::Notifiers] = false;
215 ar[OTodo::Maintainer] = false;
216 ar[OTodo::Progress] = false;
217 ar[OTodo::Alarms ] = false;
218 ar[OTodo::Recurrence] = false;
219
220 return ar;
221}
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.h b/libopie2/opiepim/backend/otodoaccessvcal.h
index a90ee9c..489416b 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.h
+++ b/libopie2/opiepim/backend/otodoaccessvcal.h
@@ -27,8 +27,10 @@ public:
27 bool replace( const OTodo& ); 27 bool replace( const OTodo& );
28 28
29 void removeAllCompleted(); 29 void removeAllCompleted();
30 virtual QBitArray supports()const;
30 31
31private: 32private:
33 static QBitArray sup();
32 bool m_dirty : 1; 34 bool m_dirty : 1;
33 QString m_file; 35 QString m_file;
34 QMap<int, OTodo> m_map; 36 QMap<int, OTodo> m_map;
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp
index 71e8787..55f268b 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.cpp
+++ b/libopie2/opiepim/backend/otodoaccessxml.cpp
@@ -664,7 +664,6 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder,
664 for (uint i= 0; i < vector.count(); i++ ) { 664 for (uint i= 0; i < vector.count(); i++ ) {
665 array[i] = ( vector.at(i) )->todo.uid(); 665 array[i] = ( vector.at(i) )->todo.uid();
666 } 666 }
667 qWarning("array count = %d %d", array.count(), vector.count() );
668 return array; 667 return array;
669}; 668};
670void OTodoAccessXML::removeAllCompleted() { 669void OTodoAccessXML::removeAllCompleted() {
@@ -673,3 +672,18 @@ void OTodoAccessXML::removeAllCompleted() {
673 m_events.remove( it ); 672 m_events.remove( it );
674 } 673 }
675} 674}
675QBitArray OTodoAccessXML::supports()const {
676 static QBitArray ar = sup();
677 return ar;
678}
679QBitArray OTodoAccessXML::sup() {
680 QBitArray ar( OTodo::CompletedDate +1 );
681 ar.fill( true );
682 ar[OTodo::CrossReference] = false;
683 ar[OTodo::State ] = false;
684 ar[OTodo::Reminders] = false;
685 ar[OTodo::Notifiers] = false;
686 ar[OTodo::Maintainer] = false;
687
688 return ar;
689}
diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h
index 1032c92..cc4a16f 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.h
+++ b/libopie2/opiepim/backend/otodoaccessxml.h
@@ -39,7 +39,9 @@ public:
39 QArray<int> overDue(); 39 QArray<int> overDue();
40 QArray<int> sorted( bool asc, int sortOrder, 40 QArray<int> sorted( bool asc, int sortOrder,
41 int sortFilter, int cat ); 41 int sortFilter, int cat );
42 QBitArray supports()const;
42private: 43private:
44 static QBitArray sup();
43 void todo( QAsciiDict<int>*, OTodo&,const QCString&,const QString& ); 45 void todo( QAsciiDict<int>*, OTodo&,const QCString&,const QString& );
44 QString toString( const OTodo& )const; 46 QString toString( const OTodo& )const;
45 QString toString( const QArray<int>& ints ) const; 47 QString toString( const QArray<int>& ints ) const;