author | zecke <zecke> | 2004-08-06 12:10:04 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-06 12:10:04 (UTC) |
commit | cf4207c5c299812e46f40aaee307100f58317a97 (patch) (unidiff) | |
tree | 5ddff7987fb9010c2940c3e8b4f68852774c93d6 /libopie2/opiepim/backend | |
parent | 20e6c238513eb91f47c3030c2db7ada7cf4b7f25 (diff) | |
download | opie-cf4207c5c299812e46f40aaee307100f58317a97.zip opie-cf4207c5c299812e46f40aaee307100f58317a97.tar.gz opie-cf4207c5c299812e46f40aaee307100f58317a97.tar.bz2 |
Update to the on-server move.
We now have
core/ with DataTypes, PUBLIC API
backend/ for concrete implementation of backends and the 'Interface description'
ui/ For UI related classes
private/ For private implementation details
-rw-r--r-- | libopie2/opiepim/backend/backends.pro | 53 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.cpp | 2 |
3 files changed, 25 insertions, 32 deletions
diff --git a/libopie2/opiepim/backend/backends.pro b/libopie2/opiepim/backend/backends.pro index f91e98a..42d807c 100644 --- a/libopie2/opiepim/backend/backends.pro +++ b/libopie2/opiepim/backend/backends.pro | |||
@@ -1,44 +1,37 @@ | |||
1 | SOURCES += \ | 1 | SOURCES += \ |
2 | core/backends/ocontactaccessbackend_vcard.cpp \ | 2 | backend/ocontactaccessbackend_vcard.cpp \ |
3 | core/backends/ocontactaccessbackend_xml.cpp \ | 3 | backend/ocontactaccessbackend_xml.cpp \ |
4 | core/backends/ocontactaccess.cpp \ | 4 | backend/odatebookaccessbackend.cpp \ |
5 | core/backends/odatebookaccessbackend.cpp \ | 5 | backend/odatebookaccessbackend_xml.cpp \ |
6 | core/backends/odatebookaccessbackend_xml.cpp \ | 6 | backend/otodoaccessbackend.cpp \ |
7 | core/backends/otodoaccessbackend.cpp \ | 7 | backend/otodoaccessvcal.cpp \ |
8 | core/backends/otodoaccess.cpp \ | 8 | backend/otodoaccessxml.cpp |
9 | core/backends/otodoaccessvcal.cpp \ | ||
10 | core/backends/otodoaccessxml.cpp \ | ||
11 | core/backends/odatebookaccess.cpp | ||
12 | 9 | ||
13 | HEADERS += \ | 10 | HEADERS += \ |
14 | core/backends/obackendfactory.h \ | 11 | backend/obackendfactory.h \ |
15 | core/backends/ocontactaccessbackend.h \ | 12 | backend/ocontactaccessbackend.h \ |
16 | core/backends/ocontactaccessbackend_vcard.h \ | 13 | backend/ocontactaccessbackend_vcard.h \ |
17 | core/backends/ocontactaccessbackend_xml.h \ | 14 | backend/ocontactaccessbackend_xml.h \ |
18 | core/backends/ocontactaccess.h \ | 15 | backend/odatebookaccessbackend.h \ |
19 | core/backends/odatebookaccessbackend.h \ | 16 | backend/odatebookaccessbackend_xml.h \ |
20 | core/backends/odatebookaccessbackend_xml.h \ | 17 | backend/opimaccessbackend.h \ |
21 | core/backends/opimaccessbackend.h \ | 18 | backend/otodoaccessbackend.h \ |
22 | core/backends/opimaccesstemplate.h \ | 19 | backend/otodoaccessvcal.h \ |
23 | core/backends/otodoaccessbackend.h \ | 20 | backend/otodoaccessxml.h |
24 | core/backends/otodoaccess.h \ | ||
25 | core/backends/otodoaccessvcal.h \ | ||
26 | core/backends/otodoaccessxml.h \ | ||
27 | core/backends/odatebookaccess.h | ||
28 | 21 | ||
29 | contains( ENABLE_SQL_PIM_BACKEND, y ) { | 22 | contains( ENABLE_SQL_PIM_BACKEND, y ) { |
30 | message ( Enabling the SQL Backend for libopiepim2 ) | 23 | message ( Enabling the SQL Backend for libopiepim2 ) |
31 | DEFINES += __USE_SQL | 24 | DEFINES += __USE_SQL |
32 | LIBS += -lopiedb2 | 25 | LIBS += -lopiedb2 |
33 | HEADERS += core/backends/otodoaccesssql.h \ | 26 | HEADERS += backend/otodoaccesssql.h \ |
34 | core/backends/ocontactaccessbackend_sql.h \ | 27 | backend/ocontactaccessbackend_sql.h \ |
35 | core/backends/odatebookaccessbackend_sql.h | 28 | backend/odatebookaccessbackend_sql.h |
36 | SOURCES += core/backends/otodoaccesssql.cpp \ | 29 | SOURCES += backend/otodoaccesssql.cpp \ |
37 | core/backends/ocontactaccessbackend_sql.cpp \ | 30 | backend/ocontactaccessbackend_sql.cpp \ |
38 | core/backends/odatebookaccessbackend_sql.cpp | 31 | backend/odatebookaccessbackend_sql.cpp |
39 | } | 32 | } |
40 | 33 | ||
41 | !contains( ENABLE_SQL_PIM_BACKEND, y ) { | 34 | !contains( ENABLE_SQL_PIM_BACKEND, y ) { |
42 | message ( No SQL Backend in libopiepim2 ) | 35 | message ( No SQL Backend in libopiepim2 ) |
43 | } | 36 | } |
44 | 37 | ||
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index 6b66814..af77a05 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | |||
@@ -1,82 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Main Author <main-author@whereever.org> | 3 | Copyright (C) The Main Author <main-author@whereever.org> |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
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 | /* | 29 | /* |
30 | * VCard Backend for the OPIE-Contact Database. | 30 | * VCard Backend for the OPIE-Contact Database. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | 33 | ||
34 | #include "vobject_p.h" | 34 | #include <opie2/private/vobject_p.h> |
35 | 35 | ||
36 | /* OPIE */ | 36 | /* OPIE */ |
37 | #include <opie2/ocontactaccessbackend_vcard.h> | 37 | #include <opie2/ocontactaccessbackend_vcard.h> |
38 | #include <opie2/odebug.h> | 38 | #include <opie2/odebug.h> |
39 | 39 | ||
40 | #include <qpe/timeconversion.h> | 40 | #include <qpe/timeconversion.h> |
41 | 41 | ||
42 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! | 42 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! |
43 | #define protected public | 43 | #define protected public |
44 | #include <qfile.h> | 44 | #include <qfile.h> |
45 | #undef protected | 45 | #undef protected |
46 | 46 | ||
47 | namespace Opie { | 47 | namespace Opie { |
48 | 48 | ||
49 | OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard ( const QString& , const QString& filename ): | 49 | OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard ( const QString& , const QString& filename ): |
50 | m_dirty( false ), | 50 | m_dirty( false ), |
51 | m_file( filename ) | 51 | m_file( filename ) |
52 | { | 52 | { |
53 | load(); | 53 | load(); |
54 | } | 54 | } |
55 | 55 | ||
56 | 56 | ||
57 | bool OPimContactAccessBackend_VCard::load () | 57 | bool OPimContactAccessBackend_VCard::load () |
58 | { | 58 | { |
59 | m_map.clear(); | 59 | m_map.clear(); |
60 | m_dirty = false; | 60 | m_dirty = false; |
61 | 61 | ||
62 | VObject* obj = 0l; | 62 | VObject* obj = 0l; |
63 | 63 | ||
64 | if ( QFile::exists(m_file) ){ | 64 | if ( QFile::exists(m_file) ){ |
65 | obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() ); | 65 | obj = Parse_MIME_FromFileName( QFile::encodeName(m_file).data() ); |
66 | if ( !obj ) | 66 | if ( !obj ) |
67 | return false; | 67 | return false; |
68 | }else{ | 68 | }else{ |
69 | odebug << "File \"" << m_file << "\" not found !" << oendl; | 69 | odebug << "File \"" << m_file << "\" not found !" << oendl; |
70 | return false; | 70 | return false; |
71 | } | 71 | } |
72 | 72 | ||
73 | while ( obj ) { | 73 | while ( obj ) { |
74 | OPimContact con = parseVObject( obj ); | 74 | OPimContact con = parseVObject( obj ); |
75 | /* | 75 | /* |
76 | * if uid is 0 assign a new one | 76 | * if uid is 0 assign a new one |
77 | * this at least happens on | 77 | * this at least happens on |
78 | * Nokia6210 | 78 | * Nokia6210 |
79 | */ | 79 | */ |
80 | if ( con.uid() == 0 ){ | 80 | if ( con.uid() == 0 ){ |
81 | con.setUid( 1 ); | 81 | con.setUid( 1 ); |
82 | owarn << "assigned new uid " << con.uid() << "" << oendl; | 82 | owarn << "assigned new uid " << con.uid() << "" << oendl; |
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp index 14a325e..7d58a40 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.cpp +++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp | |||
@@ -1,78 +1,78 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) | 3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
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 | 29 | ||
30 | #include "vobject_p.h" | 30 | #include <opie2/private/vobject_p.h> |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/otodoaccessvcal.h> | 33 | #include <opie2/otodoaccessvcal.h> |
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | 35 | ||
36 | #include <qpe/timeconversion.h> | 36 | #include <qpe/timeconversion.h> |
37 | 37 | ||
38 | /* QT */ | 38 | /* QT */ |
39 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! | 39 | //FIXME: Hack to allow direct access to FILE* fh. Rewrite this! |
40 | #define protected public | 40 | #define protected public |
41 | #include <qfile.h> | 41 | #include <qfile.h> |
42 | #undef protected | 42 | #undef protected |
43 | 43 | ||
44 | using namespace Opie; | 44 | using namespace Opie; |
45 | 45 | ||
46 | namespace { | 46 | namespace { |
47 | static OPimTodo eventByVObj( VObject *obj ){ | 47 | static OPimTodo eventByVObj( VObject *obj ){ |
48 | OPimTodo event; | 48 | OPimTodo event; |
49 | VObject *ob; | 49 | VObject *ob; |
50 | QCString name; | 50 | QCString name; |
51 | // no uid, attendees, ... and no fun | 51 | // no uid, attendees, ... and no fun |
52 | // description | 52 | // description |
53 | if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){ | 53 | if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){ |
54 | name = vObjectStringZValue( ob ); | 54 | name = vObjectStringZValue( ob ); |
55 | #if 0 | 55 | #if 0 |
56 | event.setDescription( name ); | 56 | event.setDescription( name ); |
57 | #else | 57 | #else |
58 | event.setSummary( name ); | 58 | event.setSummary( name ); |
59 | #endif | 59 | #endif |
60 | } | 60 | } |
61 | // summary | 61 | // summary |
62 | if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) { | 62 | if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) { |
63 | name = vObjectStringZValue( ob ); | 63 | name = vObjectStringZValue( ob ); |
64 | #if 0 | 64 | #if 0 |
65 | event.setSummary( name ); | 65 | event.setSummary( name ); |
66 | #else | 66 | #else |
67 | event.setDescription( name ); | 67 | event.setDescription( name ); |
68 | #endif | 68 | #endif |
69 | } | 69 | } |
70 | // completed | 70 | // completed |
71 | if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){ | 71 | if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){ |
72 | name = vObjectStringZValue( ob ); | 72 | name = vObjectStringZValue( ob ); |
73 | if( name == "COMPLETED" ){ | 73 | if( name == "COMPLETED" ){ |
74 | event.setCompleted( true ); | 74 | event.setCompleted( true ); |
75 | }else{ | 75 | }else{ |
76 | event.setCompleted( false ); | 76 | event.setCompleted( false ); |
77 | } | 77 | } |
78 | }else | 78 | }else |