By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 1942
Collapse All | Expand All

(-)a/plugins/src/sqldrivers/sqldrivers.pro (+1 lines)
Lines 7-10 contains(sql-plugins, tds) : SUBDIRS += tds Link Here
7
contains(sql-plugins, oci)	: SUBDIRS += oci
7
contains(sql-plugins, oci)	: SUBDIRS += oci
8
contains(sql-plugins, db2)	: SUBDIRS += db2
8
contains(sql-plugins, db2)	: SUBDIRS += db2
9
contains(sql-plugins, sqlite)	: SUBDIRS += sqlite
9
contains(sql-plugins, sqlite)	: SUBDIRS += sqlite
10
contains(sql-plugins, sqlite)	: SUBDIRS += sqlite3
10
contains(sql-plugins, ibase)	: SUBDIRS += ibase
11
contains(sql-plugins, ibase)	: SUBDIRS += ibase
(-)a/plugins/src/sqldrivers/sqlite3/smain.cpp (+70 lines)
Line 0 Link Here
1
/****************************************************************************
2
**
3
** Implementation of SQLite driver plugin
4
**
5
** Created : 031106
6
**
7
** Copyright (C) 1992-2003 Trolltech AS.  All rights reserved.
8
**
9
** This file is part of the sql module of the TQt GUI Toolkit.
10
**
11
** This file may be distributed under the terms of the Q Public License
12
** as defined by Trolltech AS of Norway and appearing in the file
13
** LICENSE.TQPL included in the packaging of this file.
14
**
15
** This file may be distributed and/or modified under the terms of the
16
** GNU General Public License version 2 as published by the Free Software
17
** Foundation and appearing in the file LICENSE.GPL included in the
18
** packaging of this file.
19
**
20
** Licensees holding valid TQt Enterprise Edition licenses may use this
21
** file in accordance with the TQt Commercial License Agreement provided
22
** with the Software.
23
**
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26
**
27
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
28
**   information about TQt Commercial License Agreements.
29
** See http://www.trolltech.com/qpl/ for TQPL licensing information.
30
** See http://www.trolltech.com/gpl/ for GPL licensing information.
31
**
32
** Contact info@trolltech.com if any conditions of this licensing are
33
** not clear to you.
34
**
35
**********************************************************************/
36
37
#include <ntqsqldriverplugin.h>
38
#include "../../../../src/sql/drivers/sqlite3/qsql_sqlite3.h"
39
40
class TQSQLite3DriverPlugin : public TQSqlDriverPlugin
41
{
42
public:
43
    TQSQLite3DriverPlugin();
44
45
    TQSqlDriver* create( const TQString & );
46
    TQStringList keys() const;
47
};
48
49
TQSQLite3DriverPlugin::TQSQLite3DriverPlugin()
50
    : TQSqlDriverPlugin()
51
{
52
}
53
54
TQSqlDriver* TQSQLite3DriverPlugin::create( const TQString &name )
55
{
56
    if ( name == "TQSQLITE3" ) {
57
	TQSQLite3Driver* driver = new TQSQLite3Driver();
58
	return driver;
59
    }
60
    return 0;
61
}
62
63
TQStringList TQSQLite3DriverPlugin::keys() const
64
{
65
    TQStringList l;
66
    l  << "TQSQLITE3";
67
    return l;
68
}
69
70
Q_EXPORT_PLUGIN( TQSQLite3DriverPlugin )
(-)a/plugins/src/sqldrivers/sqlite3/sqlite3.pro (+33 lines)
Line 0 Link Here
1
TEMPLATE = lib
2
TARGET	 = qsqlite3
3
4
CONFIG	+= qt plugin
5
DESTDIR	 = ../../../sqldrivers
6
7
HEADERS		= ../../../../src/sql/drivers/sqlite3/qsql_sqlite3.h
8
SOURCES		= smain.cpp \
9
		  ../../../../src/sql/drivers/sqlite3/qsql_sqlite3.cpp
