summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend
authoreilers <eilers>2003-08-01 12:30:16 (UTC)
committer eilers <eilers>2003-08-01 12:30:16 (UTC)
commit6c715b67a8f0e32a4edca5be91332622834c8d91 (patch) (unidiff)
treeae2d660e1fd9c990c2d725c075ce6c42480b0af8 /libopie2/opiepim/backend
parentcb45aa10043fdd6fddcab42ef0e07ddafc3d506d (diff)
downloadopie-6c715b67a8f0e32a4edca5be91332622834c8d91.zip
opie-6c715b67a8f0e32a4edca5be91332622834c8d91.tar.gz
opie-6c715b67a8f0e32a4edca5be91332622834c8d91.tar.bz2
Merging changes from BRANCH_1_0 to HEAD
Diffstat (limited to 'libopie2/opiepim/backend') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/obackendfactory.h12
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend.h14
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp22
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp3
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend.h4
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp6
-rw-r--r--libopie2/opiepim/backend/opimaccessbackend.h4
-rw-r--r--libopie2/opiepim/backend/otodoaccessbackend.h4
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp26
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp6
10 files changed, 90 insertions, 11 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h
index ad6cf5a..f3c339d 100644
--- a/libopie2/opiepim/backend/obackendfactory.h
+++ b/libopie2/opiepim/backend/obackendfactory.h
@@ -16,6 +16,14 @@
16 * ===================================================================== 16 * =====================================================================
17 * History: 17 * History:
18 * $Log$ 18 * $Log$
19 * Revision 1.7 2003/08/01 12:30:16 eilers
20 * Merging changes from BRANCH_1_0 to HEAD
21 *
22 * Revision 1.6.4.1 2003/06/30 14:34:19 eilers
23 * Patches from Zecke:
24 * Fixing and cleaning up extraMap handling
25 * Adding d_ptr for binary compatibility in the future
26 *
19 * Revision 1.6 2003/04/13 18:07:10 zecke 27 * Revision 1.6 2003/04/13 18:07:10 zecke
20 * More API doc 28 * More API doc
21 * QString -> const QString& 29 * QString -> const QString&
@@ -68,6 +76,8 @@
68#include "otodoaccesssql.h" 76#include "otodoaccesssql.h"
69#endif 77#endif
70 78
79class OBackendPrivate;
80
71/** 81/**
72 * This class is our factory. It will give us the default implementations 82 * This class is our factory. It will give us the default implementations
73 * of at least Todolist, Contacts and Datebook. In the future this class will 83 * of at least Todolist, Contacts and Datebook. In the future this class will
@@ -148,6 +158,8 @@ class OBackendFactory
148 158
149 159
150 } 160 }
161 private:
162 OBackendPrivate* d;
151}; 163};
152 164
153 165
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h
index ebeb42d..280e05c 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend.h
+++ b/libopie2/opiepim/backend/ocontactaccessbackend.h
@@ -19,6 +19,14 @@
19 * ===================================================================== 19 * =====================================================================
20 * History: 20 * History:
21 * $Log$ 21 * $Log$
22 * Revision 1.6 2003/08/01 12:30:16 eilers
23 * Merging changes from BRANCH_1_0 to HEAD
24 *
25 * Revision 1.5.4.1 2003/06/30 14:34:19 eilers
26 * Patches from Zecke:
27 * Fixing and cleaning up extraMap handling
28 * Adding d_ptr for binary compatibility in the future
29 *
22 * Revision 1.5 2003/04/13 18:07:10 zecke 30 * Revision 1.5 2003/04/13 18:07:10 zecke
23 * More API doc 31 * More API doc
24 * QString -> const QString& 32 * QString -> const QString&
@@ -102,6 +110,10 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> {
102 * Returns a sorted list of records either ascendinf or descending for a giving criteria and category 110 * Returns a sorted list of records either ascendinf or descending for a giving criteria and category
103 */ 111 */
104 virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0; 112 virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0;
105 113
114
115private:
116 class Private;
117 Private *d;
106}; 118};
107#endif 119#endif
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
index 270bef3..b60c5be 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
@@ -17,6 +17,21 @@
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.11 2003/08/01 12:30:16 eilers
21 * Merging changes from BRANCH_1_0 to HEAD
22 *
23 * Revision 1.10.4.3 2003/07/23 08:54:37 eilers
24 * Default email was added to the list of all emails, which already contains
25 * the default email..
26 * This closes bug #1045
27 *
28 * Revision 1.10.4.2 2003/07/23 08:44:45 eilers
29 * Importing of Notes in vcard files wasn't implemented.
30 * Closes bug #1044
31 *
32 * Revision 1.10.4.1 2003/06/02 13:37:49 eilers
33 * Fixing memory leak
34 *
20 * Revision 1.10 2003/04/13 18:07:10 zecke 35 * Revision 1.10 2003/04/13 18:07:10 zecke
21 * More API doc 36 * More API doc
22 * QString -> const QString& 37 * QString -> const QString&
@@ -151,6 +166,7 @@ bool OContactAccessBackend_VCard::save()
151 cleanVObject( vo ); 166 cleanVObject( vo );
152 } 167 }
153 cleanStrTbl(); 168 cleanStrTbl();
169 deleteVObject( obj );
154 170
155 m_dirty = false; 171 m_dirty = false;
156 return true; 172 return true;
@@ -446,7 +462,9 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
446 c.setBirthday( convVCardDateToDate( value ) ); 462 c.setBirthday( convVCardDateToDate( value ) );
447 463
448 } 464 }
449 465 else if ( name == VCCommentProp ) {
466 c.setNotes( value );
467 }
450#if 0 468#if 0
451 else { 469 else {
452 printf("Name: %s, value=%s\n", name.data(), vObjectStringZValue( o ) ); 470 printf("Name: %s, value=%s\n", name.data(), vObjectStringZValue( o ) );
@@ -534,7 +552,7 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
534 552
535 553
536 QStringList emails = c.emailList(); 554 QStringList emails = c.emailList();
537 emails.prepend( c.defaultEmail() ); 555 // emails.prepend( c.defaultEmail() ); Fix for bugreport #1045
538 for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) { 556 for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
539 VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it ); 557 VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it );
540 safeAddProp( email, VCInternetProp ); 558 safeAddProp( email, VCInternetProp );
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
index 097142b..1c21619 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
@@ -17,6 +17,9 @@
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.7 2003/08/01 12:30:16 eilers
21 * Merging changes from BRANCH_1_0 to HEAD
22 *
20 * Revision 1.6 2003/07/07 16:19:47 eilers 23 * Revision 1.6 2003/07/07 16:19:47 eilers
21 * Fixing serious bug in hasQuerySettings() 24 * Fixing serious bug in hasQuerySettings()
22 * 25 *
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.h b/libopie2/opiepim/backend/odatebookaccessbackend.h
index 86ff298..3c02c42 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend.h
+++ b/libopie2/opiepim/backend/odatebookaccessbackend.h
@@ -68,6 +68,10 @@ public:
68 */ 68 */
69 virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start ); 69 virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start );
70 70
71private:
72 class Private;
73 Private *d;
74
71}; 75};
72 76
73#endif 77#endif
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index ab2eea4..5ea945c 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -430,9 +430,9 @@ bool ODateBookAccessBackend_XML::loadFile() {
430 */ 430 */
431 find = dict[attr.data()]; 431 find = dict[attr.data()];
432 if (!find) 432 if (!find)
433 ev.setCustomField( attr, value ); 433 ev.setCustomField( attr, str );
434 else { 434 else {
435 setField( ev, *find, value ); 435 setField( ev, *find, str );
436 } 436 }
437 } 437 }
438 /* time to finalize */ 438 /* time to finalize */
@@ -453,7 +453,7 @@ void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) {
453 ev.setTimeZone( "UTC"); // make sure it is really utc 453 ev.setTimeZone( "UTC"); // make sure it is really utc
454 }else { 454 }else {
455 /* to current date time */ 455 /* to current date time */
456 qWarning(" Start is %d", start ); 456 // qWarning(" Start is %d", start );
457 OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); 457 OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() );
458 QDateTime date = zone.toDateTime( start ); 458 QDateTime date = zone.toDateTime( start );
459 qWarning(" Start is %s", date.toString().latin1() ); 459 qWarning(" Start is %s", date.toString().latin1() );
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h
index f4bbe35..c3d91f7 100644
--- a/libopie2/opiepim/backend/opimaccessbackend.h
+++ b/libopie2/opiepim/backend/opimaccessbackend.h
@@ -7,6 +7,7 @@
7#include <opie/opimrecord.h> 7#include <opie/opimrecord.h>
8 8
9 9
10class OPimAccessBackendPrivate;
10/** 11/**
11 * OPimAccessBackend is the base class 12 * OPimAccessBackend is the base class
12 * for all private backends 13 * for all private backends
@@ -107,8 +108,7 @@ protected:
107 uint readAhead()const; 108 uint readAhead()const;
108 109
109private: 110private:
110 class Private; 111 OPimAccessBackendPrivate *d;
111 Private* d;
112 Frontend* m_front; 112 Frontend* m_front;
113 uint m_read; 113 uint m_read;
114 int m_acc; 114 int m_acc;
diff --git a/libopie2/opiepim/backend/otodoaccessbackend.h b/libopie2/opiepim/backend/otodoaccessbackend.h
index 05e8ca9..6be95bc 100644
--- a/libopie2/opiepim/backend/otodoaccessbackend.h
+++ b/libopie2/opiepim/backend/otodoaccessbackend.h
@@ -18,6 +18,10 @@ public:
18 int cat ) = 0; 18 int cat ) = 0;
19 virtual void removeAllCompleted() = 0; 19 virtual void removeAllCompleted() = 0;
20 virtual QBitArray supports()const = 0; 20 virtual QBitArray supports()const = 0;
21
22private:
23 class Private;
24 Private *d;
21 25
22}; 26};
23 27
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp
index 3577e14..6415952 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.cpp
+++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp
@@ -15,12 +15,20 @@ namespace {
15 // description 15 // description
16 if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){ 16 if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){
17 name = vObjectStringZValue( ob ); 17 name = vObjectStringZValue( ob );
18#if 0
18 event.setDescription( name ); 19 event.setDescription( name );
20#else
21 event.setSummary( name );
22#endif
19 } 23 }
20 // summary 24 // summary
21 if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) { 25 if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) {
22 name = vObjectStringZValue( ob ); 26 name = vObjectStringZValue( ob );
27#if 0
23 event.setSummary( name ); 28 event.setSummary( name );
29#else
30 event.setDescription( name );
31#endif
24 } 32 }
25 // completed 33 // completed
26 if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){ 34 if( ( ob = isAPropertyOf( obj, VCStatusProp )) != 0 ){
@@ -74,11 +82,27 @@ namespace {
74 addPropValue( task, VCCategoriesProp, 82 addPropValue( task, VCCategoriesProp,
75 event.idsToString( event.categories() ).local8Bit() ); 83 event.idsToString( event.categories() ).local8Bit() );
76 84
85#if 0
86
87 // There seems a misrepresentation between summary in otodoevent
88 // and summary in vcard.
89 // The same with description..
90 // Description is summary and vice versa.. Argh.. (eilers)
91
92
77 addPropValue( task, VCDescriptionProp, 93 addPropValue( task, VCDescriptionProp,
78 event.description().local8Bit() ); 94 event.description().local8Bit() );
79 95
80 addPropValue( task, VCSummaryProp, 96 addPropValue( task, VCSummaryProp,
81 event.summary().local8Bit() ); 97 event.summary().local8Bit() );
98
99#else
100 addPropValue( task, VCDescriptionProp,
101 event.summary().local8Bit() );
102
103 addPropValue( task, VCSummaryProp,
104 event.description().local8Bit() );
105#endif
82 return task; 106 return task;
83}; 107};
84} 108}
@@ -185,7 +209,7 @@ QArray<int> OTodoAccessVCal::allRecords()const {
185 } 209 }
186 return ar; 210 return ar;
187} 211}
188QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp &r)const { 212QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp& /* r */)const {
189 QArray<int> ar(0); 213 QArray<int> ar(0);
190 return ar; 214 return ar;
191} 215}
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp
index 3d15354..f688735 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.cpp
+++ b/libopie2/opiepim/backend/otodoaccessxml.cpp
@@ -87,7 +87,7 @@ bool OTodoAccessXML::load() {
87 /* 87 /*
88 * UPDATE dict if you change anything!!! 88 * UPDATE dict if you change anything!!!
89 */ 89 */
90 QAsciiDict<int> dict(21); 90 QAsciiDict<int> dict(26);
91 dict.setAutoDelete( TRUE ); 91 dict.setAutoDelete( TRUE );
92 dict.insert("Categories" , new int(OTodo::Category) ); 92 dict.insert("Categories" , new int(OTodo::Category) );
93 dict.insert("Uid" , new int(OTodo::Uid) ); 93 dict.insert("Uid" , new int(OTodo::Uid) );
@@ -836,10 +836,12 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder,
836 return array; 836 return array;
837}; 837};
838void OTodoAccessXML::removeAllCompleted() { 838void OTodoAccessXML::removeAllCompleted() {
839 QMap<int, OTodo> events = m_events;
839 for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { 840 for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) {
840 if ( (*it).isCompleted() ) 841 if ( (*it).isCompleted() )
841 m_events.remove( it ); 842 events.remove( it.key() );
842 } 843 }
844 m_events = events;
843} 845}
844QBitArray OTodoAccessXML::supports()const { 846QBitArray OTodoAccessXML::supports()const {
845 static QBitArray ar = sup(); 847 static QBitArray ar = sup();