-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 | |||
@@ -4,4 +4,5 @@ | |||
4 | - Abstract from implementation of some dbs | 4 | - Abstract from implementation of some dbs |
5 | - provides( Type::What ) | 5 | - provides( Type::What ) |
6 | - emit signals directly on arriving of data | ||
6 | 7 | ||
7 | * OSQLDriver DriverVersion - DatabaseVersion | 8 | * OSQLDriver DriverVersion - DatabaseVersion |
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 | |||
@@ -22,5 +22,5 @@ SOURCES = osqlbackend.cpp \ | |||
22 | INTERFACES = | 22 | INTERFACES = |
23 | TARGET = opiedb2 | 23 | TARGET = opiedb2 |
24 | VERSION = 1.8.2 | 24 | VERSION = 1.9.0 |
25 | INCLUDEPATH = $(OPIEDIR)/include | 25 | INCLUDEPATH = $(OPIEDIR)/include |
26 | DEPENDPATH = $(OPIEDIR)/include | 26 | DEPENDPATH = $(OPIEDIR)/include |
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 | |||
@@ -2,4 +2,6 @@ | |||
2 | #include "osqlbackend.h" | 2 | #include "osqlbackend.h" |
3 | 3 | ||
4 | using namespace Opie::DB; | ||
5 | |||
4 | 6 | ||
5 | OSQLBackEnd::OSQLBackEnd( const QString& name, | 7 | OSQLBackEnd::OSQLBackEnd( const QString& name, |
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 | |||
@@ -7,4 +7,7 @@ | |||
7 | #include <qvaluelist.h> | 7 | #include <qvaluelist.h> |
8 | 8 | ||
9 | |||
10 | namespace Opie { | ||
11 | namespace DB { | ||
9 | /** | 12 | /** |
10 | * OSQLBackEnd represents an available backend | 13 | * OSQLBackEnd represents an available backend |
@@ -71,5 +74,10 @@ private: | |||
71 | bool m_default :1; | 74 | bool m_default :1; |
72 | int m_pref; | 75 | int m_pref; |
76 | class Private; | ||
77 | Private *d; | ||
73 | }; | 78 | }; |
74 | 79 | ||
80 | } | ||
81 | } | ||
82 | |||
75 | #endif | 83 | #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 | |||
@@ -4,4 +4,8 @@ | |||
4 | #include "osqlbackendmanager.h" | 4 | #include "osqlbackendmanager.h" |
5 | 5 | ||
6 | /** | ||
7 | * \todo FIXME CONFIG!!! | ||
8 | */ | ||
9 | |||
6 | namespace { | 10 | namespace { |
7 | class Config { | 11 | class Config { |
@@ -45,4 +49,8 @@ namespace { | |||
45 | } | 49 | } |
46 | }; | 50 | }; |
51 | |||
52 | |||
53 | using namespace Opie::DB; | ||
54 | |||
47 | OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) | 55 | OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) |
48 | :m_path( path ) | 56 | :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 | |||
@@ -6,4 +6,7 @@ | |||
6 | #include "osqlbackend.h" | 6 | #include "osqlbackend.h" |
7 | 7 | ||
8 | namespace Opie { | ||
9 | namespace DB { | ||
10 | |||
8 | class OSQLBackEndManager { | 11 | class OSQLBackEndManager { |
9 | public: | 12 | public: |
@@ -18,3 +21,6 @@ private: | |||
18 | QStringList m_path; | 21 | QStringList m_path; |
19 | }; | 22 | }; |
23 | } | ||
24 | } | ||
25 | |||
20 | #endif | 26 | #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 | |||
@@ -3,4 +3,6 @@ | |||
3 | #include "osqldriver.h" | 3 | #include "osqldriver.h" |
4 | 4 | ||
5 | using namespace Opie::DB; | ||
6 | |||
5 | OSQLDriver::OSQLDriver( QLibrary* lib ) | 7 | OSQLDriver::OSQLDriver( QLibrary* lib ) |
6 | : QObject(), m_lib(lib) { | 8 | : 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 | |||
@@ -8,4 +8,8 @@ | |||
8 | 8 | ||
9 | class QLibrary; | 9 | class QLibrary; |
10 | |||
11 | namespace Opie { | ||
12 | namespace DB { | ||
13 | |||
10 | class OSQLResult; | 14 | class OSQLResult; |
11 | class OSQLQuery; | 15 | class OSQLQuery; |
@@ -85,3 +89,6 @@ private: | |||
85 | }; | 89 | }; |
86 | 90 | ||
91 | } | ||
92 | } | ||
93 | |||
87 | #endif | 94 | #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,4 +1,6 @@ | |||
1 | #include "osqlerror.h" | 1 | #include "osqlerror.h" |
2 | 2 | ||
3 | using namespace Opie::DB; | ||
4 | |||
3 | OSQLError::OSQLError( const QString& driverText, | 5 | OSQLError::OSQLError( const QString& driverText, |
4 | const QString& driverDatabaseText, | 6 | const QString& 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 | |||
@@ -5,4 +5,7 @@ | |||
5 | #include <qvaluelist.h> | 5 | #include <qvaluelist.h> |
6 | 6 | ||
7 | |||
8 | namespace Opie { | ||
9 | namespace DB { | ||
7 | /** | 10 | /** |
8 | * OSQLError is the base class of all errors | 11 | * OSQLError is the base class of all errors |
@@ -57,3 +60,5 @@ private: | |||
57 | }; | 60 | }; |
58 | 61 | ||
62 | } | ||
63 | } | ||
59 | #endif | 64 | #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 | |||
@@ -41,4 +41,7 @@ | |||
41 | 41 | ||
42 | 42 | ||
43 | using namespace Opie::DB; | ||
44 | using namespace Opie::DB::Private; | ||
45 | |||
43 | namespace { | 46 | namespace { |
44 | struct Query { | 47 | struct Query { |
@@ -87,5 +90,5 @@ void OSQLiteDriver::setOptions( const QStringList& ) { | |||
87 | bool OSQLiteDriver::open() { | 90 | bool OSQLiteDriver::open() { |
88 | char *error; | 91 | char *error; |
89 | odebug << "OSQLiteDriver::open: about to open" << oendl; | 92 | qDebug("OSQLiteDriver::open: about to open"); |
90 | m_sqlite = sqlite_open(m_url.local8Bit(), | 93 | m_sqlite = sqlite_open(m_url.local8Bit(), |
91 | 0, | 94 | 0, |
@@ -95,5 +98,5 @@ bool OSQLiteDriver::open() { | |||
95 | if (m_sqlite == 0l ) { | 98 | if (m_sqlite == 0l ) { |
96 | // FIXME set the last error | 99 | // FIXME set the last error |
97 | owarn << "OSQLiteDriver::open: " << error << oendl; | 100 | qWarning("OSQLiteDriver::open: %s", error ); |
98 | free( error ); | 101 | free( error ); |
99 | return false; | 102 | return false; |
@@ -127,5 +130,5 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { | |||
127 | /* SQLITE_OK 0 if return code > 0 == failure */ | 130 | /* SQLITE_OK 0 if return code > 0 == failure */ |
128 | if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { | 131 | if ( sqlite_exec(m_sqlite, qu->query(),&call_back, &query, &err) > 0 ) { |
129 | owarn << "OSQLiteDriver::query: Error while executing" << oendl; | 132 | qWarning("OSQLiteDriver::query: Error while executing"); |
130 | free(err ); | 133 | free(err ); |
131 | // FixMe Errors | 134 | // 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 | |||
@@ -8,4 +8,8 @@ | |||
8 | #include "osqlresult.h" | 8 | #include "osqlresult.h" |
9 | 9 | ||
10 | namespace Opie { | ||
11 | namespace DB { | ||
12 | namespace Private { | ||
13 | |||
10 | class OSQLiteDriver : public OSQLDriver { | 14 | class OSQLiteDriver : public OSQLDriver { |
11 | Q_OBJECT | 15 | Q_OBJECT |
@@ -32,3 +36,7 @@ private: | |||
32 | sqlite *m_sqlite; | 36 | sqlite *m_sqlite; |
33 | }; | 37 | }; |
38 | } | ||
39 | } | ||
40 | } | ||
41 | |||
34 | #endif | 42 | #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 | |||
@@ -6,4 +6,6 @@ | |||
6 | #include "osqlitedriver.h" | 6 | #include "osqlitedriver.h" |
7 | 7 | ||
8 | using namespace Opie::DB; | ||
9 | |||
8 | OSQLManager::OSQLManager() { | 10 | OSQLManager::OSQLManager() { |
9 | } | 11 | } |
@@ -32,5 +34,5 @@ OSQLDriver* OSQLManager::load( const QString& name ) { | |||
32 | 34 | ||
33 | if ( name == "SQLite" ) { | 35 | if ( name == "SQLite" ) { |
34 | driver = new OSQLiteDriver(); | 36 | driver = new Opie::DB::Private::OSQLiteDriver; |
35 | } | 37 | } |
36 | return driver; | 38 | return driver; |
@@ -43,5 +45,5 @@ OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { | |||
43 | if ( end.library() == "builtin" && | 45 | if ( end.library() == "builtin" && |
44 | end.name() == "SQLite" ) | 46 | end.name() == "SQLite" ) |
45 | driver = new OSQLiteDriver(); | 47 | driver = new Opie::DB::Private::OSQLiteDriver; |
46 | 48 | ||
47 | return driver; | 49 | 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 | |||
@@ -9,4 +9,6 @@ | |||
9 | 9 | ||
10 | 10 | ||
11 | namespace Opie { | ||
12 | namespace DB { | ||
11 | /** | 13 | /** |
12 | * OSQLManager is responsible for loading | 14 | * OSQLManager is responsible for loading |
@@ -60,5 +62,9 @@ private: | |||
60 | OSQLBackEnd::ValueList m_list; | 62 | OSQLBackEnd::ValueList m_list; |
61 | QStringList m_path; | 63 | QStringList m_path; |
64 | class Private; | ||
65 | Private *d; | ||
62 | }; | 66 | }; |
67 | } | ||
68 | } | ||
63 | 69 | ||
64 | #endif | 70 | #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 | |||
@@ -2,4 +2,6 @@ | |||
2 | #include "osqlquery.h" | 2 | #include "osqlquery.h" |
3 | 3 | ||
4 | using namespace Opie::DB; | ||
5 | |||
4 | OSQLQuery::OSQLQuery() { | 6 | OSQLQuery::OSQLQuery() { |
5 | } | 7 | } |
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 | |||
@@ -8,4 +8,7 @@ | |||
8 | 8 | ||
9 | 9 | ||
10 | namespace Opie { | ||
11 | namespace DB { | ||
12 | |||
10 | /** I'm not happy with them | 13 | /** I'm not happy with them |
11 | class OSQLQueryOrder { | 14 | class OSQLQueryOrder { |
@@ -48,4 +51,7 @@ public: | |||
48 | 51 | ||
49 | virtual QString query()const = 0; | 52 | virtual QString query()const = 0; |
53 | private: | ||
54 | class Private; | ||
55 | Private *d; | ||
50 | }; | 56 | }; |
51 | 57 | ||
@@ -120,3 +126,5 @@ public: | |||
120 | }; | 126 | }; |
121 | */ | 127 | */ |
128 | } | ||
129 | } | ||
122 | #endif | 130 | #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 | |||
@@ -2,4 +2,6 @@ | |||
2 | #include "osqlresult.h" | 2 | #include "osqlresult.h" |
3 | 3 | ||
4 | using namespace Opie::DB; | ||
5 | |||
4 | OSQLResultItem::OSQLResultItem( const TableString& string, | 6 | OSQLResultItem::OSQLResultItem( const TableString& string, |
5 | const TableInt& Int) | 7 | const TableInt& 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 | |||
@@ -8,4 +8,8 @@ | |||
8 | 8 | ||
9 | #include "osqlerror.h" | 9 | #include "osqlerror.h" |
10 | |||
11 | namespace Opie { | ||
12 | namespace DB { | ||
13 | |||
10 | /** | 14 | /** |
11 | * ResultItem represents one row of the resulting answer | 15 | * ResultItem represents one row of the resulting answer |
@@ -108,5 +112,9 @@ private: | |||
108 | OSQLError::ValueList m_error; | 112 | OSQLError::ValueList m_error; |
109 | OSQLResultItem::ValueList::Iterator it; | 113 | OSQLResultItem::ValueList::Iterator it; |
114 | class Private; | ||
115 | Private *d; | ||
110 | }; | 116 | }; |
111 | 117 | ||
118 | } | ||
119 | } | ||
112 | #endif | 120 | #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,4 +1,6 @@ | |||
1 | #include "osqltable.h" | 1 | #include "osqltable.h" |
2 | 2 | ||
3 | using namespace Opie::DB; | ||
4 | |||
3 | OSQLTableItem::OSQLTableItem() {} | 5 | OSQLTableItem::OSQLTableItem() {} |
4 | OSQLTableItem::OSQLTableItem( enum Type type, | 6 | OSQLTableItem::OSQLTableItem( enum Type type, |
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 | |||
@@ -6,4 +6,6 @@ | |||
6 | #include <qvariant.h> | 6 | #include <qvariant.h> |
7 | 7 | ||
8 | namespace Opie { | ||
9 | namespace DB { | ||
8 | /** | 10 | /** |
9 | * OSQLTableItem saves one column of a complete | 11 | * OSQLTableItem saves one column of a complete |
@@ -91,5 +93,10 @@ private: | |||
91 | QString m_table; | 93 | QString m_table; |
92 | OSQLTableItem::ValueList m_list; | 94 | OSQLTableItem::ValueList m_list; |
95 | class Private; | ||
96 | Private *d; | ||
93 | }; | 97 | }; |
94 | 98 | ||
99 | } | ||
100 | } | ||
101 | |||
95 | #endif | 102 | #endif |