10
11
unix {
12
	OBJECTS_DIR = .obj
13
	!contains( LIBS, .*sqlite3.* ) {
14
	    LIBS	*= -lsqlite3
15
	}
16
}
17
18
win32 {
19
	OBJECTS_DIR = obj
20
	LIBS	*= sqlite3.lib
21
#	win32-msvc: {
22
#		LIBS *= delayimp.lib
23
#		QMAKE_LFLAGS += /DELAYLOAD:sqlite3.dll
24
#	}
25
#	win32-borland: {
26
#		QMAKE_LFLAGS += /dsqlite3.dll
27
#	}
28
}
29
30
REQUIRES	= sql
31
32
target.path += $$plugins.path/sqldrivers
33
INSTALLS += target
(-)a/src/sql/drivers/sqlite3/qsql_sqlite3.cpp (+494 lines)
Line 0 Link Here
1
/****************************************************************************
2
**
3
** Implementation of SQLite driver classes.
4
**
5
** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
6
**
7
** This file is part of the sql module of the TQt GUI Toolkit.
8
** EDITIONS: FREE, ENTERPRISE
9
**
10
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12
**
13
****************************************************************************/
14
15
#include "qsql_sqlite3.h"
16
17
#include <ntqdatetime.h>
18
#include <ntqvaluevector.h>
19
#include <ntqregexp.h>
20
#include <ntqfile.h>
21
#include <sqlite3.h>
22
23
#if (TQT_VERSION-0 < 0x030200)
24
#  include <ntqvector.h>
25
#  if !defined Q_WS_WIN32
26
#    include <unistd.h>
27
#  endif
28
#else
29
#  include <ntqptrvector.h>
30
#  if !defined Q_WS_WIN32
31
#    include <unistd.h>
32
#  endif
33
#endif
34
35
typedef struct sqlite3_stmt sqlite3_stmt;
36
37
#define TQSQLITE3_DRIVER_NAME "TQSQLITE3"
38
39
static TQVariant::Type qSqliteType(int tp)
40
{
41
    switch (tp) {
42
    case SQLITE_INTEGER:
43
        return TQVariant::Int;
44
    case SQLITE_FLOAT:
45
        return TQVariant::Double;
46
    case SQLITE_BLOB:
47
        return TQVariant::ByteArray;
48
    case SQLITE_TEXT:
49
    default:
50
        return TQVariant::String;
51
    }
52
}
53
54
static TQSqlError qMakeError(sqlite3 *access, const TQString &descr, TQSqlError::Type type,
55
                            int errorCode = -1)
56
{
57
    return TQSqlError(descr,
58
                     TQString::fromUtf8(sqlite3_errmsg(access)),
59
                     type, errorCode);
60
}
61
62
class TQSQLite3DriverPrivate
63
{
64
public:
65
    TQSQLite3DriverPrivate();
66
    sqlite3 *access;
67
    bool utf8;
68
};
69
70
TQSQLite3DriverPrivate::TQSQLite3DriverPrivate() : access(0)
71
{
72
    utf8 = true;
73
}
74
75
class TQSQLite3ResultPrivate
76
{
77
public:
78
    TQSQLite3ResultPrivate(TQSQLite3Result *res);
79
    void cleanup();
80
    bool fetchNext(TQtSqlCachedResult::RowCache *row);
81
    bool isSelect();
82
    // initializes the recordInfo and the cache
83
    void initColumns(TQtSqlCachedResult::RowCache **row = 0);
84
    void finalize();
85
86
    TQSQLite3Result* q;
87
    sqlite3 *access;
88
89
    sqlite3_stmt *stmt;
90
91
    uint skippedStatus: 1; // the status of the fetchNext() that's skipped
92
    TQtSqlCachedResult::RowCache *skipRow;
93
94
    uint utf8: 1;
95
    TQSqlRecord rInf;
96
};
97
98
static const uint initial_cache_size = 128;
99
100
TQSQLite3ResultPrivate::TQSQLite3ResultPrivate(TQSQLite3Result* res) : q(res), access(0),
101
    stmt(0), skippedStatus(false), skipRow(0), utf8(false)
