summaryrefslogtreecommitdiff
path: root/libopie2/opiedb
Side-by-side diff
Diffstat (limited to 'libopie2/opiedb') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiedb/TODO1
-rw-r--r--libopie2/opiedb/opiedb.pro2
-rw-r--r--libopie2/opiedb/osqlbackend.cpp2
-rw-r--r--libopie2/opiedb/osqlbackend.h8
-rw-r--r--libopie2/opiedb/osqlbackendmanager.cpp8
-rw-r--r--libopie2/opiedb/osqlbackendmanager.h6
-rw-r--r--libopie2/opiedb/osqldriver.cpp2
-rw-r--r--libopie2/opiedb/osqldriver.h7
-rw-r--r--libopie2/opiedb/osqlerror.cpp2
-rw-r--r--libopie2/opiedb/osqlerror.h5
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp9
-rw-r--r--libopie2/opiedb/osqlitedriver.h8
-rw-r--r--libopie2/opiedb/osqlmanager.cpp6
-rw-r--r--libopie2/opiedb/osqlmanager.h6
-rw-r--r--libopie2/opiedb/osqlquery.cpp2
-rw-r--r--libopie2/opiedb/osqlquery.h8
-rw-r--r--libopie2/opiedb/osqlresult.cpp2
-rw-r--r--libopie2/opiedb/osqlresult.h8
-rw-r--r--libopie2/opiedb/osqltable.cpp2
-rw-r--r--libopie2/opiedb/osqltable.h7
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
@@ -2,8 +2,9 @@
- ROWID
- 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
- more than OSQLRawQuery \ No newline at end of file
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
@@ -20,9 +20,9 @@ SOURCES = osqlbackend.cpp \
osqlbackendmanager.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,7 +1,9 @@
#include "osqlbackend.h"
+using namespace Opie::DB;
+
OSQLBackEnd::OSQLBackEnd( const QString& name,
const QString& vendor,
const QString& license,
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
@@ -5,8 +5,11 @@
#include <qcstring.h>
#include <qstring.h>
#include <qvaluelist.h>
+
+namespace Opie {
+namespace DB {
/**
* OSQLBackEnd represents an available backend
* to the Opie Database Service
* It's used to easily extend OSQL services by
@@ -69,7 +72,12 @@ private:
QString m_license;
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
@@ -2,8 +2,12 @@
#include <qmap.h>
#include "osqlbackendmanager.h"
+/**
+ * \todo FIXME CONFIG!!!
+ */
+
namespace {
class Config {
typedef QMap<QString, QString> List;
public:
@@ -43,8 +47,12 @@ namespace {
QString Config::value( const QString& key ) {
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
@@ -4,8 +4,11 @@
#include <qstringlist.h>
#include "osqlbackend.h"
+namespace Opie {
+namespace DB {
+
class OSQLBackEndManager {
public:
OSQLBackEndManager(const QStringList& path );
~OSQLBackEndManager();
@@ -16,5 +19,8 @@ private:
class OSQLBackEndManagerPrivate;
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
@@ -1,8 +1,10 @@
#include <qpe/qlibrary.h>
#include "osqldriver.h"
+using namespace Opie::DB;
+
OSQLDriver::OSQLDriver( QLibrary* lib )
: QObject(), m_lib(lib) {
}
OSQLDriver::~OSQLDriver() {
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
@@ -6,8 +6,12 @@
#include "osqltable.h"
class QLibrary;
+
+namespace Opie {
+namespace DB {
+
class OSQLResult;
class OSQLQuery;
class OSQLError;
@@ -83,5 +87,8 @@ private:
OSQLDriverPrivate *d;
};
+}
+}
+
#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,6 +1,8 @@
#include "osqlerror.h"
+using namespace Opie::DB;
+
OSQLError::OSQLError( const QString& driverText,
const QString& driverDatabaseText,
int type, int subType )
: m_drvText( driverText ), m_drvDBText( driverDatabaseText ),
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
@@ -3,8 +3,11 @@
#include <qstring.h>
#include <qvaluelist.h>
+
+namespace Opie {
+namespace DB {
/**
* OSQLError is the base class of all errors
*/
class OSQLError {
@@ -55,5 +58,7 @@ private:
class OSQLErrorPrivate;
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
@@ -39,8 +39,11 @@
// is replaced by fromLatin1() (eilers)
#define __BUGGY_LOCAL8BIT_
+using namespace Opie::DB;
+using namespace Opie::DB::Private;
+
namespace {
struct Query {
OSQLError::ValueList errors;
OSQLResultItem::ValueList items;
@@ -85,17 +88,17 @@ void OSQLiteDriver::setOptions( const QStringList& ) {
* and options
*/
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 );
/* 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;
}
return true;
@@ -125,9 +128,9 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) {
query.driver = this;
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
@@ -6,8 +6,12 @@
#include "osqldriver.h"
#include "osqlerror.h"
#include "osqlresult.h"
+namespace Opie {
+namespace DB {
+namespace Private {
+
class OSQLiteDriver : public OSQLDriver {
Q_OBJECT
public:
OSQLiteDriver( QLibrary *lib = 0l );
@@ -30,5 +34,9 @@ private:
static int call_back( void*, int, char**, char** );
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
@@ -4,8 +4,10 @@
#include "osqlmanager.h"
#include "osqlbackendmanager.h"
#include "osqlitedriver.h"
+using namespace Opie::DB;
+
OSQLManager::OSQLManager() {
}
OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
m_list.clear();
@@ -30,9 +32,9 @@ OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
OSQLDriver* OSQLManager::load( const QString& name ) {
OSQLDriver* driver = 0l;
if ( name == "SQLite" ) {
- driver = new OSQLiteDriver();
+ driver = new Opie::DB::Private::OSQLiteDriver;
}
return driver;
}
/*
@@ -41,9 +43,9 @@ OSQLDriver* OSQLManager::load( const QString& name ) {
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
@@ -7,8 +7,10 @@
#include "osqlbackend.h"
+namespace Opie {
+namespace DB {
/**
* OSQLManager is responsible for loading
* and unloading, querying different OSQL
* services
@@ -58,7 +60,11 @@ public:
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,7 +1,9 @@
#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
@@ -6,8 +6,11 @@
#include <qvaluelist.h>
#include <qstring.h>
+namespace Opie {
+namespace DB {
+
/** I'm not happy with them
class OSQLQueryOrder {
public:
typedef QValueList<OSQLQueryOrder> ValueList;
@@ -46,8 +49,11 @@ public:
OSQLQuery();
virtual ~OSQLQuery();
virtual QString query()const = 0;
+private:
+ class Private;
+ Private *d;
};
class OSQLRawQuery : public OSQLQuery {
public:
@@ -118,5 +124,7 @@ public:
void setValue( const QMap<QString, QString> &fields );
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,7 +1,9 @@
#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
@@ -6,8 +6,12 @@
#include <qvaluelist.h>
#include "osqlerror.h"
+
+namespace Opie {
+namespace DB {
+
/**
* ResultItem represents one row of the resulting answer
*/
class OSQLResultItem {
@@ -106,7 +110,11 @@ private:
enum State m_state;
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,6 +1,8 @@
#include "osqltable.h"
+using namespace Opie::DB;
+
OSQLTableItem::OSQLTableItem() {}
OSQLTableItem::OSQLTableItem( enum Type type,
const QString& field,
const QVariant& var)
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
@@ -4,8 +4,10 @@
#include <qstring.h>
#include <qvaluelist.h>
#include <qvariant.h>
+namespace Opie {
+namespace DB {
/**
* OSQLTableItem saves one column of a complete
* table
*/
@@ -89,7 +91,12 @@ public:
private:
QString m_table;
OSQLTableItem::ValueList m_list;
+ class Private;
+ Private *d;
};
+}
+}
+
#endif