Diffstat (limited to 'libopie2/opiepim/core/otodoaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp index 83750d5..6fa0089 100644 --- a/libopie2/opiepim/core/otodoaccess.cpp +++ b/libopie2/opiepim/core/otodoaccess.cpp | |||
@@ -12,48 +12,49 @@ | |||
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #include <qdatetime.h> | 29 | #include <qdatetime.h> |
30 | 30 | ||
31 | #include <qpe/alarmserver.h> | 31 | #include <qpe/alarmserver.h> |
32 | 32 | ||
33 | // #include "otodoaccesssql.h" | 33 | // #include "otodoaccesssql.h" |
34 | #include <opie2/otodoaccess.h> | 34 | #include <opie2/otodoaccess.h> |
35 | #include <opie2/obackendfactory.h> | 35 | #include <opie2/obackendfactory.h> |
36 | #include <opie2/opimresolver.h> | ||
36 | 37 | ||
37 | namespace Opie { | 38 | namespace Opie { |
38 | OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access ) | 39 | OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access ) |
39 | : QObject(), OPimAccessTemplate<OPimTodo>( end ), m_todoBackEnd( end ) | 40 | : QObject(), OPimAccessTemplate<OPimTodo>( end ), m_todoBackEnd( end ) |
40 | { | 41 | { |
41 | // if (end == 0l ) | 42 | // if (end == 0l ) |
42 | // m_todoBackEnd = new OPimTodoAccessBackendSQL( QString::null); | 43 | // m_todoBackEnd = new OPimTodoAccessBackendSQL( QString::null); |
43 | 44 | ||
44 | // Zecke: Du musst hier noch fr das XML-Backend einen Appnamen bergeben ! | 45 | // Zecke: Du musst hier noch fr das XML-Backend einen Appnamen bergeben ! |
45 | if (end == 0l ) | 46 | if (end == 0l ) |
46 | m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::Default ("todo", QString::null); | 47 | m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::Default ("todo", QString::null); |
47 | 48 | ||
48 | setBackEnd( m_todoBackEnd ); | 49 | setBackEnd( m_todoBackEnd ); |
49 | } | 50 | } |
50 | OPimTodoAccess::~OPimTodoAccess() { | 51 | OPimTodoAccess::~OPimTodoAccess() { |
51 | // qWarning("~OPimTodoAccess"); | 52 | // qWarning("~OPimTodoAccess"); |
52 | } | 53 | } |
53 | void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) { | 54 | void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) { |
54 | QValueList<OPimTodo>::ConstIterator it; | 55 | QValueList<OPimTodo>::ConstIterator it; |
55 | for ( it = list.begin(); it != list.end(); ++it ) { | 56 | for ( it = list.begin(); it != list.end(); ++it ) { |
56 | replace( (*it) ); | 57 | replace( (*it) ); |
57 | } | 58 | } |
58 | } | 59 | } |
59 | OPimTodoAccess::List OPimTodoAccess::effectiveToDos( const QDate& start, | 60 | OPimTodoAccess::List OPimTodoAccess::effectiveToDos( const QDate& start, |
@@ -69,25 +70,31 @@ OPimTodoAccess::List OPimTodoAccess::effectiveToDos( const QDate& start, | |||
69 | return effectiveToDos( start, QDate::currentDate(), | 70 | return effectiveToDos( start, QDate::currentDate(), |
70 | includeNoDates ); | 71 | includeNoDates ); |
71 | } | 72 | } |
72 | OPimTodoAccess::List OPimTodoAccess::overDue() { | 73 | OPimTodoAccess::List OPimTodoAccess::overDue() { |
73 | List lis( m_todoBackEnd->overDue(), this ); | 74 | List lis( m_todoBackEnd->overDue(), this ); |
74 | return lis; | 75 | return lis; |
75 | } | 76 | } |
76 | /* sort order */ | 77 | /* sort order */ |
77 | OPimTodoAccess::List OPimTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { | 78 | OPimTodoAccess::List OPimTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { |
78 | QArray<int> ints = m_todoBackEnd->sorted( ascending, sort, | 79 | QArray<int> ints = m_todoBackEnd->sorted( ascending, sort, |
79 | filter, cat ); | 80 | filter, cat ); |
80 | OPimTodoAccess::List list( ints, this ); | 81 | OPimTodoAccess::List list( ints, this ); |
81 | return list; | 82 | return list; |
82 | } | 83 | } |
83 | void OPimTodoAccess::removeAllCompleted() { | 84 | void OPimTodoAccess::removeAllCompleted() { |
84 | m_todoBackEnd->removeAllCompleted(); | 85 | m_todoBackEnd->removeAllCompleted(); |
85 | } | 86 | } |
86 | QBitArray OPimTodoAccess::backendSupport( const QString& ) const{ | 87 | QBitArray OPimTodoAccess::backendSupport( const QString& ) const{ |
87 | return m_todoBackEnd->supports(); | 88 | return m_todoBackEnd->supports(); |
88 | } | 89 | } |
89 | bool OPimTodoAccess::backendSupports( int attr, const QString& ar) const{ | 90 | bool OPimTodoAccess::backendSupports( int attr, const QString& ar) const{ |
90 | return backendSupport(ar).testBit( attr ); | 91 | return backendSupport(ar).testBit( attr ); |
91 | } | 92 | } |
92 | 93 | ||
94 | |||
95 | int OPimTodoAccess::rtti() const | ||
96 | { | ||
97 | return OPimResolver::TodoList; | ||
98 | } | ||
99 | |||
93 | } | 100 | } |