summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiedb/opiedb.pro3
-rw-r--r--libopie2/opiedb/osqlbackend.cpp7
-rw-r--r--libopie2/opiedb/osqlmanager.cpp7
3 files changed, 14 insertions, 3 deletions
diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro
index e5b1ac9..8432674 100644
--- a/libopie2/opiedb/opiedb.pro
+++ b/libopie2/opiedb/opiedb.pro
@@ -1,34 +1,35 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = osqlbackend.h \ 4HEADERS = osqlbackend.h \
5 osqldriver.h \ 5 osqldriver.h \
6 osqlerror.h \ 6 osqlerror.h \
7 osqlmanager.h \ 7 osqlmanager.h \
8 osqlquery.h \ 8 osqlquery.h \
9 osqlresult.h \ 9 osqlresult.h \
10 osqltable.h \ 10 osqltable.h \
11 osqlbackendmanager.h \ 11 osqlbackendmanager.h \
12 osqlitedriver.h 12 osqlitedriver.h
13
13SOURCES = osqlbackend.cpp \ 14SOURCES = osqlbackend.cpp \
14 osqldriver.cpp \ 15 osqldriver.cpp \
15 osqlerror.cpp \ 16 osqlerror.cpp \
16 osqlmanager.cpp \ 17 osqlmanager.cpp \
17 osqlquery.cpp \ 18 osqlquery.cpp \
18 osqlresult.cpp \ 19 osqlresult.cpp \
19 osqltable.cpp \ 20 osqltable.cpp \
20 osqlbackendmanager.cpp \ 21 osqlbackendmanager.cpp \
21 osqlitedriver.cpp 22 osqlitedriver.cpp
22INTERFACES = 23
23TARGET = opiedb2 24TARGET = opiedb2
24VERSION = 1.9.0 25VERSION = 1.9.0
25INCLUDEPATH = $(OPIEDIR)/include 26INCLUDEPATH = $(OPIEDIR)/include
26DEPENDPATH = $(OPIEDIR)/include 27DEPENDPATH = $(OPIEDIR)/include
27LIBS += -lopiecore2 -lqpe -lsqlite 28LIBS += -lopiecore2 -lqpe -lsqlite
28 29
29!contains( platform, x11 ) { 30!contains( platform, x11 ) {
30 include ( $(OPIEDIR)/include.pro ) 31 include ( $(OPIEDIR)/include.pro )
31} 32}
32 33
33contains( platform, x11 ) { 34contains( platform, x11 ) {
34 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib 35 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
diff --git a/libopie2/opiedb/osqlbackend.cpp b/libopie2/opiedb/osqlbackend.cpp
index 6e5159f..aede7c1 100644
--- a/libopie2/opiedb/osqlbackend.cpp
+++ b/libopie2/opiedb/osqlbackend.cpp
@@ -1,16 +1,17 @@
1 1
2#include "osqlbackend.h" 2#include "osqlbackend.h"
3 3
4using namespace Opie::DB; 4namespace Opie {
5namespace DB {
5 6
6 7
7OSQLBackEnd::OSQLBackEnd( const QString& name, 8OSQLBackEnd::OSQLBackEnd( const QString& name,
8 const QString& vendor, 9 const QString& vendor,
9 const QString& license, 10 const QString& license,
10 const QCString& lib ) 11 const QCString& lib )
11 : m_name( name), m_vendor( vendor), m_license( license ), m_lib( lib ) 12 : m_name( name), m_vendor( vendor), m_license( license ), m_lib( lib )
12{ 13{
13 m_default = false; 14 m_default = false;
14 m_pref = -1; 15 m_pref = -1;
15} 16}
16OSQLBackEnd::OSQLBackEnd( const OSQLBackEnd& back ) { 17OSQLBackEnd::OSQLBackEnd( const OSQLBackEnd& back ) {
@@ -64,12 +65,16 @@ void OSQLBackEnd::setVendor( const QString& vendor ) {
64void OSQLBackEnd::setLicense( const QString & license ) { 65void OSQLBackEnd::setLicense( const QString & license ) {
65 m_license = license; 66 m_license = license;
66} 67}
67void OSQLBackEnd::setLibrary( const QCString& lib ) { 68void OSQLBackEnd::setLibrary( const QCString& lib ) {
68 m_lib = lib; 69 m_lib = lib;
69} 70}
70void OSQLBackEnd::setDefault( bool def) { 71void OSQLBackEnd::setDefault( bool def) {
71 m_default = def; 72 m_default = def;
72} 73}
73void OSQLBackEnd::setPreference( int pref ) { 74void OSQLBackEnd::setPreference( int pref ) {
74 m_pref = pref; 75 m_pref = pref;
75} 76}
77
78
79}
80} \ No newline at end of file
diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp
index a6498df..f093766 100644
--- a/libopie2/opiedb/osqlmanager.cpp
+++ b/libopie2/opiedb/osqlmanager.cpp
@@ -1,20 +1,21 @@
1 1
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include "osqlmanager.h" 4#include "osqlmanager.h"
5#include "osqlbackendmanager.h" 5#include "osqlbackendmanager.h"
6#include "osqlitedriver.h" 6#include "osqlitedriver.h"
7 7
8using namespace Opie::DB; 8namespace Opie {
9namespace DB {
9 10
10OSQLManager::OSQLManager() { 11OSQLManager::OSQLManager() {
11} 12}
12OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { 13OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
13 m_list.clear(); 14 m_list.clear();
14 QString opie = QString::fromLatin1( getenv("OPIEDIR") ); 15 QString opie = QString::fromLatin1( getenv("OPIEDIR") );
15 QString qpe = QString::fromLatin1( getenv("QPEDIR") ); 16 QString qpe = QString::fromLatin1( getenv("QPEDIR") );
16 17
17 if ( !m_path.contains(opie) && !opie.isEmpty() ) 18 if ( !m_path.contains(opie) && !opie.isEmpty() )
18 m_path << opie; 19 m_path << opie;
19 if ( !m_path.contains(qpe) && !qpe.isEmpty() ) 20 if ( !m_path.contains(qpe) && !qpe.isEmpty() )
20 m_path << qpe; 21 m_path << qpe;
@@ -72,12 +73,16 @@ bool OSQLManager::unregisterPath( const QString& path ) {
72 m_path.remove( path ); 73 m_path.remove( path );
73 return true; 74 return true;
74} 75}
75OSQLBackEnd::ValueList OSQLManager::builtIn()const { 76OSQLBackEnd::ValueList OSQLManager::builtIn()const {
76 OSQLBackEnd::ValueList list; 77 OSQLBackEnd::ValueList list;
77 // create the OSQLiteBackend 78 // create the OSQLiteBackend
78 OSQLBackEnd back("SQLite","Opie e.V.","GPL", "builtin" ); 79 OSQLBackEnd back("SQLite","Opie e.V.","GPL", "builtin" );
79 back.setDefault( true ); 80 back.setDefault( true );
80 back.setPreference( 50 ); 81 back.setPreference( 50 );
81 list.append( back ); 82 list.append( back );
82 return list; 83 return list;
83} 84}
85
86
87}
88}