summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/kernel')
-rw-r--r--src/sql/kernel/kernel.pri3
-rw-r--r--src/sql/kernel/qsqlcachedresult_p.h1
-rw-r--r--src/sql/kernel/qsqldatabase.cpp117
-rw-r--r--src/sql/kernel/qsqldatabase.h2
-rw-r--r--src/sql/kernel/qsqldriver.h2
-rw-r--r--src/sql/kernel/qsqldriver_p.h1
-rw-r--r--src/sql/kernel/qsqldriverplugin.h2
-rw-r--r--src/sql/kernel/qsqlerror.h2
-rw-r--r--src/sql/kernel/qsqlfield.h2
-rw-r--r--src/sql/kernel/qsqlindex.h1
-rw-r--r--src/sql/kernel/qsqlnulldriver_p.h1
-rw-r--r--src/sql/kernel/qsqlquery.h2
-rw-r--r--src/sql/kernel/qsqlrecord.h2
-rw-r--r--src/sql/kernel/qsqlresult.h2
-rw-r--r--src/sql/kernel/qsqlresult_p.h1
-rw-r--r--src/sql/kernel/qtsqlglobal.h (renamed from src/sql/kernel/qsql.h)4
-rw-r--r--src/sql/kernel/qtsqlglobal_p.h57
17 files changed, 74 insertions, 128 deletions
diff --git a/src/sql/kernel/kernel.pri b/src/sql/kernel/kernel.pri
index dad3b46781..fd6ace8277 100644
--- a/src/sql/kernel/kernel.pri
+++ b/src/sql/kernel/kernel.pri
@@ -1,4 +1,5 @@
-HEADERS += kernel/qsql.h \
+HEADERS += kernel/qtsqlglobal.h \
+ kernel/qtsqlglobal_p.h \
kernel/qsqlquery.h \
kernel/qsqldatabase.h \
kernel/qsqlfield.h \
diff --git a/src/sql/kernel/qsqlcachedresult_p.h b/src/sql/kernel/qsqlcachedresult_p.h
index cad581d755..9bcfd49f1a 100644
--- a/src/sql/kernel/qsqlcachedresult_p.h
+++ b/src/sql/kernel/qsqlcachedresult_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtSql/private/qtsqlglobal_p.h>
#include "QtSql/qsqlresult.h"
#include "QtSql/private/qsqlresult_p.h"
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 62e1b6a7a5..d91e502b96 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -39,51 +39,6 @@
#include "qsqldatabase.h"
#include "qsqlquery.h"
-
-#ifdef Q_OS_WIN32
-// Conflicting declarations of LPCBYTE in sqlfront.h and winscard.h
-#define _WINSCARD_H_
-#endif
-
-#ifdef QT_SQL_PSQL
-#include "../drivers/psql/qsql_psql_p.h"
-#endif
-#ifdef QT_SQL_MYSQL
-#include "../drivers/mysql/qsql_mysql_p.h"
-#endif
-#ifdef QT_SQL_ODBC
-#include "../drivers/odbc/qsql_odbc_p.h"
-#endif
-#ifdef QT_SQL_OCI
-#include "../drivers/oci/qsql_oci_p.h"
-#endif
-#ifdef QT_SQL_TDS
-// conflicting RETCODE typedef between odbc and freetds
-#define RETCODE DBRETCODE
-#include "../drivers/tds/qsql_tds_p.h"
-#undef RETCODE
-#endif
-#ifdef QT_SQL_DB2
-#include "../drivers/db2/qsql_db2_p.h"
-#endif
-#ifdef QT_SQL_SQLITE
-#include "../drivers/sqlite/qsql_sqlite_p.h"
-#endif
-#ifdef QT_SQL_SQLITE2
-#include "../drivers/sqlite2/qsql_sqlite2_p.h"
-#endif
-#ifdef QT_SQL_IBASE
-#undef SQL_FLOAT // avoid clash with ODBC
-#undef SQL_DOUBLE
-#undef SQL_TIMESTAMP
-#undef SQL_TYPE_TIME
-#undef SQL_TYPE_DATE
-#undef SQL_DATE
-#define SCHAR IBASE_SCHAR // avoid clash with ODBC (older versions of ibase.h with Firebird)
-#include "../drivers/ibase/qsql_ibase_p.h"
-#undef SCHAR
-#endif
-
#include "qdebug.h"
#include "qcoreapplication.h"
#include "qreadwritelock.h"
@@ -542,39 +497,6 @@ QStringList QSqlDatabase::drivers()
{
QStringList list;
-#ifdef QT_SQL_PSQL
- list << QLatin1String("QPSQL7");
- list << QLatin1String("QPSQL");
-#endif
-#ifdef QT_SQL_MYSQL
- list << QLatin1String("QMYSQL3");
- list << QLatin1String("QMYSQL");
-#endif
-#ifdef QT_SQL_ODBC
- list << QLatin1String("QODBC3");
- list << QLatin1String("QODBC");
-#endif
-#ifdef QT_SQL_OCI
- list << QLatin1String("QOCI8");
- list << QLatin1String("QOCI");
-#endif
-#ifdef QT_SQL_TDS
- list << QLatin1String("QTDS7");
- list << QLatin1String("QTDS");
-#endif
-#ifdef QT_SQL_DB2
- list << QLatin1String("QDB2");
-#endif
-#ifdef QT_SQL_SQLITE
- list << QLatin1String("QSQLITE");
-#endif
-#ifdef QT_SQL_SQLITE2
- list << QLatin1String("QSQLITE2");
-#endif
-#ifdef QT_SQL_IBASE
- list << QLatin1String("QIBASE");
-#endif
-
if (QFactoryLoader *fl = loader()) {
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
@@ -726,45 +648,6 @@ void QSqlDatabasePrivate::init(const QString &type)
drvName = type;
if (!driver) {
-#ifdef QT_SQL_PSQL
- if (type == QLatin1String("QPSQL") || type == QLatin1String("QPSQL7"))
- driver = new QPSQLDriver();
-#endif
-#ifdef QT_SQL_MYSQL
- if (type == QLatin1String("QMYSQL") || type == QLatin1String("QMYSQL3"))
- driver = new QMYSQLDriver();
-#endif
-#ifdef QT_SQL_ODBC
- if (type == QLatin1String("QODBC") || type == QLatin1String("QODBC3"))
- driver = new QODBCDriver();
-#endif
-#ifdef QT_SQL_OCI
- if (type == QLatin1String("QOCI") || type == QLatin1String("QOCI8"))
- driver = new QOCIDriver();
-#endif
-#ifdef QT_SQL_TDS
- if (type == QLatin1String("QTDS") || type == QLatin1String("QTDS7"))
- driver = new QTDSDriver();
-#endif
-#ifdef QT_SQL_DB2
- if (type == QLatin1String("QDB2"))
- driver = new QDB2Driver();
-#endif
-#ifdef QT_SQL_SQLITE
- if (type == QLatin1String("QSQLITE"))
- driver = new QSQLiteDriver();
-#endif
-#ifdef QT_SQL_SQLITE2
- if (type == QLatin1String("QSQLITE2"))
- driver = new QSQLite2Driver();
-#endif
-#ifdef QT_SQL_IBASE
- if (type == QLatin1String("QIBASE"))
- driver = new QIBaseDriver();
-#endif
- }
-
- if (!driver) {
DriverDict dict = QSqlDatabasePrivate::driverDict();
for (DriverDict::const_iterator it = dict.constBegin();
it != dict.constEnd() && !driver; ++it) {
diff --git a/src/sql/kernel/qsqldatabase.h b/src/sql/kernel/qsqldatabase.h
index ad071a6954..0b4aca8cdd 100644
--- a/src/sql/kernel/qsqldatabase.h
+++ b/src/sql/kernel/qsqldatabase.h
@@ -40,8 +40,8 @@
#ifndef QSQLDATABASE_H
#define QSQLDATABASE_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qstring.h>
-#include <QtSql/qsql.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqldriver.h b/src/sql/kernel/qsqldriver.h
index 222b848d63..1296bd5d51 100644
--- a/src/sql/kernel/qsqldriver.h
+++ b/src/sql/kernel/qsqldriver.h
@@ -40,10 +40,10 @@
#ifndef QSQLDRIVER_H
#define QSQLDRIVER_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
-#include <QtSql/qsql.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqldriver_p.h b/src/sql/kernel/qsqldriver_p.h
index 3a01ae54ed..c8ec961124 100644
--- a/src/sql/kernel/qsqldriver_p.h
+++ b/src/sql/kernel/qsqldriver_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtSql/private/qtsqlglobal_p.h>
#include "private/qobject_p.h"
#include "qsqldriver.h"
#include "qsqlerror.h"
diff --git a/src/sql/kernel/qsqldriverplugin.h b/src/sql/kernel/qsqldriverplugin.h
index cfdf1f32ee..c0f4c00943 100644
--- a/src/sql/kernel/qsqldriverplugin.h
+++ b/src/sql/kernel/qsqldriverplugin.h
@@ -40,9 +40,9 @@
#ifndef QSQLDRIVERPLUGIN_H
#define QSQLDRIVERPLUGIN_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
-#include <QtSql/qsql.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h
index 0d241e9578..0ccd32159d 100644
--- a/src/sql/kernel/qsqlerror.h
+++ b/src/sql/kernel/qsqlerror.h
@@ -40,8 +40,8 @@
#ifndef QSQLERROR_H
#define QSQLERROR_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qstring.h>
-#include <QtSql/qsql.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h
index 3bf29a8db9..0d8c51f801 100644
--- a/src/sql/kernel/qsqlfield.h
+++ b/src/sql/kernel/qsqlfield.h
@@ -40,9 +40,9 @@
#ifndef QSQLFIELD_H
#define QSQLFIELD_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qvariant.h>
#include <QtCore/qstring.h>
-#include <QtSql/qsql.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqlindex.h b/src/sql/kernel/qsqlindex.h
index 83c5de2cec..b6fbdbbaaf 100644
--- a/src/sql/kernel/qsqlindex.h
+++ b/src/sql/kernel/qsqlindex.h
@@ -40,6 +40,7 @@
#ifndef QSQLINDEX_H
#define QSQLINDEX_H
+#include <QtSql/qtsqlglobal.h>
#include <QtSql/qsqlrecord.h>
#include <QtCore/qstring.h>
#include <QtCore/qvector.h>
diff --git a/src/sql/kernel/qsqlnulldriver_p.h b/src/sql/kernel/qsqlnulldriver_p.h
index 766323e697..92d8d30485 100644
--- a/src/sql/kernel/qsqlnulldriver_p.h
+++ b/src/sql/kernel/qsqlnulldriver_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtSql/private/qtsqlglobal_p.h>
#include "QtCore/qvariant.h"
#include "QtSql/qsqldriver.h"
#include "QtSql/qsqlerror.h"
diff --git a/src/sql/kernel/qsqlquery.h b/src/sql/kernel/qsqlquery.h
index 243e4a046e..cbbc25c4ec 100644
--- a/src/sql/kernel/qsqlquery.h
+++ b/src/sql/kernel/qsqlquery.h
@@ -40,7 +40,7 @@
#ifndef QSQLQUERY_H
#define QSQLQUERY_H
-#include <QtSql/qsql.h>
+#include <QtSql/qtsqlglobal.h>
#include <QtSql/qsqldatabase.h>
#include <QtCore/qstring.h>
diff --git a/src/sql/kernel/qsqlrecord.h b/src/sql/kernel/qsqlrecord.h
index 71c1b8a38f..94631bafd9 100644
--- a/src/sql/kernel/qsqlrecord.h
+++ b/src/sql/kernel/qsqlrecord.h
@@ -40,8 +40,8 @@
#ifndef QSQLRECORD_H
#define QSQLRECORD_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qstring.h>
-#include <QtSql/qsql.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqlresult.h b/src/sql/kernel/qsqlresult.h
index c6611c925f..d4192bfad2 100644
--- a/src/sql/kernel/qsqlresult.h
+++ b/src/sql/kernel/qsqlresult.h
@@ -40,9 +40,9 @@
#ifndef QSQLRESULT_H
#define QSQLRESULT_H
+#include <QtSql/qtsqlglobal.h>
#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
-#include <QtSql/qsql.h>
// for testing:
class tst_QSqlQuery;
diff --git a/src/sql/kernel/qsqlresult_p.h b/src/sql/kernel/qsqlresult_p.h
index 4fb2bcc1e1..7b312800c1 100644
--- a/src/sql/kernel/qsqlresult_p.h
+++ b/src/sql/kernel/qsqlresult_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtSql/private/qtsqlglobal_p.h>
#include <QtCore/qpointer.h>
#include "qsqlerror.h"
#include "qsqlresult.h"
diff --git a/src/sql/kernel/qsql.h b/src/sql/kernel/qtsqlglobal.h
index 02ebae7adc..d421adc84b 100644
--- a/src/sql/kernel/qsql.h
+++ b/src/sql/kernel/qtsqlglobal.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QSQL_H
-#define QSQL_H
+#ifndef QTSQLGLOBAL_H
+#define QTSQLGLOBAL_H
#include <QtCore/qglobal.h>
diff --git a/src/sql/kernel/qtsqlglobal_p.h b/src/sql/kernel/qtsqlglobal_p.h
new file mode 100644
index 0000000000..ab45f6cd38
--- /dev/null
+++ b/src/sql/kernel/qtsqlglobal_p.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtSql module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTSQLGLOBAL_P_H
+#define QTSQLGLOBAL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtSql/qtsqlglobal.h>
+#include <QtCore/private/qglobal_p.h>
+
+#endif // QTSQLGLOBAL_P_H