102
{
103
}
104
105
void TQSQLite3ResultPrivate::cleanup()
106
{
107
    finalize();
108
    rInf.clear();
109
    skippedStatus = false;
110
    delete skipRow;
111
    skipRow = 0;
112
    q->setAt(TQSql::BeforeFirst);
113
    q->setActive(false);
114
    q->cleanup();
115
}
116
117
void TQSQLite3ResultPrivate::finalize()
118
{
119
    if (!stmt)
120
        return;
121
122
    sqlite3_finalize(stmt);
123
    stmt = 0;
124
}
125
126
// called on first fetch
127
void TQSQLite3ResultPrivate::initColumns(TQtSqlCachedResult::RowCache** row)
128
{
129
    rInf.clear();
130
131
    int nCols = sqlite3_column_count(stmt);
132
    if (nCols <= 0)
133
        return;
134
135
    q->init(nCols);
136
137
    for (int i = 0; i < nCols; ++i) {
138
        TQString colName = TQString::fromUtf8(sqlite3_column_name(stmt, i));
139
140
        int dotIdx = colName.findRev('.');
141
        rInf.append(TQSqlField(colName.mid(dotIdx == -1 ? 0 : dotIdx + 1),
142
                qSqliteType(sqlite3_column_type(stmt, i))));
143
    }
144
145
    // skip the first fetch
146
    if (row && !*row) {
147
        *row = new TQtSqlCachedResult::RowCache(nCols);
148
        skipRow = *row;
149
    }
150
}
151
152
bool TQSQLite3ResultPrivate::fetchNext(TQtSqlCachedResult::RowCache* row)
153
{
154
    int res;
155
    unsigned int i;
156
157
    if (skipRow) {
158
	// already fetched
159
	if (row)
160
	    *row = *skipRow;
161
	delete skipRow;
162
	skipRow = 0;
163
	return skippedStatus;
164
    }
165
166
    if (!stmt)
167
        return false;
168
169
    // keep trying while busy, wish I could implement this better.
170
    while ((res = sqlite3_step(stmt)) == SQLITE_BUSY) {
171
        // sleep instead requesting result again immidiately.
172
#if defined Q_OS_WIN
173
        Sleep(1000);
174
#else
175
        sleep(1);
176
#endif
177
    }
178
179
    switch(res) {
180
    case SQLITE_ROW:
181
        // check to see if should fill out columns
182
        if (rInf.isEmpty())
183
            // must be first call.
184
            initColumns(&row);
185
        if (!row)
186
            return true;
187
        for (i = 0; i < rInf.count(); ++i)
188
            // todo - handle other types
189
            (*row)[i] = TQString::fromUtf8((char *)(sqlite3_column_text(stmt, i)));
190
 //           values[i + idx] = utf8 ? TQString::fromUtf8(fvals[i]) : TQString::fromAscii(fvals[i]);
191
        return true;
192
    case SQLITE_DONE:
193
        if (rInf.isEmpty())
194
            // must be first call.
195
            initColumns(&row);
196
        q->setAt(TQSql::AfterLast);
197
        return false;
198
    case SQLITE_ERROR:
199
    case SQLITE_MISUSE:
200
    default:
201
        // something wrong, don't get col info, but still return false
202
        q->setLastError(qMakeError(access, "Unable to fetch row", TQSqlError::Connection, res));
203
        finalize();
204
        q->setAt(TQSql::AfterLast);
205
        return false;
206
    }
207
    return false;
208
}
209
210
TQSQLite3Result::TQSQLite3Result(const TQSQLite3Driver* db)
211
    : TQtSqlCachedResult(db)
