summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
authorzecke <zecke>2004-08-06 12:10:04 (UTC)
committer zecke <zecke>2004-08-06 12:10:04 (UTC)
commitcf4207c5c299812e46f40aaee307100f58317a97 (patch) (unidiff)
tree5ddff7987fb9010c2940c3e8b4f68852774c93d6 /libopie2/opiepim
parent20e6c238513eb91f47c3030c2db7ada7cf4b7f25 (diff)
downloadopie-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
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/backends.pro53
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp2
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp2
-rw-r--r--libopie2/opiepim/core/core.pro61
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp4
-rw-r--r--libopie2/opiepim/opiepim.pro6
-rw-r--r--libopie2/opiepim/ui/ui.pro4
7 files changed, 74 insertions, 58 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 @@
1SOURCES += \ 1SOURCES += \
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
13HEADERS += \ 10HEADERS += \
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
29contains( ENABLE_SQL_PIM_BACKEND, y ) { 22contains( 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,130 +1,130 @@
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
47namespace Opie { 47namespace Opie {
48 48
49OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard ( const QString& , const QString& filename ): 49OPimContactAccessBackend_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
57bool OPimContactAccessBackend_VCard::load () 57bool 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;
83 } 83 }
84 84
85 m_map.insert( con.uid(), con ); 85 m_map.insert( con.uid(), con );
86 86
87 VObject *t = obj; 87 VObject *t = obj;
88 obj = nextVObjectInList(obj); 88 obj = nextVObjectInList(obj);
89 cleanVObject( t ); 89 cleanVObject( t );
90 } 90 }
91 91
92 return true; 92 return true;
93 93
94} 94}
95bool OPimContactAccessBackend_VCard::reload() 95bool OPimContactAccessBackend_VCard::reload()
96{ 96{
97 return load(); 97 return load();
98} 98}
99bool OPimContactAccessBackend_VCard::save() 99bool OPimContactAccessBackend_VCard::save()
100{ 100{
101 if (!m_dirty ) 101 if (!m_dirty )
102 return true; 102 return true;
103 103
104 QFile file( m_file ); 104 QFile file( m_file );
105 if (!file.open(IO_WriteOnly ) ) 105 if (!file.open(IO_WriteOnly ) )
106 return false; 106 return false;
107 107
108 VObject *obj; 108 VObject *obj;
109 obj = newVObject( VCCalProp ); 109 obj = newVObject( VCCalProp );
110 addPropValue( obj, VCVersionProp, "1.0" ); 110 addPropValue( obj, VCVersionProp, "1.0" );
111 111
112 VObject *vo; 112 VObject *vo;
113 for(QMap<int, OPimContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){ 113 for(QMap<int, OPimContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){
114 vo = createVObject( *it ); 114 vo = createVObject( *it );
115 writeVObject( file.fh, vo ); //FIXME: HACK!!! 115 writeVObject( file.fh, vo ); //FIXME: HACK!!!
116 cleanVObject( vo ); 116 cleanVObject( vo );
117 } 117 }
118 cleanStrTbl(); 118 cleanStrTbl();
119 deleteVObject( obj ); 119 deleteVObject( obj );
120 120
121 m_dirty = false; 121 m_dirty = false;
122 return true; 122 return true;
123 123
124 124
125} 125}
126void OPimContactAccessBackend_VCard::clear () 126void OPimContactAccessBackend_VCard::clear ()
127{ 127{
128 m_map.clear(); 128 m_map.clear();
129 m_dirty = true; // ??? sure ? (se) 129 m_dirty = true; // ??? sure ? (se)
130} 130}
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,126 +1,126 @@
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
44using namespace Opie; 44using namespace Opie;
45 45
46namespace { 46namespace {
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
79 event.setCompleted( false ); 79 event.setCompleted( false );
80 // priority 80 // priority
81 if ((ob = isAPropertyOf(obj, VCPriorityProp))) { 81 if ((ob = isAPropertyOf(obj, VCPriorityProp))) {
82 name = vObjectStringZValue( ob ); 82 name = vObjectStringZValue( ob );
83 bool ok; 83 bool ok;
84 event.setPriority(name.toInt(&ok) ); 84 event.setPriority(name.toInt(&ok) );
85 } 85 }
86 //due date 86 //due date
87 if((ob = isAPropertyOf(obj, VCDueProp)) ){ 87 if((ob = isAPropertyOf(obj, VCDueProp)) ){
88 event.setHasDueDate( true ); 88 event.setHasDueDate( true );
89 name = vObjectStringZValue( ob ); 89 name = vObjectStringZValue( ob );
90 event.setDueDate( TimeConversion::fromISO8601( name).date() ); 90 event.setDueDate( TimeConversion::fromISO8601( name).date() );
91 } 91 }
92 // categories 92 // categories
93 if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){ 93 if((ob = isAPropertyOf( obj, VCCategoriesProp )) != 0 ){
94 name = vObjectStringZValue( ob ); 94 name = vObjectStringZValue( ob );
95 owarn << "Categories:" << name.data() << "" << oendl; 95 owarn << "Categories:" << name.data() << "" << oendl;
96 } 96 }
97 97
98 event.setUid( 1 ); 98 event.setUid( 1 );
99 return event; 99 return event;
100 }; 100 };
101 static VObject *vobjByEvent( const OPimTodo &event ) { 101 static VObject *vobjByEvent( const OPimTodo &event ) {
102 VObject *task = newVObject( VCTodoProp ); 102 VObject *task = newVObject( VCTodoProp );
103 if( task == 0 ) 103 if( task == 0 )
104 return 0l; 104 return 0l;
105 105
106 if( event.hasDueDate() ) { 106 if( event.hasDueDate() ) {
107 QTime time(0, 0, 0); 107 QTime time(0, 0, 0);
108 QDateTime date(event.dueDate(), time ); 108 QDateTime date(event.dueDate(), time );
109 addPropValue( task, VCDueProp, 109 addPropValue( task, VCDueProp,
110 TimeConversion::toISO8601( date ) ); 110 TimeConversion::toISO8601( date ) );
111 } 111 }
112 112
113 if( event.isCompleted() ) 113 if( event.isCompleted() )
114 addPropValue( task, VCStatusProp, "COMPLETED"); 114 addPropValue( task, VCStatusProp, "COMPLETED");
115 115
116 QString string = QString::number(event.priority() ); 116 QString string = QString::number(event.priority() );
117 addPropValue( task, VCPriorityProp, string.local8Bit() ); 117 addPropValue( task, VCPriorityProp, string.local8Bit() );
118 118
119 addPropValue( task, VCCategoriesProp, 119 addPropValue( task, VCCategoriesProp,
120 event.idsToString( event.categories() ).local8Bit() ); 120 event.idsToString( event.categories() ).local8Bit() );
121 121
122#if 0 122#if 0
123 123
124 // There seems a misrepresentation between summary in otodoevent 124 // There seems a misrepresentation between summary in otodoevent
125 // and summary in vcard. 125 // and summary in vcard.
126 // The same with description.. 126 // The same with description..
diff --git a/libopie2/opiepim/core/core.pro b/libopie2/opiepim/core/core.pro
index 597b1e8..b1b5655 100644
--- a/libopie2/opiepim/core/core.pro
+++ b/libopie2/opiepim/core/core.pro
@@ -1,23 +1,48 @@
1HEADERS += \ 1HEADERS += \
2 core/ocontactaccess.h \
3 core/odatebookaccess.h \
4 core/opimaccessfactory.h \
5 core/opimaccesstemplate.h \
6 core/opimcache.h \
7 core/opimcontactfields.h \
8 core/opimcontact.h \
2 core/opimdateconversion.h \ 9 core/opimdateconversion.h \
3 core/opimcache.h \ 10 core/opimevent.h \
4 core/opimmaintainer.h \ 11 core/opimglobal.h \
5 core/opimresolver.h \ 12 core/opimmaintainer.h \
6 core/opimstate.h \ 13 core/opimnotify.h \
7 core/opimxref.h \ 14 core/opimnotifymanager.h \
8 core/opimxrefmanager.h \ 15 core/opimrecord.h \
9 core/opimxrefpartner.h \ 16 core/opimrecordlist.h \
10 core/opimrecurrence.h \ 17 core/opimrecurrence.h \
11 core/opimtemplatebase.h \ 18 core/opimresolver.h \
12 core/opimtimezone.h 19 core/opimstate.h \
20 core/opimtemplatebase.h \
21 core/opimtimezone.h \
22 core/opimtodo.h \
23 core/opimxref.h \
24 core/opimxrefmanager.h \
25 core/opimxrefpartner.h \
26 core/otodoaccess.h
13 27
14SOURCES += \ 28SOURCES += \
29 core/ocontactaccess.cpp \
30 core/odatebookaccess.cpp \
31 core/opimcontactfields.cpp \
32 core/opimcontact.cpp \
15 core/opimdateconversion.cpp \ 33 core/opimdateconversion.cpp \
16 core/opimmaintainer.cpp \ 34 core/opimevent.cpp \
17 core/opimresolver.cpp \ 35 core/opimmaintainer.cpp \
18 core/opimstate.cpp \ 36 core/opimnotify.cpp \
19 core/opimxref.cpp \ 37 core/opimnotifymanager.cpp \
20 core/opimxrefmanager.cpp \ 38 core/opimrecord.cpp \
21 core/opimxrefpartner.cpp \ 39 core/opimrecurrence.cpp \
22 core/opimrecurrence.cpp \ 40 core/opimresolver.cpp \
23 core/opimtimezone.cpp 41 core/opimstate.cpp \
42 core/opimtimezone.cpp \
43 core/opimtodo.cpp \
44 core/opimxref.cpp \
45 core/opimxrefmanager.cpp \
46 core/opimxrefpartner.cpp \
47 core/otodoaccess.cpp
48
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index 2602493..771d855 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -1,133 +1,133 @@
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 * ===================================================================== 30 * =====================================================================
31 * ToDo: XML-Backend: Automatic reload if something was changed... 31 * ToDo: XML-Backend: Automatic reload if something was changed...
32 * 32 *
33 * 33 *
34 */ 34 */
35 35
36#include "ocontactaccess.h" 36#include <opie2/ocontactaccess.h>
37#include "obackendfactory.h" 37#include <opie2/obackendfactory.h>
38 38
39/* OPIE */ 39/* OPIE */
40#include <opie2/ocontactaccessbackend_xml.h> 40#include <opie2/ocontactaccessbackend_xml.h>
41#include <opie2/opimresolver.h> 41#include <opie2/opimresolver.h>
42#include <opie2/opimglobal.h> 42#include <opie2/opimglobal.h>
43#include <opie2/odebug.h> 43#include <opie2/odebug.h>
44 44
45//#include <qpe/qcopenvelope_qws.h> 45//#include <qpe/qcopenvelope_qws.h>
46#include <qpe/global.h> 46#include <qpe/global.h>
47 47
48/* QT */ 48/* QT */
49#include <qasciidict.h> 49#include <qasciidict.h>
50#include <qdatetime.h> 50#include <qdatetime.h>
51#include <qfile.h> 51#include <qfile.h>
52#include <qregexp.h> 52#include <qregexp.h>
53#include <qlist.h> 53#include <qlist.h>
54#include <qcopchannel_qws.h> 54#include <qcopchannel_qws.h>
55 55
56/* STD */ 56/* STD */
57#include <errno.h> 57#include <errno.h>
58#include <fcntl.h> 58#include <fcntl.h>
59#include <unistd.h> 59#include <unistd.h>
60#include <stdlib.h> 60#include <stdlib.h>
61 61
62 62
63namespace Opie { 63namespace Opie {
64 64
65OPimContactAccess::OPimContactAccess ( const QString appname, const QString , 65OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
66 OPimContactAccessBackend* end, bool autosync ): 66 OPimContactAccessBackend* end, bool autosync ):
67 OPimAccessTemplate<OPimContact>( end ) 67 OPimAccessTemplate<OPimContact>( end )
68{ 68{
69 /* take care of the backend. If there is no one defined, we 69 /* take care of the backend. If there is no one defined, we
70 * will use the XML-Backend as default (until we have a cute SQL-Backend..). 70 * will use the XML-Backend as default (until we have a cute SQL-Backend..).
71 */ 71 */
72 if( end == 0 ) { 72 if( end == 0 ) {
73 owarn << "Using BackendFactory !" << oendl; 73 owarn << "Using BackendFactory !" << oendl;
74 end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname ); 74 end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname );
75 } 75 }
76 // Set backend locally and in template 76 // Set backend locally and in template
77 m_backEnd = end; 77 m_backEnd = end;
78 OPimAccessTemplate<OPimContact>::setBackEnd (end); 78 OPimAccessTemplate<OPimContact>::setBackEnd (end);
79 79
80 80
81 /* Connect signal of external db change to function */ 81 /* Connect signal of external db change to function */
82 QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); 82 QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
83 connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), 83 connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)),
84 this, SLOT(copMessage(const QCString&,const QByteArray&)) ); 84 this, SLOT(copMessage(const QCString&,const QByteArray&)) );
85 if ( autosync ){ 85 if ( autosync ){
86 QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); 86 QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this );
87 connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)), 87 connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)),
88 this, SLOT(copMessage(const QCString&,const QByteArray&)) ); 88 this, SLOT(copMessage(const QCString&,const QByteArray&)) );
89 } 89 }
90 90
91 91
92} 92}
93OPimContactAccess::~OPimContactAccess () 93OPimContactAccess::~OPimContactAccess ()
94{ 94{
95 /* The user may forget to save the changed database, therefore try to 95 /* The user may forget to save the changed database, therefore try to
96 * do it for him.. 96 * do it for him..
97 */ 97 */
98 save(); 98 save();
99 // delete m_backEnd; is done by template.. 99 // delete m_backEnd; is done by template..
100} 100}
101 101
102 102
103bool OPimContactAccess::save () 103bool OPimContactAccess::save ()
104{ 104{
105 /* If the database was changed externally, we could not save the 105 /* If the database was changed externally, we could not save the
106 * Data. This will remove added items which is unacceptable ! 106 * Data. This will remove added items which is unacceptable !
107 * Therefore: Reload database and merge the data... 107 * Therefore: Reload database and merge the data...
108 */ 108 */
109 if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) 109 if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() )
110 reload(); 110 reload();
111 111
112 bool status = OPimAccessTemplate<OPimContact>::save(); 112 bool status = OPimAccessTemplate<OPimContact>::save();
113 if ( !status ) return false; 113 if ( !status ) return false;
114 114
115 /* Now tell everyone that new data is available. 115 /* Now tell everyone that new data is available.
116 */ 116 */
117 QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); 117 QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" );
118 118
119 return true; 119 return true;
120} 120}
121 121
122const uint OPimContactAccess::querySettings() 122const uint OPimContactAccess::querySettings()
123{ 123{
124 return ( m_backEnd->querySettings() ); 124 return ( m_backEnd->querySettings() );
125} 125}
126 126
127bool OPimContactAccess::hasQuerySettings ( int querySettings ) const 127bool OPimContactAccess::hasQuerySettings ( int querySettings ) const
128{ 128{
129 return ( m_backEnd->hasQuerySettings ( querySettings ) ); 129 return ( m_backEnd->hasQuerySettings ( querySettings ) );
130} 130}
131OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const 131OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const
132{ 132{
133 QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); 133 QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat );
diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro
index 318aecf..af8e63d 100644
--- a/libopie2/opiepim/opiepim.pro
+++ b/libopie2/opiepim/opiepim.pro
@@ -1,27 +1,23 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = opimcontact.h opimcontactfields.h opimrecord.h opimtodo.h opimnotify.h \
5 opimnotifymanager.h opimevent.h
6 4
7SOURCES = opimcontact.cpp opimcontactfields.cpp opimrecord.cpp opimtodo.cpp opimnotify.cpp \
8 opimnotifymanager.cpp opimevent.cpp
9INTERFACES = 5INTERFACES =
10TARGET = opiepim2 6TARGET = opiepim2
11VERSION = 1.8.6 7VERSION = 1.8.6
12INCLUDEPATH += $(OPIEDIR)/include 8INCLUDEPATH += $(OPIEDIR)/include
13DEPENDPATH += $(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
14LIBS += -lopiecore2 10LIBS += -lopiecore2
15 11
16include ( $(OPIEDIR)/gen.pro ) 12include ( $(OPIEDIR)/gen.pro )
17include ( core/core.pro ) 13include ( core/core.pro )
18include ( core/backends/backends.pro ) 14include ( backend/backends.pro )
19include ( ui/ui.pro ) 15include ( ui/ui.pro )
20 16
21!contains( platform, x11 ) { 17!contains( platform, x11 ) {
22 include ( $(OPIEDIR)/include.pro ) 18 include ( $(OPIEDIR)/include.pro )
23} 19}
24 20
25contains( platform, x11 ) { 21contains( platform, x11 ) {
26 LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib 22 LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
27} 23}
diff --git a/libopie2/opiepim/ui/ui.pro b/libopie2/opiepim/ui/ui.pro
index 530bd9f..6aa01a7 100644
--- a/libopie2/opiepim/ui/ui.pro
+++ b/libopie2/opiepim/ui/ui.pro
@@ -1,7 +1,9 @@
1HEADERS += ui/opimmainwindow.h \ 1HEADERS += ui/opimmainwindow.h \
2 ui/opimrecurrencewidget.h 2 ui/opimrecurrencewidget.h \
3 ui/todayconfigwidget.h \
4 ui/todayplugininterface.h
3 5
4SOURCES += ui/opimmainwindow.cpp \ 6SOURCES += ui/opimmainwindow.cpp \
5 ui/opimrecurrencewidget.cpp 7 ui/opimrecurrencewidget.cpp
6 8
7INTERFACES += ui/opimrecurrencebase.ui \ No newline at end of file 9INTERFACES += ui/opimrecurrencebase.ui \ No newline at end of file