summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/otodoaccesssql.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.cpp41
1 files changed, 37 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp
index 3764c7e..944f82a 100644
--- a/libopie2/opiepim/backend/otodoaccesssql.cpp
+++ b/libopie2/opiepim/backend/otodoaccesssql.cpp
@@ -1,27 +1,56 @@
1/*
2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l.
6 .>+-=
7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more
20++= -. .` .: details.
21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
1 29
2#include <qdatetime.h> 30#include <qdatetime.h>
3 31
4#include <qpe/global.h> 32#include <qpe/global.h>
5 33
6#include <opie2/osqldriver.h> 34#include <opie2/osqldriver.h>
7#include <opie2/osqlresult.h> 35#include <opie2/osqlresult.h>
8#include <opie2/osqlmanager.h> 36#include <opie2/osqlmanager.h>
9#include <opie2/osqlquery.h> 37#include <opie2/osqlquery.h>
10 38
11#include "otodoaccesssql.h" 39#include <opie2/otodoaccesssql.h>
12#include "opimstate.h" 40#include <opie2/opimstate.h>
13#include "opimnotifymanager.h" 41#include <opie2/opimnotifymanager.h>
14#include "orecur.h" 42#include <opie2/orecur.h>
15 43
44using namespace Opie;
16/* 45/*
17 * first some query 46 * first some query
18 * CREATE query 47 * CREATE query
19 * LOAD query 48 * LOAD query
20 * INSERT 49 * INSERT
21 * REMOVE 50 * REMOVE
22 * CLEAR 51 * CLEAR
23 */ 52 */
24namespace { 53namespace {
25 /** 54 /**
26 * CreateQuery for the Todolist Table 55 * CreateQuery for the Todolist Table
27 */ 56 */
@@ -289,24 +318,26 @@ namespace {
289 return str; 318 return str;
290 } 319 }
291 QString EffQuery::out()const { 320 QString EffQuery::out()const {
292 QString str; 321 QString str;
293 str = QString("select uid from todolist where DueDate >= '%1-%2-%3' AND DueDate <= '%4-%5-%6'") 322 str = QString("select uid from todolist where DueDate >= '%1-%2-%3' AND DueDate <= '%4-%5-%6'")
294 .arg(m_start.year() ).arg(m_start.month() ).arg( m_start.day() ) 323 .arg(m_start.year() ).arg(m_start.month() ).arg( m_start.day() )
295 .arg(m_end. year() ).arg(m_end. month() ).arg(m_end.day() ); 324 .arg(m_end. year() ).arg(m_end. month() ).arg(m_end.day() );
296 325
297 return str; 326 return str;
298 } 327 }
299}; 328};
300 329
330
331namespace Opie {
301OTodoAccessBackendSQL::OTodoAccessBackendSQL( const QString& file ) 332OTodoAccessBackendSQL::OTodoAccessBackendSQL( const QString& file )
302 : OTodoAccessBackend(), m_dict(15), m_driver(NULL), m_dirty(true) 333 : OTodoAccessBackend(), m_dict(15), m_driver(NULL), m_dirty(true)
303{ 334{
304 QString fi = file; 335 QString fi = file;
305 if ( fi.isEmpty() ) 336 if ( fi.isEmpty() )
306 fi = Global::applicationFileName( "todolist", "todolist.db" ); 337 fi = Global::applicationFileName( "todolist", "todolist.db" );
307 OSQLManager man; 338 OSQLManager man;
308 m_driver = man.standard(); 339 m_driver = man.standard();
309 m_driver->setUrl(fi); 340 m_driver->setUrl(fi);
310 // fillDict(); 341 // fillDict();
311} 342}
312 343
@@ -682,12 +713,14 @@ QBitArray OTodoAccessBackendSQL::sup() const{
682 ar[OTodo::State ] = false; 713 ar[OTodo::State ] = false;
683 ar[OTodo::Reminders] = false; 714 ar[OTodo::Reminders] = false;
684 ar[OTodo::Notifiers] = false; 715 ar[OTodo::Notifiers] = false;
685 ar[OTodo::Maintainer] = false; 716 ar[OTodo::Maintainer] = false;
686 717
687 return ar; 718 return ar;
688} 719}
689 720
690void OTodoAccessBackendSQL::removeAllCompleted(){ 721void OTodoAccessBackendSQL::removeAllCompleted(){
691#warning OTodoAccessBackendSQL::removeAllCompleted() not implemented !! 722#warning OTodoAccessBackendSQL::removeAllCompleted() not implemented !!
692 723
693} 724}
725
726}