212
{
213
    d = new TQSQLite3ResultPrivate(this);
214
    d->access = db->d->access;
215
}
216
217
TQSQLite3Result::~TQSQLite3Result()
218
{
219
    d->cleanup();
220
    delete d;
221
}
222
223
/*
224
   Execute \a query.
225
*/
226
bool TQSQLite3Result::reset (const TQString &query)
227
{
228
    // this is where we build a query.
229
    if (!driver() || !driver()->isOpen() || driver()->isOpenError())
230
        return false;
231
232
    d->cleanup();
233
234
    setSelect(false);
235
236
    int res = sqlite3_prepare(d->access, query.utf8().data(), (query.length() + 1) * sizeof(TQChar),
237
                                &d->stmt, 0);
238
239
    if (res != SQLITE_OK) {
240
        setLastError(qMakeError(d->access, "Unable to execute statement", TQSqlError::Statement, res));
241
        d->finalize();
242
        return false;
243
    }
244
245
    d->skippedStatus = d->fetchNext(0);
246
247
    setSelect(!d->rInf.isEmpty());
248
    setActive(true);
249
    return true;
250
}
251
252
bool TQSQLite3Result::gotoNext(TQtSqlCachedResult::RowCache* row)
253
{
254
    return d->fetchNext(row);
255
}
256
257
int TQSQLite3Result::size()
258
{
259
    return -1;
260
}
261
262
int TQSQLite3Result::numRowsAffected()
263
{
264
    return sqlite3_changes(d->access);
265
}
266
267
/////////////////////////////////////////////////////////
268
269
TQSQLite3Driver::TQSQLite3Driver(TQObject * parent, const char *name)
270
    : TQSqlDriver(parent, name)
271
{
272
    d = new TQSQLite3DriverPrivate();
273
}
274
275
TQSQLite3Driver::TQSQLite3Driver(sqlite3 *connection, TQObject *parent, const char *name)
276
    : TQSqlDriver(parent, name)
