-rw-r--r-- | libopie/pim/otodoaccess.cpp | 6 | ||||
-rw-r--r-- | libopie/pim/otodoaccess.h | 15 | ||||
-rw-r--r-- | libopie/pim/otodoaccessbackend.h | 3 | ||||
-rw-r--r-- | libopie/pim/otodoaccessvcal.cpp | 20 | ||||
-rw-r--r-- | libopie/pim/otodoaccessvcal.h | 2 | ||||
-rw-r--r-- | libopie/pim/otodoaccessxml.cpp | 16 | ||||
-rw-r--r-- | libopie/pim/otodoaccessxml.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessbackend.h | 3 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 16 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.cpp | 6 | ||||
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.h | 15 |
14 files changed, 126 insertions, 2 deletions
diff --git a/libopie/pim/otodoaccess.cpp b/libopie/pim/otodoaccess.cpp index 5e89a1b..37f6fbc 100644 --- a/libopie/pim/otodoaccess.cpp +++ b/libopie/pim/otodoaccess.cpp | |||
@@ -55,2 +55,8 @@ void OTodoAccess::removeAllCompleted() { | |||
55 | m_todoBackEnd->removeAllCompleted(); | 55 | m_todoBackEnd->removeAllCompleted(); |
56 | } | 56 | } |
57 | QBitArray OTodoAccess::backendSupport( const QString& ) const{ | ||
58 | return m_todoBackEnd->supports(); | ||
59 | } | ||
60 | bool OTodoAccess::backendSupports( int attr, const QString& ar) const{ | ||
61 | return backendSupport(ar).testBit( attr ); | ||
62 | } | ||
diff --git a/libopie/pim/otodoaccess.h b/libopie/pim/otodoaccess.h index a626731..916923f 100644 --- a/libopie/pim/otodoaccess.h +++ b/libopie/pim/otodoaccess.h | |||
@@ -73,4 +73,19 @@ public: | |||
73 | void removeAllCompleted(); | 73 | void removeAllCompleted(); |
74 | 74 | ||
75 | /** | ||
76 | * request information about what a backend supports. | ||
77 | * Supports in the sense of beeing able to store. | ||
78 | * This is related to the enum in OTodo | ||
79 | * | ||
80 | * @param backend Will be used in the future when we support multiple backend | ||
81 | */ | ||
82 | QBitArray backendSupport( const QString& backend = QString::null )const; | ||
83 | |||
84 | /** | ||
85 | * see above but for a specefic attribute. This method was added for convience | ||
86 | * @param attr The attribute to be queried for | ||
87 | * @param backend Will be used in the future when we support multiple backends | ||
88 | */ | ||
89 | bool backendSupports( int attr, const QString& backend = QString::null )const; | ||
75 | signals: | 90 | signals: |
76 | /** | 91 | /** |
diff --git a/libopie/pim/otodoaccessbackend.h b/libopie/pim/otodoaccessbackend.h index 7944a2c..05e8ca9 100644 --- a/libopie/pim/otodoaccessbackend.h +++ b/libopie/pim/otodoaccessbackend.h | |||
@@ -2,4 +2,6 @@ | |||
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" |
@@ -16,4 +18,5 @@ public: | |||
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 | }; |
diff --git a/libopie/pim/otodoaccessvcal.cpp b/libopie/pim/otodoaccessvcal.cpp index 2136283..9bc16c6 100644 --- a/libopie/pim/otodoaccessvcal.cpp +++ b/libopie/pim/otodoaccessvcal.cpp | |||
@@ -200,2 +200,22 @@ QArray<int> OTodoAccessVCal::overDue() { | |||
200 | return ar; | 200 | return ar; |
201 | } | 201 | } |
202 | QBitArray OTodoAccessVCal::supports()const { | ||
203 | static QBitArray ar = sup(); | ||
204 | |||
205 | return ar; | ||
206 | } | ||
207 | QBitArray 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/libopie/pim/otodoaccessvcal.h b/libopie/pim/otodoaccessvcal.h index a90ee9c..489416b 100644 --- a/libopie/pim/otodoaccessvcal.h +++ b/libopie/pim/otodoaccessvcal.h | |||
@@ -28,6 +28,8 @@ public: | |||
28 | 28 | ||
29 | void removeAllCompleted(); | 29 | void removeAllCompleted(); |
30 | virtual QBitArray supports()const; | ||
30 | 31 | ||
31 | private: | 32 | private: |
33 | static QBitArray sup(); | ||
32 | bool m_dirty : 1; | 34 | bool m_dirty : 1; |
33 | QString m_file; | 35 | QString m_file; |
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp index 71e8787..55f268b 100644 --- a/libopie/pim/otodoaccessxml.cpp +++ b/libopie/pim/otodoaccessxml.cpp | |||
@@ -665,5 +665,4 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, | |||
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 | }; |
@@ -674,2 +673,17 @@ void OTodoAccessXML::removeAllCompleted() { | |||
674 | } | 673 | } |
675 | } | 674 | } |
675 | QBitArray OTodoAccessXML::supports()const { | ||
676 | static QBitArray ar = sup(); | ||
677 | return ar; | ||
678 | } | ||
679 | QBitArray 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/libopie/pim/otodoaccessxml.h b/libopie/pim/otodoaccessxml.h index 1032c92..cc4a16f 100644 --- a/libopie/pim/otodoaccessxml.h +++ b/libopie/pim/otodoaccessxml.h | |||
@@ -40,5 +40,7 @@ public: | |||
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; | ||
42 | private: | 43 | private: |
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; |
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 | |||
@@ -2,4 +2,6 @@ | |||
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" |
@@ -16,4 +18,5 @@ public: | |||
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 | }; |
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 | |||
@@ -200,2 +200,22 @@ QArray<int> OTodoAccessVCal::overDue() { | |||
200 | return ar; | 200 | return ar; |
201 | } | 201 | } |
202 | QBitArray OTodoAccessVCal::supports()const { | ||
203 | static QBitArray ar = sup(); | ||
204 | |||
205 | return ar; | ||
206 | } | ||
207 | QBitArray 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 | |||
@@ -28,6 +28,8 @@ public: | |||
28 | 28 | ||
29 | void removeAllCompleted(); | 29 | void removeAllCompleted(); |
30 | virtual QBitArray supports()const; | ||
30 | 31 | ||
31 | private: | 32 | private: |
33 | static QBitArray sup(); | ||
32 | bool m_dirty : 1; | 34 | bool m_dirty : 1; |
33 | QString m_file; | 35 | QString m_file; |
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 | |||
@@ -665,5 +665,4 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, | |||
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 | }; |
@@ -674,2 +673,17 @@ void OTodoAccessXML::removeAllCompleted() { | |||
674 | } | 673 | } |
675 | } | 674 | } |
675 | QBitArray OTodoAccessXML::supports()const { | ||
676 | static QBitArray ar = sup(); | ||
677 | return ar; | ||
678 | } | ||
679 | QBitArray 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 | |||
@@ -40,5 +40,7 @@ public: | |||
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; | ||
42 | private: | 43 | private: |
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; |
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp index 5e89a1b..37f6fbc 100644 --- a/libopie2/opiepim/core/otodoaccess.cpp +++ b/libopie2/opiepim/core/otodoaccess.cpp | |||
@@ -55,2 +55,8 @@ void OTodoAccess::removeAllCompleted() { | |||
55 | m_todoBackEnd->removeAllCompleted(); | 55 | m_todoBackEnd->removeAllCompleted(); |
56 | } | 56 | } |
57 | QBitArray OTodoAccess::backendSupport( const QString& ) const{ | ||
58 | return m_todoBackEnd->supports(); | ||
59 | } | ||
60 | bool OTodoAccess::backendSupports( int attr, const QString& ar) const{ | ||
61 | return backendSupport(ar).testBit( attr ); | ||
62 | } | ||
diff --git a/libopie2/opiepim/core/otodoaccess.h b/libopie2/opiepim/core/otodoaccess.h index a626731..916923f 100644 --- a/libopie2/opiepim/core/otodoaccess.h +++ b/libopie2/opiepim/core/otodoaccess.h | |||
@@ -73,4 +73,19 @@ public: | |||
73 | void removeAllCompleted(); | 73 | void removeAllCompleted(); |
74 | 74 | ||
75 | /** | ||
76 | * request information about what a backend supports. | ||
77 | * Supports in the sense of beeing able to store. | ||
78 | * This is related to the enum in OTodo | ||
79 | * | ||
80 | * @param backend Will be used in the future when we support multiple backend | ||
81 | */ | ||
82 | QBitArray backendSupport( const QString& backend = QString::null )const; | ||
83 | |||
84 | /** | ||
85 | * see above but for a specefic attribute. This method was added for convience | ||
86 | * @param attr The attribute to be queried for | ||
87 | * @param backend Will be used in the future when we support multiple backends | ||
88 | */ | ||
89 | bool backendSupports( int attr, const QString& backend = QString::null )const; | ||
75 | signals: | 90 | signals: |
76 | /** | 91 | /** |