-rw-r--r-- | libopie2/opiedb/TODO | 1 | ||||
-rw-r--r-- | libopie2/opiedb/opiedb.pro | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqlbackend.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqlbackend.h | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqlbackendmanager.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqlbackendmanager.h | 6 | ||||
-rw-r--r-- | libopie2/opiedb/osqldriver.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqldriver.h | 7 | ||||
-rw-r--r-- | libopie2/opiedb/osqlerror.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqlerror.h | 5 | ||||
-rw-r--r-- | libopie2/opiedb/osqlitedriver.cpp | 9 | ||||
-rw-r--r-- | libopie2/opiedb/osqlitedriver.h | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqlmanager.cpp | 6 | ||||
-rw-r--r-- | libopie2/opiedb/osqlmanager.h | 6 | ||||
-rw-r--r-- | libopie2/opiedb/osqlquery.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqlquery.h | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqlresult.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqlresult.h | 8 | ||||
-rw-r--r-- | libopie2/opiedb/osqltable.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiedb/osqltable.h | 7 |
20 files changed, 95 insertions, 6 deletions
diff --git a/libopie2/opiedb/TODO b/libopie2/opiedb/TODO index ca04ac6..8b86187 100644 --- a/libopie2/opiedb/TODO +++ b/libopie2/opiedb/TODO @@ -3,6 +3,7 @@ - How to declare INTEGER PRIMARY KEY - Abstract from implementation of some dbs - provides( Type::What ) + - emit signals directly on arriving of data * OSQLDriver DriverVersion - DatabaseVersion * Better OSQLQueries diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro index c773d6c..147435a 100644 --- a/libopie2/opiedb/opiedb.pro +++ b/libopie2/opiedb/opiedb.pro @@ -21,7 +21,7 @@ SOURCES = osqlbackend.cpp \ osqlitedriver.cpp INTERFACES = TARGET = opiedb2 -VERSION = 1.8.2 +VERSION = 1.9.0 INCLUDEPATH = $(OPIEDIR)/include DEPENDPATH = $(OPIEDIR)/include LIBS += -lopiecore2 -lqpe -lsqlite diff --git a/libopie2/opiedb/osqlbackend.cpp b/libopie2/opiedb/osqlbackend.cpp index d6c39a9..6e5159f 100644 --- a/libopie2/opiedb/osqlbackend.cpp +++ b/libopie2/opiedb/osqlbackend.cpp @@ -1,6 +1,8 @@ #include "osqlbackend.h" +using namespace Opie::DB; + OSQLBackEnd::OSQLBackEnd( const QString& name, const QString& vendor, diff --git a/libopie2/opiedb/osqlbackend.h b/libopie2/opiedb/osqlbackend.h index ad879a4..28451b6 100644 --- a/libopie2/opiedb/osqlbackend.h +++ b/libopie2/opiedb/osqlbackend.h @@ -6,6 +6,9 @@ #include <qstring.h> #include <qvaluelist.h> + +namespace Opie { +namespace DB { /** * OSQLBackEnd represents an available backend * to the Opie Database Service @@ -70,6 +73,11 @@ private: QCString m_lib; bool m_default :1; int m_pref; + class Private; + Private *d; }; +} +} + #endif diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp index 95ed77b..fc18e07 100644 --- a/libopie2/opiedb/osqlbackendmanager.cpp +++ b/libopie2/opiedb/osqlbackendmanager.cpp @@ -3,6 +3,10 @@ #include "osqlbackendmanager.h" +/** + * \todo FIXME CONFIG!!! + */ + namespace { class Config { typedef QMap<QString, QString> List; @@ -44,6 +48,10 @@ namespace { return m_list[key]; } }; + + +using namespace Opie::DB; + OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) :m_path( path ) { diff --git a/libopie2/opiedb/osqlbackendmanager.h b/libopie2/opiedb/osqlbackendmanager.h index bc357a9..00e81fc 100644 --- a/libopie2/opiedb/osqlbackendmanager.h +++ b/libopie2/opiedb/osqlbackendmanager.h @@ -5,6 +5,9 @@ #include "osqlbackend.h" +namespace Opie { +namespace DB { + class OSQLBackEndManager { public: OSQLBackEndManager(const QStringList& path ); @@ -17,4 +20,7 @@ private: OSQLBackEndManagerPrivate* d; QStringList m_path; }; +} +} + #endif diff --git a/libopie2/opiedb/osqldriver.cpp b/libopie2/opiedb/osqldriver.cpp index 258c116..a6dae77 100644 --- a/libopie2/opiedb/osqldriver.cpp +++ b/libopie2/opiedb/osqldriver.cpp @@ -2,6 +2,8 @@ #include "osqldriver.h" +using namespace Opie::DB; + OSQLDriver::OSQLDriver( QLibrary* lib ) : QObject(), m_lib(lib) { } diff --git a/libopie2/opiedb/osqldriver.h b/libopie2/opiedb/osqldriver.h index 68d8ee6..492b8dd 100644 --- a/libopie2/opiedb/osqldriver.h +++ b/libopie2/opiedb/osqldriver.h @@ -7,6 +7,10 @@ #include "osqltable.h" class QLibrary; + +namespace Opie { +namespace DB { + class OSQLResult; class OSQLQuery; class OSQLError; @@ -84,4 +88,7 @@ private: }; +} +} + #endif diff --git a/libopie2/opiedb/osqlerror.cpp b/libopie2/opiedb/osqlerror.cpp index 3890a50..165ba65 100644 --- a/libopie2/opiedb/osqlerror.cpp +++ b/libopie2/opiedb/osqlerror.cpp @@ -1,5 +1,7 @@ #include "osqlerror.h" +using namespace Opie::DB; + OSQLError::OSQLError( const QString& driverText, const QString& driverDatabaseText, int type, int subType ) diff --git a/libopie2/opiedb/osqlerror.h b/libopie2/opiedb/osqlerror.h index 35a4368..8fa973d 100644 --- a/libopie2/opiedb/osqlerror.h +++ b/libopie2/opiedb/osqlerror.h @@ -4,6 +4,9 @@ #include <qstring.h> #include <qvaluelist.h> + +namespace Opie { +namespace DB { /** * OSQLError is the base class of all errors */ @@ -56,4 +59,6 @@ private: OSQLErrorPrivate* d; }; +} +} #endif diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index 6141504..47bc250 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp @@ -40,6 +40,9 @@ #define __BUGGY_LOCAL8BIT_ +using namespace Opie::DB; +using namespace Opie::DB::Private; + namespace { struct Query { OSQLError::ValueList errors; @@ -86,7 +89,7 @@ void OSQLiteDriver::setOptions( const QStringList& ) { */ bool OSQLiteDriver::open() { char *error; - odebug << "OSQLiteDriver::open: about to open" << oendl; + qDebug("OSQLiteDriver::open: about to open"); m_sqlite = sqlite_open(m_url.local8Bit(), 0, &error ); @@ -94,7 +97,7 @@ bool OSQLiteDriver::open() { /* failed to open */ if (m_sqlite == 0l ) { // FIXME set the last error - owarn << "OSQLiteDriver::open: " << error << oendl; + qWarning("OSQLiteDriver::open: %s", error ); free( error ); return false; } @@ -126,7 +129,7 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { char *err; /* SQLITE_OK 0 if return code > 0 == failure */ if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { - owarn << "OSQLiteDriver::query: Error while executing" << oendl; + qWarning("OSQLiteDriver::query: Error while executing"); free(err ); // FixMe Errors } diff --git a/libopie2/opiedb/osqlitedriver.h b/libopie2/opiedb/osqlitedriver.h index 6984539..3e1325b 100644 --- a/libopie2/opiedb/osqlitedriver.h +++ b/libopie2/opiedb/osqlitedriver.h @@ -7,6 +7,10 @@ #include "osqlerror.h" #include "osqlresult.h" +namespace Opie { +namespace DB { +namespace Private { + class OSQLiteDriver : public OSQLDriver { Q_OBJECT public: @@ -31,4 +35,8 @@ private: QString m_url; sqlite *m_sqlite; }; +} +} +} + #endif diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp index 766ebe1..990d258 100644 --- a/libopie2/opiedb/osqlmanager.cpp +++ b/libopie2/opiedb/osqlmanager.cpp @@ -5,6 +5,8 @@ #include "osqlbackendmanager.h" #include "osqlitedriver.h" +using namespace Opie::DB; + OSQLManager::OSQLManager() { } OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { @@ -31,7 +33,7 @@ OSQLDriver* OSQLManager::load( const QString& name ) { OSQLDriver* driver = 0l; if ( name == "SQLite" ) { - driver = new OSQLiteDriver(); + driver = new Opie::DB::Private::OSQLiteDriver; } return driver; } @@ -42,7 +44,7 @@ OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { OSQLDriver *driver = 0l; if ( end.library() == "builtin" && end.name() == "SQLite" ) - driver = new OSQLiteDriver(); + driver = new Opie::DB::Private::OSQLiteDriver; return driver; } diff --git a/libopie2/opiedb/osqlmanager.h b/libopie2/opiedb/osqlmanager.h index 5323b14..ca73c64 100644 --- a/libopie2/opiedb/osqlmanager.h +++ b/libopie2/opiedb/osqlmanager.h @@ -8,6 +8,8 @@ #include "osqlbackend.h" +namespace Opie { +namespace DB { /** * OSQLManager is responsible for loading * and unloading, querying different OSQL @@ -59,6 +61,10 @@ private: OSQLBackEnd::ValueList builtIn()const; OSQLBackEnd::ValueList m_list; QStringList m_path; + class Private; + Private *d; }; +} +} #endif diff --git a/libopie2/opiedb/osqlquery.cpp b/libopie2/opiedb/osqlquery.cpp index ecd53f2..8270c4c 100644 --- a/libopie2/opiedb/osqlquery.cpp +++ b/libopie2/opiedb/osqlquery.cpp @@ -1,6 +1,8 @@ #include "osqlquery.h" +using namespace Opie::DB; + OSQLQuery::OSQLQuery() { } OSQLQuery::~OSQLQuery() { diff --git a/libopie2/opiedb/osqlquery.h b/libopie2/opiedb/osqlquery.h index 63c26b0..0265d2b 100644 --- a/libopie2/opiedb/osqlquery.h +++ b/libopie2/opiedb/osqlquery.h @@ -7,6 +7,9 @@ #include <qstring.h> +namespace Opie { +namespace DB { + /** I'm not happy with them class OSQLQueryOrder { public: @@ -47,6 +50,9 @@ public: virtual ~OSQLQuery(); virtual QString query()const = 0; +private: + class Private; + Private *d; }; class OSQLRawQuery : public OSQLQuery { @@ -119,4 +125,6 @@ public: QString query() const; }; */ +} +} #endif diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp index 42da356..bad7d8b 100644 --- a/libopie2/opiedb/osqlresult.cpp +++ b/libopie2/opiedb/osqlresult.cpp @@ -1,6 +1,8 @@ #include "osqlresult.h" +using namespace Opie::DB; + OSQLResultItem::OSQLResultItem( const TableString& string, const TableInt& Int) : m_string( string ), m_int( Int ) diff --git a/libopie2/opiedb/osqlresult.h b/libopie2/opiedb/osqlresult.h index 9c9efa2..fc6f01a 100644 --- a/libopie2/opiedb/osqlresult.h +++ b/libopie2/opiedb/osqlresult.h @@ -7,6 +7,10 @@ #include "osqlerror.h" + +namespace Opie { +namespace DB { + /** * ResultItem represents one row of the resulting answer */ @@ -107,6 +111,10 @@ private: OSQLResultItem::ValueList m_list; OSQLError::ValueList m_error; OSQLResultItem::ValueList::Iterator it; + class Private; + Private *d; }; +} +} #endif diff --git a/libopie2/opiedb/osqltable.cpp b/libopie2/opiedb/osqltable.cpp index cde40f4..117cf21 100644 --- a/libopie2/opiedb/osqltable.cpp +++ b/libopie2/opiedb/osqltable.cpp @@ -1,5 +1,7 @@ #include "osqltable.h" +using namespace Opie::DB; + OSQLTableItem::OSQLTableItem() {} OSQLTableItem::OSQLTableItem( enum Type type, const QString& field, diff --git a/libopie2/opiedb/osqltable.h b/libopie2/opiedb/osqltable.h index 87f7e74..86c30dd 100644 --- a/libopie2/opiedb/osqltable.h +++ b/libopie2/opiedb/osqltable.h @@ -5,6 +5,8 @@ #include <qvaluelist.h> #include <qvariant.h> +namespace Opie { +namespace DB { /** * OSQLTableItem saves one column of a complete * table @@ -90,6 +92,11 @@ public: private: QString m_table; OSQLTableItem::ValueList m_list; + class Private; + Private *d; }; +} +} + #endif |