277
{
278
    d = new TQSQLite3DriverPrivate();
279
    d->access = connection;
280
    setOpen(true);
281
    setOpenError(false);
282
}
283
284
285
TQSQLite3Driver::~TQSQLite3Driver()
286
{
287
    delete d;
288
}
289
290
bool TQSQLite3Driver::hasFeature(DriverFeature f) const
291
{
292
    switch (f) {
293
    case Transactions:
294
    case Unicode:
295
    case BLOB:
296
        return true;
297
    default:
298
        break;
299
    }
300
    return false;
301
}
302
303
/*
304
   SQLite dbs have no user name, passwords, hosts or ports.
305
   just file names.
306
*/
307
bool TQSQLite3Driver::open(const TQString & db, const TQString &, const TQString &, const TQString &, int, const TQString &)
308
{
309
    if (isOpen())
310
        close();
311
312
    if (db.isEmpty())
313
        return false;
314
315
    if (sqlite3_open(TQFile::encodeName(db), &d->access) == SQLITE_OK) {
316
        setOpen(true);
317
        setOpenError(false);
318
        return true;
319
    } else {
320
        setLastError(qMakeError(d->access, "Error opening database",
321
                     TQSqlError::Connection));
322
        setOpenError(true);
323
        return false;
324
    }
325
}
326
327
void TQSQLite3Driver::close()
328
{
329
    if (isOpen()) {
330
        if (sqlite3_close(d->access) != SQLITE_OK)
331
            setLastError(qMakeError(d->access, "Error closing database",
332
                                    TQSqlError::Connection));
333
        d->access = 0;
334
        setOpen(false);
335
        setOpenError(false);
336
    }
337
}
338
339
TQSqlQuery TQSQLite3Driver::createQuery() const
340
{
341
    return TQSqlQuery(new TQSQLite3Result(this));
342
}
343
344
bool TQSQLite3Driver::beginTransaction()
345
{
346
    if (!isOpen() || isOpenError())
347
        return false;
348
349
    TQSqlQuery q(createQuery());
350
    if (!q.exec("BEGIN")) {
351
        setLastError(TQSqlError("Unable to begin transaction",
352
                               q.lastError().databaseText(), TQSqlError::Transaction));
353
        return false;
354
    }
355
356
    return true;
357
}
358
359
bool TQSQLite3Driver::commitTransaction()
360
{
361
    if (!isOpen() || isOpenError())
362
        return false;
363
364
    TQSqlQuery q(createQuery());
365
    if (!q.exec("COMMIT")) {
366
        setLastError(TQSqlError("Unable to begin transaction",
367
                               q.lastError().databaseText(), TQSqlError::Transaction));
368
        return false;
369
    }
370
371
    return true;
372
}
373
374
bool TQSQLite3Driver::rollbackTransaction()
375
{
376
    if (!isOpen() || isOpenError())
377
        return false;
378
379
    TQSqlQuery q(createQuery());
380
    if (!q.exec("ROLLBACK")) {
381
        setLastError(TQSqlError("Unable to begin transaction",
382
                               q.lastError().databaseText(), TQSqlError::Transaction));
383
        return false;
384
    }
385
386
    return true;
387
}
388
389
TQStringList TQSQLite3Driver::tables(const TQString &typeName) const
390
{
391
    TQStringList res;
392
    if (!isOpen())
393
        return res;
394
    int type = typeName.toInt();
395
396
    TQSqlQuery q = createQuery();
397
    q.setForwardOnly(TRUE);
398
#if (TQT_VERSION-0 >= 0x030200)
399
    if ((type & (int)TQSql::Tables) && (type & (int)TQSql::Views))
400
        q.exec("SELECT name FROM sqlite_master WHERE type='table' OR type='view'");
401
    else if (typeName.isEmpty() || (type & (int)TQSql::Tables))
402
        q.exec("SELECT name FROM sqlite_master WHERE type='table'");
403
    else if (type & (int)TQSql::Views)
404
        q.exec("SELECT name FROM sqlite_master WHERE type='view'");
405
#else
406
        q.exec("SELECT name FROM sqlite_master WHERE type='table' OR type='view'");
407
#endif
408
409
410
    if (q.isActive()) {
411
        while(q.next())
412
            res.append(q.value(0).toString());
413
    }
414
415
#if (TQT_VERSION-0 >= 0x030200)
416
    if (type & (int)TQSql::SystemTables) {
417
        // there are no internal tables beside this one:
418
        res.append("sqlite_master");
419
    }
420
#endif
421
422
    return res;
423
}
424
425
TQSqlIndex TQSQLite3Driver::primaryIndex(const TQString &tblname) const
426
{
427
    TQSqlRecordInfo rec(recordInfo(tblname)); // expensive :(
428
429
    if (!isOpen())
430
        return TQSqlIndex();
431
432
    TQSqlQuery q = createQuery();
433
    q.setForwardOnly(TRUE);
434
    // finrst find a UNIQUE INDEX
435
    q.exec("PRAGMA index_list('" + tblname + "');");
436
    TQString indexname;
437
    while(q.next()) {
438
	if (q.value(2).toInt()==1) {
439
	    indexname = q.value(1).toString();
440
	    break;
441
	}
442
    }
443
    if (indexname.isEmpty())
444
	return TQSqlIndex();
445
446
    q.exec("PRAGMA index_info('" + indexname + "');");
447
448
    TQSqlIndex index(indexname);
449
    while(q.next()) {
450
	TQString name = q.value(2).toString();
451
	TQSqlVariant::Type type = TQSqlVariant::Invalid;
452
	if (rec.contains(name))
453
	    type = rec.find(name).type();
454
	index.append(TQSqlField(name, type));
455
    }
456
    return index;
457
}
458
459
TQSqlRecordInfo TQSQLite3Driver::recordInfo(const TQString &tbl) const
460
{
461
    if (!isOpen())
462
        return TQSqlRecordInfo();
463
464
    TQSqlQuery q = createQuery();
465
    q.setForwardOnly(TRUE);
466
    q.exec("SELECT * FROM " + tbl + " LIMIT 1");
467
    return recordInfo(q);
468
}
469
470
TQSqlRecord TQSQLite3Driver::record(const TQString &tblname) const
471
{
472
    if (!isOpen())
473
        return TQSqlRecord();
474
475
    return recordInfo(tblname).toRecord();
476
}
477
478
TQSqlRecord TQSQLite3Driver::record(const TQSqlQuery& query) const
479
{
480
    if (query.isActive() && query.driver() == this) {
481
        TQSQLite3Result* result = (TQSQLite3Result*)query.result();
482
        return result->d->rInf;
483
    }
484
    return TQSqlRecord();
485
}
486
487
TQSqlRecordInfo TQSQLite3Driver::recordInfo(const TQSqlQuery& query) const
488
{
489
    if (query.isActive() && query.driver() == this) {
490
        TQSQLite3Result* result = (TQSQLite3Result*)query.result();
491
        return TQSqlRecordInfo(result->d->rInf);
492
    }
493
    return TQSqlRecordInfo();
494
}
(-)a/src/sql/drivers/sqlite3/qsql_sqlite3.h (+90 lines)
Line 0 Link Here
1
/****************************************************************************
2
**
3
** Definition of SQLite driver classes.
4
**
5
** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
6
**
7
** This file is part of the sql module of the TQt GUI Toolkit.
8
** EDITIONS: FREE, ENTERPRISE
9
**
10
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12
**
13
****************************************************************************/
14
15
#ifndef TQSQL_SQLITE3_H
16
#define TQSQL_SQLITE3_H
17
18
#include <ntqsqldriver.h>
19
#include <ntqsqlresult.h>
20
#include <ntqsqlrecord.h>
21
#include <ntqsqlindex.h>
22
#include "qsqlcachedresult.h"
23
24
#if (TQT_VERSION-0 >= 0x030200)
25
typedef TQVariant TQSqlVariant;
26
#endif
27
28
#if defined (Q_OS_WIN32)
29
# include <qt_windows.h>
30
#endif
31
32
class TQSQLite3DriverPrivate;
33
class TQSQLite3ResultPrivate;
34
class TQSQLite3Driver;
35
struct sqlite3;
36
37
class TQSQLite3Result : public TQtSqlCachedResult
38
{
39
    friend class TQSQLite3Driver;
40
    friend class TQSQLite3ResultPrivate;
41
public:
42
    TQSQLite3Result(const TQSQLite3Driver* db);
43
    ~TQSQLite3Result();
44
45
protected:
46
    bool gotoNext(TQtSqlCachedResult::RowCache* row);
47
    bool reset (const TQString& query);
48
    int size();
49
    int numRowsAffected();
50
51
private:
52
    TQSQLite3ResultPrivate* d;
53
};
54
55
class TQSQLite3Driver : public TQSqlDriver
56
{
57
    friend class TQSQLite3Result;
58
public:
59
    TQSQLite3Driver(TQObject *parent = 0, const char *name = 0);
60
    TQSQLite3Driver(sqlite3 *connection, TQObject *parent = 0, const char *name = 0);
61
    ~TQSQLite3Driver();
62
    bool hasFeature(DriverFeature f) const;
63
    bool open(const TQString & db,
64
                   const TQString & user,
65
                   const TQString & password,
66
                   const TQString & host,
67
                   int port,
68
                   const TQString & connOpts);
69
    bool open( const TQString & db,
70
               const TQString & user,
71
               const TQString & password,
72
               const TQString & host,
73
               int port ) { return open (db, user, password, host, port, TQString()); }
74
    void close();
75
    TQSqlQuery createQuery() const;
76
    bool beginTransaction();
77
    bool commitTransaction();
78
    bool rollbackTransaction();
79
    TQStringList tables(const TQString &user) const;
80
81
    TQSqlRecord record(const TQString& tablename) const;
82
    TQSqlRecordInfo recordInfo(const TQString& tablename) const;
83
    TQSqlIndex primaryIndex(const TQString &table) const;
84
    TQSqlRecord record(const TQSqlQuery& query) const;
85
    TQSqlRecordInfo recordInfo(const TQSqlQuery& query) const;
86
87
private:
88
    TQSQLite3DriverPrivate* d;
89
};
90
#endif
(-)a/src/sql/qsqldatabase.cpp (+12 lines)
Lines 68-73 Link Here
68
#ifdef QT_SQL_SQLITE
68
#ifdef QT_SQL_SQLITE
69
#include "drivers/sqlite/qsql_sqlite.h"
69
#include "drivers/sqlite/qsql_sqlite.h"
70
#endif
70
#endif
71
#ifdef QT_SQL_SQLITE3
72
#include "drivers/sqlite3/qsql_sqlite3.h"
73
#endif
71
#ifdef QT_SQL_IBASE
74
#ifdef QT_SQL_IBASE
72
#include "drivers/ibase/qsql_ibase.h"
75
#include "drivers/ibase/qsql_ibase.h"
73
#endif
76
#endif
Lines 525-530 TQStringList TQSqlDatabase::drivers() Link Here
525
    if ( !l.contains( "TQSQLITE" ) )
