Diffstat (limited to 'libopie2/opiedb/osqlmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiedb/osqlmanager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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 | |||
@@ -1,19 +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 | ||
8 | using namespace Opie::DB; | ||
9 | |||
8 | OSQLManager::OSQLManager() { | 10 | OSQLManager::OSQLManager() { |
9 | } | 11 | } |
10 | OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { | 12 | OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { |
11 | m_list.clear(); | 13 | m_list.clear(); |
12 | QString opie = QString::fromLatin1( getenv("OPIEDIR") ); | 14 | QString opie = QString::fromLatin1( getenv("OPIEDIR") ); |
13 | QString qpe = QString::fromLatin1( getenv("QPEDIR") ); | 15 | QString qpe = QString::fromLatin1( getenv("QPEDIR") ); |
14 | 16 | ||
15 | if ( !m_path.contains(opie) && !opie.isEmpty() ) | 17 | if ( !m_path.contains(opie) && !opie.isEmpty() ) |
16 | m_path << opie; | 18 | m_path << opie; |
17 | if ( !m_path.contains(qpe) && !qpe.isEmpty() ) | 19 | if ( !m_path.contains(qpe) && !qpe.isEmpty() ) |
18 | m_path << qpe; | 20 | m_path << qpe; |
19 | 21 | ||
@@ -22,36 +24,36 @@ OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { | |||
22 | m_list += builtIn(); | 24 | m_list += builtIn(); |
23 | 25 | ||
24 | return m_list; | 26 | return m_list; |
25 | } | 27 | } |
26 | /* | 28 | /* |
27 | * loading dso's is currently not enabled due problems with QLibrary | 29 | * loading dso's is currently not enabled due problems with QLibrary |
28 | * beeing in libqpe and not libqte | 30 | * beeing in libqpe and not libqte |
29 | */ | 31 | */ |
30 | OSQLDriver* OSQLManager::load( const QString& name ) { | 32 | OSQLDriver* OSQLManager::load( const QString& name ) { |
31 | OSQLDriver* driver = 0l; | 33 | OSQLDriver* driver = 0l; |
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; |
37 | } | 39 | } |
38 | /* | 40 | /* |
39 | * same as above | 41 | * same as above |
40 | */ | 42 | */ |
41 | OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { | 43 | OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { |
42 | OSQLDriver *driver = 0l; | 44 | OSQLDriver *driver = 0l; |
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; |
48 | } | 50 | } |
49 | /* | 51 | /* |
50 | * let's find the a default with the highes preference | 52 | * let's find the a default with the highes preference |
51 | */ | 53 | */ |
52 | OSQLDriver* OSQLManager::standard() { | 54 | OSQLDriver* OSQLManager::standard() { |
53 | OSQLDriver* driver =0l; | 55 | OSQLDriver* driver =0l; |
54 | if ( m_list.isEmpty() ) queryBackEnd(); | 56 | if ( m_list.isEmpty() ) queryBackEnd(); |
55 | OSQLBackEnd::ValueList::Iterator it; | 57 | OSQLBackEnd::ValueList::Iterator it; |
56 | OSQLBackEnd back; | 58 | OSQLBackEnd back; |
57 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | 59 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { |