summaryrefslogtreecommitdiff
path: root/libopie
Side-by-side diff
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontactaccessbackend_sql.cpp5
-rw-r--r--libopie/pim/ocontactaccessbackend_sql.h10
-rw-r--r--libopie/pim/odatebookaccessbackend_sql.cpp4
-rw-r--r--libopie/pim/odatebookaccessbackend_sql.h7
-rw-r--r--libopie/pim/otodoaccesssql.cpp1
-rw-r--r--libopie/pim/otodoaccesssql.h13
6 files changed, 31 insertions, 9 deletions
diff --git a/libopie/pim/ocontactaccessbackend_sql.cpp b/libopie/pim/ocontactaccessbackend_sql.cpp
index a5be4c8..d20df56 100644
--- a/libopie/pim/ocontactaccessbackend_sql.cpp
+++ b/libopie/pim/ocontactaccessbackend_sql.cpp
@@ -9,16 +9,19 @@
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* =====================================================================
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.5 2004/03/14 13:50:35 alwin
+ * namespace correction
+ *
* Revision 1.4 2003/12/22 10:19:26 eilers
* Finishing implementation of sql-backend for datebook. But I have to
* port the PIM datebook application to use it, before I could debug the
* whole stuff.
* Thus, PIM-Database backend is finished, but highly experimental. And some
* parts are still generic. For instance, the "queryByExample()" methods are
* not (or not fully) implemented. Todo: custom-entries not stored.
* The big show stopper: matchRegExp() (needed by OpieSearch) needs regular
@@ -52,17 +55,17 @@
#include <opie/ocontactfields.h>
#include <opie/oconversion.h>
#include <opie2/osqldriver.h>
#include <opie2/osqlresult.h>
#include <opie2/osqlmanager.h>
#include <opie2/osqlquery.h>
-
+using namespace Opie::DB;
// If defined, we use a horizontal table ( uid, attr1, attr2, attr3, ..., attrn ) instead
// vertical like "uid, type, value".
// DON'T DEACTIVATE THIS DEFINE IN PRODUCTIVE ENVIRONMENTS !!
#define __STORE_HORIZONTAL_
// Distinct loading is not very fast. If I expect that every person has just
diff --git a/libopie/pim/ocontactaccessbackend_sql.h b/libopie/pim/ocontactaccessbackend_sql.h
index b8f1d8d..f553760 100644
--- a/libopie/pim/ocontactaccessbackend_sql.h
+++ b/libopie/pim/ocontactaccessbackend_sql.h
@@ -11,16 +11,19 @@
* =====================================================================
*
*
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.3 2004/03/14 13:50:35 alwin
+ * namespace correction
+ *
* Revision 1.2 2003/12/08 15:18:11 eilers
* Committing unfinished sql implementation before merging to libopie2 starts..
*
* Revision 1.1 2003/09/22 14:31:16 eilers
* Added first experimental incarnation of sql-backend for addressbook.
* Some modifications to be able to compile the todo sql-backend.
* A lot of changes fill follow...
*
@@ -31,20 +34,23 @@
#define _OContactAccessBackend_SQL_
#include "ocontactaccessbackend.h"
#include "ocontactaccess.h"
#include <qlist.h>
#include <qdict.h>
+namespace Opie { namespace DB {
class OSQLDriver;
class OSQLResult;
class OSQLResultItem;
+}}
+
/* the default xml implementation */
/**
* This class is the SQL implementation of a Contact backend
* it does implement everything available for OContact.
* @see OPimAccessBackend for more information of available methods
*/
class OContactAccessBackend_SQL : public OContactAccessBackend {
public:
@@ -80,22 +86,22 @@ class OContactAccessBackend_SQL : public OContactAccessBackend {
bool add ( const OContact &newcontact );
bool replace ( const OContact &contact );
bool remove ( int uid );
bool reload();
private:
- QArray<int> extractUids( OSQLResult& res ) const;
+ QArray<int> extractUids( Opie::DB::OSQLResult& res ) const;
QMap<int, QString> requestNonCustom( int uid ) const;
QMap<QString, QString> requestCustom( int uid ) const;
void update();
protected:
bool m_changed;
QString m_fileName;
QArray<int> m_uids;
- OSQLDriver* m_driver;
+ Opie::DB::OSQLDriver* m_driver;
};
#endif
diff --git a/libopie/pim/odatebookaccessbackend_sql.cpp b/libopie/pim/odatebookaccessbackend_sql.cpp
index 756f405..44dd2bc 100644
--- a/libopie/pim/odatebookaccessbackend_sql.cpp
+++ b/libopie/pim/odatebookaccessbackend_sql.cpp
@@ -9,16 +9,19 @@
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* =====================================================================
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.4 2004/03/14 13:50:35 alwin
+ * namespace correction
+ *
* Revision 1.3 2003/12/22 11:41:39 eilers
* Fixing stupid bug, found by sourcode review..
*
* Revision 1.2 2003/12/22 10:19:26 eilers
* Finishing implementation of sql-backend for datebook. But I have to
* port the PIM datebook application to use it, before I could debug the
* whole stuff.
* Thus, PIM-Database backend is finished, but highly experimental. And some
@@ -45,16 +48,17 @@
#include <opie2/osqldriver.h>
#include <opie2/osqlmanager.h>
#include <opie2/osqlquery.h>
#include "orecur.h"
#include "odatebookaccessbackend_sql.h"
+using namespace Opie::DB;
ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL( const QString& ,
const QString& fileName )
: ODateBookAccessBackend(), m_driver( NULL )
{
m_fileName = fileName.isEmpty() ? Global::applicationFileName( "datebook", "datebook.db" ) : fileName;
diff --git a/libopie/pim/odatebookaccessbackend_sql.h b/libopie/pim/odatebookaccessbackend_sql.h
index f39e154..ba514bc 100644
--- a/libopie/pim/odatebookaccessbackend_sql.h
+++ b/libopie/pim/odatebookaccessbackend_sql.h
@@ -1,18 +1,21 @@
#ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H
#define OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H
#include <qmap.h>
#include <opie2/osqlresult.h>
#include "odatebookaccessbackend.h"
+namespace Opie { namespace DB {
class OSQLDriver;
+}}
+
/**
* This is the default SQL implementation for DateBoook SQL storage
* It fully implements the interface
* @see ODateBookAccessBackend
* @see OPimAccessBackend
*/
class ODateBookAccessBackend_SQL : public ODateBookAccessBackend {
public:
@@ -43,20 +46,20 @@ public:
private:
bool loadFile();
QString m_fileName;
QArray<int> m_uids;
QMap<int, QString> m_fieldMap;
QMap<QString, int> m_reverseFieldMap;
- OSQLDriver* m_driver;
+ Opie::DB::OSQLDriver* m_driver;
class Private;
Private *d;
void initFields();
void update();
- QArray<int> extractUids( OSQLResult& res ) const;
+ QArray<int> extractUids( Opie::DB::OSQLResult& res ) const;
};
#endif
diff --git a/libopie/pim/otodoaccesssql.cpp b/libopie/pim/otodoaccesssql.cpp
index 3764c7e..fd01a42 100644
--- a/libopie/pim/otodoaccesssql.cpp
+++ b/libopie/pim/otodoaccesssql.cpp
@@ -8,16 +8,17 @@
#include <opie2/osqlmanager.h>
#include <opie2/osqlquery.h>
#include "otodoaccesssql.h"
#include "opimstate.h"
#include "opimnotifymanager.h"
#include "orecur.h"
+using namespace Opie::DB;
/*
* first some query
* CREATE query
* LOAD query
* INSERT
* REMOVE
* CLEAR
*/
diff --git a/libopie/pim/otodoaccesssql.h b/libopie/pim/otodoaccesssql.h
index 1c55567..72214de 100644
--- a/libopie/pim/otodoaccesssql.h
+++ b/libopie/pim/otodoaccesssql.h
@@ -1,18 +1,23 @@
#ifndef OPIE_PIM_ACCESS_SQL_H
#define OPIE_PIM_ACCESS_SQL_H
#include <qasciidict.h>
#include "otodoaccessbackend.h"
+namespace Opie{
+namespace DB {
class OSQLDriver;
class OSQLResult;
class OSQLResultItem;
+}
+}
+
class OTodoAccessBackendSQL : public OTodoAccessBackend {
public:
OTodoAccessBackendSQL( const QString& file );
~OTodoAccessBackendSQL();
bool load();
bool reload();
bool save();
@@ -35,22 +40,22 @@ public:
QArray<int> matchRegexp( const QRegExp &r ) const;
void removeAllCompleted();
private:
void update()const;
void fillDict();
inline bool date( QDate& date, const QString& )const;
- inline OTodo todo( const OSQLResult& )const;
- inline OTodo todo( OSQLResultItem& )const;
- inline QArray<int> uids( const OSQLResult& )const;
+ inline OTodo todo( const Opie::DB::OSQLResult& )const;
+ inline OTodo todo( Opie::DB::OSQLResultItem& )const;
+ inline QArray<int> uids( const Opie::DB::OSQLResult& )const;
OTodo todo( int uid )const;
QBitArray sup() const;
QAsciiDict<int> m_dict;
- OSQLDriver* m_driver;
+ Opie::DB::OSQLDriver* m_driver;
QArray<int> m_uids;
bool m_dirty : 1;
};
#endif