summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/opiecore.pro6
-rw-r--r--libopie2/opiecore/xmltree.cpp (renamed from libopie2/opiepim/core/backends/private/xmltree.cc)2
-rw-r--r--libopie2/opiecore/xmltree.h (renamed from libopie2/opiepim/core/backends/private/xmltree.h)4
-rw-r--r--libopie2/opiepim/backend/backends.pro6
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp5
5 files changed, 10 insertions, 13 deletions
diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro
index ff3c036..67ef072 100644
--- a/libopie2/opiecore/opiecore.pro
+++ b/libopie2/opiecore/opiecore.pro
@@ -1,39 +1,41 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on debug 2CONFIG += qt warn_on debug
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = oapplication.h \ 4HEADERS = oapplication.h \
5 oconfig.h \ 5 oconfig.h \
6 odebug.h \ 6 odebug.h \
7 oglobal.h \ 7 oglobal.h \
8 oglobalsettings.h \ 8 oglobalsettings.h \
9 oprocess.h \ 9 oprocess.h \
10 oprocctrl.h \ 10 oprocctrl.h \
11 osmartpointer.h \ 11 osmartpointer.h \
12 ostorageinfo.h 12 ostorageinfo.h \
13 xmltree.h
13 14
14SOURCES = oapplication.cpp \ 15SOURCES = oapplication.cpp \
15 oconfig.cpp \ 16 oconfig.cpp \
16 odebug.cpp \ 17 odebug.cpp \
17 oglobal.cpp \ 18 oglobal.cpp \
18 oglobalsettings.cpp \ 19 oglobalsettings.cpp \
19 oprocess.cpp \ 20 oprocess.cpp \
20 oprocctrl.cpp \ 21 oprocctrl.cpp \
21 ostorageinfo.cpp 22 ostorageinfo.cpp \
23 xmltree.cpp
22 24
23include ( device/device.pro ) 25include ( device/device.pro )
24 26
25INTERFACES = 27INTERFACES =
26TARGET = opiecore2 28TARGET = opiecore2
27VERSION = 1.9.0 29VERSION = 1.9.0
28INCLUDEPATH += $(OPIEDIR)/include 30INCLUDEPATH += $(OPIEDIR)/include
29DEPENDPATH += $(OPIEDIR)/include 31DEPENDPATH += $(OPIEDIR)/include
30 32
31!contains( platform, x11 ) { 33!contains( platform, x11 ) {
32 LIBS = -lqpe 34 LIBS = -lqpe
33 include ( $(OPIEDIR)/include.pro ) 35 include ( $(OPIEDIR)/include.pro )
34} 36}
35 37
36contains( platform, x11 ) { 38contains( platform, x11 ) {
37 LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib 39 LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
38} 40}
39 41
diff --git a/libopie2/opiepim/core/backends/private/xmltree.cc b/libopie2/opiecore/xmltree.cpp
index 40749ca..72fe9fd 100644
--- a/libopie2/opiepim/core/backends/private/xmltree.cc
+++ b/libopie2/opiecore/xmltree.cpp
@@ -4,49 +4,49 @@
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include "xmltree.h" 20#include "xmltree.h"
21 21
22#include <qpe/stringutil.h> 22#include <qpe/stringutil.h>
23 23
24#include <qxml.h> 24#include <qxml.h>
25 25
26#include <assert.h> 26#include <assert.h>
27 27
28using namespace Opie::Pim::Private; 28using namespace Opie::Core;
29 29
30XMLElement::XMLElement() 30XMLElement::XMLElement()
31 : m_parent( 0 ), m_next( 0 ), m_prev( 0 ), m_first( 0 ), m_last( 0 ) 31 : m_parent( 0 ), m_next( 0 ), m_prev( 0 ), m_first( 0 ), m_last( 0 )
32{ 32{
33} 33}
34 34
35XMLElement::~XMLElement() 35XMLElement::~XMLElement()
36{ 36{
37 XMLElement *n = m_first; 37 XMLElement *n = m_first;
38 38
39 while ( n ) 39 while ( n )
40 { 40 {
41 XMLElement *tmp = n; 41 XMLElement *tmp = n;
42 n = n->m_next; 42 n = n->m_next;
43 delete tmp; 43 delete tmp;
44 } 44 }
45} 45}
46 46
47void XMLElement::appendChild( XMLElement *child ) 47void XMLElement::appendChild( XMLElement *child )
48{ 48{
49 if ( child->m_parent ) 49 if ( child->m_parent )
50 child->m_parent->removeChild( child ); 50 child->m_parent->removeChild( child );
51 51
52 child->m_parent = this; 52 child->m_parent = this;
diff --git a/libopie2/opiepim/core/backends/private/xmltree.h b/libopie2/opiecore/xmltree.h
index 9817a02..5fd79e7 100644
--- a/libopie2/opiepim/core/backends/private/xmltree.h
+++ b/libopie2/opiecore/xmltree.h
@@ -5,50 +5,49 @@
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20 20
21#ifndef __bookmarks_h__ 21#ifndef __bookmarks_h__
22#define __bookmarks_h__ 22#define __bookmarks_h__
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qmap.h> 25#include <qmap.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27 27
28namespace Opie { 28namespace Opie {
29namespace Pim { 29namespace Core {
30namespace Private{
31 30
32/** 31/**
33 * A small xml lib written by Simon Hausmann. 32 * A small xml lib written by Simon Hausmann.
34 */ 33 */
35class XMLElement 34class XMLElement
36{ 35{
37public: 36public:
38 typedef QMap<QString, QString> AttributeMap; 37 typedef QMap<QString, QString> AttributeMap;
39 38
40 /** 39 /**
41 * The constructor of XMLElement 40 * The constructor of XMLElement
42 */ 41 */
43 XMLElement(); 42 XMLElement();
44 ~XMLElement(); 43 ~XMLElement();
45 44
46 /** appendChild appends a child to the XMLElement behind the last element. 45 /** appendChild appends a child to the XMLElement behind the last element.
47 * The ownership of the child get's transfered to the 46 * The ownership of the child get's transfered to the
48 * this XMLElement. 47 * this XMLElement.
49 * If child is already the child of another parent 48 * If child is already the child of another parent
50 * it's get removed from the other parent first. 49 * it's get removed from the other parent first.
51 */ 50 */
52 void appendChild( XMLElement *child ); 51 void appendChild( XMLElement *child );
53 52
54 /** inserts newChild after refChild. If newChild is the child 53 /** inserts newChild after refChild. If newChild is the child
@@ -95,28 +94,27 @@ public:
95 XMLElement *namedItem( const QString &name ); 94 XMLElement *namedItem( const QString &name );
96 95
97 XMLElement *clone() const; 96 XMLElement *clone() const;
98 97
99 static XMLElement *load( const QString &fileName ); 98 static XMLElement *load( const QString &fileName );
100 99
101private: 100private:
102 QString m_tag; 101 QString m_tag;
103 QString m_value; 102 QString m_value;
104 AttributeMap m_attributes; 103 AttributeMap m_attributes;
105 104
106 XMLElement *m_parent; 105 XMLElement *m_parent;
107 XMLElement *m_next; 106 XMLElement *m_next;
108 XMLElement *m_prev; 107 XMLElement *m_prev;
109 XMLElement *m_first; 108 XMLElement *m_first;
110 XMLElement *m_last; 109 XMLElement *m_last;
111 110
112 XMLElement( const XMLElement &rhs ); 111 XMLElement( const XMLElement &rhs );
113 XMLElement &operator=( const XMLElement &rhs ); 112 XMLElement &operator=( const XMLElement &rhs );
114 class Private; 113 class Private;
115 Private* d; 114 Private* d;
116}; 115};
117 116
118} 117}
119}
120} // namespace Opie 118} // namespace Opie
121 119
122#endif 120#endif
diff --git a/libopie2/opiepim/backend/backends.pro b/libopie2/opiepim/backend/backends.pro
index d4867ba..953d928 100644
--- a/libopie2/opiepim/backend/backends.pro
+++ b/libopie2/opiepim/backend/backends.pro
@@ -1,33 +1,31 @@
1SOURCES += core/backends/ocontactaccessbackend_sql.cpp \ 1SOURCES += core/backends/ocontactaccessbackend_sql.cpp \
2 core/backends/ocontactaccessbackend_vcard.cpp \ 2 core/backends/ocontactaccessbackend_vcard.cpp \
3 core/backends/ocontactaccessbackend_xml.cpp \ 3 core/backends/ocontactaccessbackend_xml.cpp \
4 core/backends/ocontactaccess.cpp \ 4 core/backends/ocontactaccess.cpp \
5 core/backends/odatebookaccessbackend.cpp \ 5 core/backends/odatebookaccessbackend.cpp \
6 core/backends/odatebookaccessbackend_xml.cpp \ 6 core/backends/odatebookaccessbackend_xml.cpp \
7 core/backends/otodoaccessbackend.cpp \ 7 core/backends/otodoaccessbackend.cpp \
8 core/backends/otodoaccess.cpp \ 8 core/backends/otodoaccess.cpp \
9 core/backends/otodoaccesssql.cpp \ 9 core/backends/otodoaccesssql.cpp \
10 core/backends/otodoaccessvcal.cpp \ 10 core/backends/otodoaccessvcal.cpp \
11 core/backends/otodoaccessxml.cpp \ 11 core/backends/otodoaccessxml.cpp \
12 core/backends/odatebookaccess.cpp \ 12 core/backends/odatebookaccess.cpp \
13 core/backends/odatebookaccessbackend_sql.cpp \ 13 core/backends/odatebookaccessbackend_sql.cpp
14 core/backends/private/xmltree.cc
15 14
16HEADERS += core/backends/obackendfactory.h \ 15HEADERS += core/backends/obackendfactory.h \
17 core/backends/ocontactaccessbackend.h \ 16 core/backends/ocontactaccessbackend.h \
18 core/backends/ocontactaccessbackend_sql.h \ 17 core/backends/ocontactaccessbackend_sql.h \
19 core/backends/ocontactaccessbackend_vcard.h \ 18 core/backends/ocontactaccessbackend_vcard.h \
20 core/backends/ocontactaccessbackend_xml.h \ 19 core/backends/ocontactaccessbackend_xml.h \
21 core/backends/ocontactaccess.h \ 20 core/backends/ocontactaccess.h \
22 core/backends/odatebookaccessbackend.h \ 21 core/backends/odatebookaccessbackend.h \
23 core/backends/odatebookaccessbackend_sql.h \ 22 core/backends/odatebookaccessbackend_sql.h \
24 core/backends/odatebookaccessbackend_xml.h \ 23 core/backends/odatebookaccessbackend_xml.h \
25 core/backends/opimaccessbackend.h \ 24 core/backends/opimaccessbackend.h \
26 core/backends/opimaccesstemplate.h \ 25 core/backends/opimaccesstemplate.h \
27 core/backends/otodoaccessbackend.h \ 26 core/backends/otodoaccessbackend.h \
28 core/backends/otodoaccess.h \ 27 core/backends/otodoaccess.h \
29 core/backends/otodoaccesssql.h \ 28 core/backends/otodoaccesssql.h \
30 core/backends/otodoaccessvcal.h \ 29 core/backends/otodoaccessvcal.h \
31 core/backends/otodoaccessxml.h \ 30 core/backends/otodoaccessxml.h \
32 core/backends/odatebookaccess.h \ 31 core/backends/odatebookaccess.h
33 core/backends/private/xmltree.h
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
index f5e76d5..2b467c3 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
@@ -20,57 +20,56 @@
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 * XML Backend for the OPIE-Contact Database. 30 * XML Backend for the OPIE-Contact Database.
31 */ 31 */
32 32
33#include <opie2/ocontactaccessbackend_xml.h> 33#include <opie2/ocontactaccessbackend_xml.h>
34 34
35#include <qasciidict.h> 35#include <qasciidict.h>
36#include <qfile.h> 36#include <qfile.h>
37#include <qfileinfo.h> 37#include <qfileinfo.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qarray.h> 39#include <qarray.h>
40#include <qmap.h> 40#include <qmap.h>
41 41
42#include <qpe/global.h> 42#include <qpe/global.h>
43 43
44#include "private/xmltree.h" 44#include <opie2/xmltree.h>
45#include <opie2/ocontactaccessbackend.h> 45#include <opie2/ocontactaccessbackend.h>
46#include <opie2/ocontactaccess.h> 46#include <opie2/ocontactaccess.h>
47 47
48#include <stdlib.h> 48#include <stdlib.h>
49#include <errno.h> 49#include <errno.h>
50 50
51using namespace Opie; 51using namespace Opie::Core;
52using namespace Opie::Pim::Private;
53 52
54 53
55namespace Opie { 54namespace Opie {
56OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): 55OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ):
57 m_changed( false ) 56 m_changed( false )
58{ 57{
59 // Just m_contactlist should call delete if an entry 58 // Just m_contactlist should call delete if an entry
60 // is removed. 59 // is removed.
61 m_contactList.setAutoDelete( true ); 60 m_contactList.setAutoDelete( true );
62 m_uidToContact.setAutoDelete( false ); 61 m_uidToContact.setAutoDelete( false );
63 62
64 m_appName = appname; 63 m_appName = appname;
65 64
66 /* Set journalfile name ... */ 65 /* Set journalfile name ... */
67 m_journalName = getenv("HOME"); 66 m_journalName = getenv("HOME");
68 m_journalName +="/.abjournal" + appname; 67 m_journalName +="/.abjournal" + appname;
69 68
70 /* Expecting to access the default filename if nothing else is set */ 69 /* Expecting to access the default filename if nothing else is set */
71 if ( filename.isEmpty() ){ 70 if ( filename.isEmpty() ){
72 m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" ); 71 m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" );
73 } else 72 } else
74 m_fileName = filename; 73 m_fileName = filename;
75 74
76 /* Load Database now */ 75 /* Load Database now */