author | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-20 02:06:52 (UTC) |
commit | 55f4d502486e01927356908223622e435c975f7e (patch) (unidiff) | |
tree | 824b5c1e8992564677c4f39473bc108a32a2cf2a /libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |
parent | 060b4fc7a3fd5c1b5f745167fe084f7486719b7e (diff) | |
download | opie-55f4d502486e01927356908223622e435c975f7e.zip opie-55f4d502486e01927356908223622e435c975f7e.tar.gz opie-55f4d502486e01927356908223622e435c975f7e.tar.bz2 |
moved the opie pim stuff to libopie2 - pim. Tried to resort them, may be someone should take a look for a better file order. but now all applications can start using libopiepim2 instead of libopie1-pim-stuff.
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 77 |
1 files changed, 35 insertions, 42 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index a5be4c8..d0c8052 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -1,60 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | ||
3 | Copyright (C) The Main Author <main-author@whereever.org> | ||
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 | */ | ||
29 | /* | ||
2 | * SQL Backend for the OPIE-Contact Database. | 30 | * SQL Backend for the OPIE-Contact Database. |
3 | * | ||
4 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) | ||
5 | * | ||
6 | * ===================================================================== | ||
7 | *This program is free software; you can redistribute it and/or | ||
8 | *modify it under the terms of the GNU Library General Public | ||
9 | * License as published by the Free Software Foundation; either | ||
10 | * version 2 of the License, or (at your option) any later version. | ||
11 | * ===================================================================== | ||
12 | * ===================================================================== | ||
13 | * Version: $Id$ | ||
14 | * ===================================================================== | ||
15 | * History: | ||
16 | * $Log$ | ||
17 | * Revision 1.4 2003/12/22 10:19:26 eilers | ||
18 | * Finishing implementation of sql-backend for datebook. But I have to | ||
19 | * port the PIM datebook application to use it, before I could debug the | ||
20 | * whole stuff. | ||
21 | * Thus, PIM-Database backend is finished, but highly experimental. And some | ||
22 | * parts are still generic. For instance, the "queryByExample()" methods are | ||
23 | * not (or not fully) implemented. Todo: custom-entries not stored. | ||
24 | * The big show stopper: matchRegExp() (needed by OpieSearch) needs regular | ||
25 | * expression search in the database, which is not supported by sqlite ! | ||
26 | * Therefore we need either an extended sqlite or a workaround which would | ||
27 | * be very slow and memory consuming.. | ||
28 | * | ||
29 | * Revision 1.3 2003/12/08 15:18:10 eilers | ||
30 | * Committing unfinished sql implementation before merging to libopie2 starts.. | ||
31 | * | ||
32 | * Revision 1.2 2003/09/29 07:44:26 eilers | ||
33 | * Improvement of PIM-SQL Databases, but search queries are still limited. | ||
34 | * Addressbook: Changed table layout. Now, we just need 1/3 of disk-space. | ||
35 | * Todo: Started to add new attributes. Some type conversions missing. | ||
36 | * | ||
37 | * Revision 1.1 2003/09/22 14:31:16 eilers | ||
38 | * Added first experimental incarnation of sql-backend for addressbook. | ||
39 | * Some modifications to be able to compile the todo sql-backend. | ||
40 | * A lot of changes fill follow... | ||
41 | * | ||
42 | */ | 31 | */ |
43 | 32 | ||
44 | #include "ocontactaccessbackend_sql.h" | 33 | #include "ocontactaccessbackend_sql.h" |
45 | 34 | ||
46 | #include <qarray.h> | 35 | #include <qarray.h> |
47 | #include <qdatetime.h> | 36 | #include <qdatetime.h> |
48 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
49 | 38 | ||
50 | #include <qpe/global.h> | 39 | #include <qpe/global.h> |
51 | #include <qpe/recordfields.h> | 40 | #include <qpe/recordfields.h> |
52 | 41 | ||
53 | #include <opie/ocontactfields.h> | 42 | #include <opie2/ocontactfields.h> |
54 | #include <opie/oconversion.h> | 43 | #include <opie2/oconversion.h> |
55 | #include <opie2/osqldriver.h> | 44 | #include <opie2/osqldriver.h> |
56 | #include <opie2/osqlresult.h> | 45 | #include <opie2/osqlresult.h> |
57 | #include <opie2/osqlmanager.h> | 46 | #include <opie2/osqlmanager.h> |
58 | #include <opie2/osqlquery.h> | 47 | #include <opie2/osqlquery.h> |
59 | 48 | ||
60 | 49 | ||
@@ -78,13 +67,13 @@ | |||
78 | * CREATE query | 67 | * CREATE query |
79 | * LOAD query | 68 | * LOAD query |
80 | * INSERT | 69 | * INSERT |
81 | * REMOVE | 70 | * REMOVE |
82 | * CLEAR | 71 | * CLEAR |
83 | */ | 72 | */ |
84 | namespace { | 73 | namespace Opie { |
85 | /** | 74 | /** |
86 | * CreateQuery for the Todolist Table | 75 | * CreateQuery for the Todolist Table |
87 | */ | 76 | */ |
88 | class CreateQuery : public OSQLQuery { | 77 | class CreateQuery : public OSQLQuery { |
89 | public: | 78 | public: |
90 | CreateQuery(); | 79 | CreateQuery(); |
@@ -465,12 +454,14 @@ namespace { | |||
465 | 454 | ||
466 | }; | 455 | }; |
467 | 456 | ||
468 | 457 | ||
469 | /* --------------------------------------------------------------------------- */ | 458 | /* --------------------------------------------------------------------------- */ |
470 | 459 | ||
460 | namespace Opie { | ||
461 | |||
471 | OContactAccessBackend_SQL::OContactAccessBackend_SQL ( const QString& /* appname */, | 462 | OContactAccessBackend_SQL::OContactAccessBackend_SQL ( const QString& /* appname */, |
472 | const QString& filename ): | 463 | const QString& filename ): |
473 | OContactAccessBackend(), m_changed(false), m_driver( NULL ) | 464 | OContactAccessBackend(), m_changed(false), m_driver( NULL ) |
474 | { | 465 | { |
475 | qWarning("C'tor OContactAccessBackend_SQL starts"); | 466 | qWarning("C'tor OContactAccessBackend_SQL starts"); |
476 | QTime t; | 467 | QTime t; |
@@ -937,6 +928,8 @@ QMap<QString, QString> OContactAccessBackend_SQL::requestCustom( int uid ) cons | |||
937 | customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); | 928 | customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); |
938 | } | 929 | } |
939 | 930 | ||
940 | qWarning("RequestCustom needed: %d ms", t.elapsed() ); | 931 | qWarning("RequestCustom needed: %d ms", t.elapsed() ); |
941 | return customMap; | 932 | return customMap; |
942 | } | 933 | } |
934 | |||
935 | } | ||