528
    if ( !l.contains( "TQSQLITE" ) )
526
	l << "TQSQLITE";
529
	l << "TQSQLITE";
527
#endif
530
#endif
531
#ifdef QT_SQL_SQLITE3
532
    if ( !l.contains( "TQSQLITE3" ) )
533
	l << "TQSQLITE3";
534
#endif
528
#ifdef QT_SQL_IBASE
535
#ifdef QT_SQL_IBASE
529
    if ( !l.contains( "TQIBASE" ) )
536
    if ( !l.contains( "TQIBASE" ) )
530
	l << "TQIBASE";
537
	l << "TQIBASE";
Lines 665-670 void TQSqlDatabase::init( const TQString& type, const TQString& ) Link Here
665
	    d->driver = new TQSQLiteDriver();
672
	    d->driver = new TQSQLiteDriver();
666
#endif
673
#endif
667
674
675
#ifdef QT_SQL_SQLITE3
676
	if ( type == "TQSQLITE3" )
677
	    d->driver = new TQSQLite3Driver();
678
#endif
679
668
#ifdef QT_SQL_IBASE
680
#ifdef QT_SQL_IBASE
669
	if ( type == "TQIBASE" )
681
	if ( type == "TQIBASE" )
670
	    d->driver = new TQIBaseDriver();
682
	    d->driver = new TQIBaseDriver();
(-)a/src/sql/qt_sql.pri (+6 lines)
Lines 250-254 sql { Link Here
250
            SOURCES += $$SQL_CPP/drivers/sqlite/qsql_sqlite.cpp
250
            SOURCES += $$SQL_CPP/drivers/sqlite/qsql_sqlite.cpp
251
            DEFINES += QT_SQL_SQLITE
251
            DEFINES += QT_SQL_SQLITE
252
        }
252
        }
253
254
        contains(sql-drivers, sqlite3) {
255
            HEADERS += $$SQL_CPP/drivers/sqlite3/qsql_sqlite3.h
256
            SOURCES += $$SQL_CPP/drivers/sqlite3/qsql_sqlite3.cpp
257
            DEFINES += QT_SQL_SQLITE3
258
        }
253
}
259
}
254
260

Return to bug 1942