summaryrefslogtreecommitdiff
path: root/libopie2/opiedb
Unidiff
Diffstat (limited to 'libopie2/opiedb') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiedb/osqlbackendmanager.cpp1
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp1
-rw-r--r--libopie2/opiedb/osqlmanager.cpp2
-rw-r--r--libopie2/opiedb/osqlresult.cpp1
4 files changed, 0 insertions, 5 deletions
diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp
index 0f261b9..95ed77b 100644
--- a/libopie2/opiedb/osqlbackendmanager.cpp
+++ b/libopie2/opiedb/osqlbackendmanager.cpp
@@ -1,26 +1,25 @@
1#include <qdir.h> 1#include <qdir.h>
2#include <qfile.h>
3#include <qmap.h> 2#include <qmap.h>
4 3
5#include "osqlbackendmanager.h" 4#include "osqlbackendmanager.h"
6 5
7namespace { 6namespace {
8 class Config { 7 class Config {
9 typedef QMap<QString, QString> List; 8 typedef QMap<QString, QString> List;
10 public: 9 public:
11 Config( const QString& fileName ); 10 Config( const QString& fileName );
12 /** 11 /**
13 * Quite simple layout in nature 12 * Quite simple layout in nature
14 * BeginFile 13 * BeginFile
15 * Key = Value 14 * Key = Value
16 */ 15 */
17 bool load(); 16 bool load();
18 QString value( const QString& key ); 17 QString value( const QString& key );
19 private: 18 private:
20 List m_list; 19 List m_list;
21 QString m_fileName; 20 QString m_fileName;
22 }; 21 };
23 Config::Config( const QString& fileName ) 22 Config::Config( const QString& fileName )
24 : m_fileName( fileName ) { 23 : m_fileName( fileName ) {
25 } 24 }
26 25
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp
index b857534..6141504 100644
--- a/libopie2/opiedb/osqlitedriver.cpp
+++ b/libopie2/opiedb/osqlitedriver.cpp
@@ -7,49 +7,48 @@
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28 28
29*/ 29*/
30 30
31#include "osqlresult.h"
32#include "osqlquery.h" 31#include "osqlquery.h"
33#include "osqlitedriver.h" 32#include "osqlitedriver.h"
34 33
35#include <opie2/odebug.h> 34#include <opie2/odebug.h>
36 35
37#include <stdlib.h> 36#include <stdlib.h>
38 37
39// fromLocal8Bit() does not work as expected. Thus it 38// fromLocal8Bit() does not work as expected. Thus it
40// is replaced by fromLatin1() (eilers) 39// is replaced by fromLatin1() (eilers)
41#define __BUGGY_LOCAL8BIT_ 40#define __BUGGY_LOCAL8BIT_
42 41
43 42
44namespace { 43namespace {
45 struct Query { 44 struct Query {
46 OSQLError::ValueList errors; 45 OSQLError::ValueList errors;
47 OSQLResultItem::ValueList items; 46 OSQLResultItem::ValueList items;
48 OSQLiteDriver *driver; 47 OSQLiteDriver *driver;
49 }; 48 };
50} 49}
51 50
52 51
53OSQLiteDriver::OSQLiteDriver( QLibrary *lib ) 52OSQLiteDriver::OSQLiteDriver( QLibrary *lib )
54 : OSQLDriver( lib ) 53 : OSQLDriver( lib )
55{ 54{
diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp
index b0fea04..766ebe1 100644
--- a/libopie2/opiedb/osqlmanager.cpp
+++ b/libopie2/opiedb/osqlmanager.cpp
@@ -1,29 +1,27 @@
1 1
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include "osqlbackend.h"
5#include "osqldriver.h"
6#include "osqlmanager.h" 4#include "osqlmanager.h"
7#include "osqlbackendmanager.h" 5#include "osqlbackendmanager.h"
8#include "osqlitedriver.h" 6#include "osqlitedriver.h"
9 7
10OSQLManager::OSQLManager() { 8OSQLManager::OSQLManager() {
11} 9}
12OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { 10OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
13 m_list.clear(); 11 m_list.clear();
14 QString opie = QString::fromLatin1( getenv("OPIEDIR") ); 12 QString opie = QString::fromLatin1( getenv("OPIEDIR") );
15 QString qpe = QString::fromLatin1( getenv("QPEDIR") ); 13 QString qpe = QString::fromLatin1( getenv("QPEDIR") );
16 14
17 if ( !m_path.contains(opie) && !opie.isEmpty() ) 15 if ( !m_path.contains(opie) && !opie.isEmpty() )
18 m_path << opie; 16 m_path << opie;
19 if ( !m_path.contains(qpe) && !qpe.isEmpty() ) 17 if ( !m_path.contains(qpe) && !qpe.isEmpty() )
20 m_path << qpe; 18 m_path << qpe;
21 19
22 OSQLBackEndManager mng( m_path ); 20 OSQLBackEndManager mng( m_path );
23 m_list = mng.scan(); 21 m_list = mng.scan();
24 m_list += builtIn(); 22 m_list += builtIn();
25 23
26 return m_list; 24 return m_list;
27} 25}
28/* 26/*
29 * loading dso's is currently not enabled due problems with QLibrary 27 * loading dso's is currently not enabled due problems with QLibrary
diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp
index 490fb45..42da356 100644
--- a/libopie2/opiedb/osqlresult.cpp
+++ b/libopie2/opiedb/osqlresult.cpp
@@ -1,26 +1,25 @@
1 1
2#include "osqlquery.h"
3#include "osqlresult.h" 2#include "osqlresult.h"
4 3
5OSQLResultItem::OSQLResultItem( const TableString& string, 4OSQLResultItem::OSQLResultItem( const TableString& string,
6 const TableInt& Int) 5 const TableInt& Int)
7 : m_string( string ), m_int( Int ) 6 : m_string( string ), m_int( Int )
8{ 7{
9 8
10} 9}
11OSQLResultItem::~OSQLResultItem() { 10OSQLResultItem::~OSQLResultItem() {
12} 11}
13OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) { 12OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) {
14 *this = item; 13 *this = item;
15} 14}
16OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { 15OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) {
17 m_string = other.m_string; 16 m_string = other.m_string;
18 m_int = other.m_int; 17 m_int = other.m_int;
19 return *this; 18 return *this;
20} 19}
21OSQLResultItem::TableString OSQLResultItem::tableString()const{ 20OSQLResultItem::TableString OSQLResultItem::tableString()const{
22 return m_string; 21 return m_string;
23} 22}
24OSQLResultItem::TableInt OSQLResultItem::tableInt()const { 23OSQLResultItem::TableInt OSQLResultItem::tableInt()const {
25 return m_int; 24 return m_int;
26} 25}