From 7331d22c6f55b6cd76bcf05bc70ebac69cf51eb9 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 2 Jun 2016 16:10:01 +0200 Subject: Add qtsqlglobal.h and qtsqlglobal_p.h The new modular configuration system requires one global header per module, that is included by all other files in this module. QtSql already had such a header, but its name (qsql.h) was not in line with what's being used in all other modules. So add a qtsqlglobal.h header, deprecate qsql.h and turn it into a a forwarding header to that new global header file. Change-Id: Ibaeb95b008cf08ba062cbfe8a3f4d3bf79294390 Reviewed-by: Oswald Buddenhagen --- src/sql/kernel/kernel.pri | 4 +- src/sql/kernel/qsql.h | 96 ------------------------------------- src/sql/kernel/qsqlcachedresult_p.h | 1 + src/sql/kernel/qsqldatabase.h | 2 +- src/sql/kernel/qsqldriver.h | 2 +- src/sql/kernel/qsqldriver_p.h | 1 + src/sql/kernel/qsqldriverplugin.h | 2 +- src/sql/kernel/qsqlerror.h | 2 +- src/sql/kernel/qsqlfield.h | 2 +- src/sql/kernel/qsqlindex.h | 1 + src/sql/kernel/qsqlnulldriver_p.h | 1 + src/sql/kernel/qsqlquery.h | 2 +- src/sql/kernel/qsqlrecord.h | 2 +- src/sql/kernel/qsqlresult.h | 2 +- src/sql/kernel/qsqlresult_p.h | 1 + src/sql/kernel/qtsqlglobal.h | 96 +++++++++++++++++++++++++++++++++++++ src/sql/kernel/qtsqlglobal_p.h | 57 ++++++++++++++++++++++ 17 files changed, 169 insertions(+), 105 deletions(-) delete mode 100644 src/sql/kernel/qsql.h create mode 100644 src/sql/kernel/qtsqlglobal.h create mode 100644 src/sql/kernel/qtsqlglobal_p.h (limited to 'src/sql/kernel') diff --git a/src/sql/kernel/kernel.pri b/src/sql/kernel/kernel.pri index dad3b46781..27ee47132b 100644 --- a/src/sql/kernel/kernel.pri +++ b/src/sql/kernel/kernel.pri @@ -1,4 +1,6 @@ -HEADERS += kernel/qsql.h \ +HEADERS += kernel/qtsqlglobal.h \ + kernel/qtsqlglobal_p.h \ + kernel/qsql.h \ kernel/qsqlquery.h \ kernel/qsqldatabase.h \ kernel/qsqlfield.h \ diff --git a/src/sql/kernel/qsql.h b/src/sql/kernel/qsql.h deleted file mode 100644 index 02ebae7adc..0000000000 --- a/src/sql/kernel/qsql.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** 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 QSQL_H -#define QSQL_H - -#include - -QT_BEGIN_NAMESPACE - -#ifndef QT_STATIC -# if defined(QT_BUILD_SQL_LIB) -# define Q_SQL_EXPORT Q_DECL_EXPORT -# else -# define Q_SQL_EXPORT Q_DECL_IMPORT -# endif -#else -# define Q_SQL_EXPORT -#endif - -namespace QSql -{ - enum Location - { - BeforeFirstRow = -1, - AfterLastRow = -2 - }; - - enum ParamTypeFlag - { - In = 0x00000001, - Out = 0x00000002, - InOut = In | Out, - Binary = 0x00000004 - }; - Q_DECLARE_FLAGS(ParamType, ParamTypeFlag) - - enum TableType - { - Tables = 0x01, - SystemTables = 0x02, - Views = 0x04, - AllTables = 0xff - }; - - enum NumericalPrecisionPolicy - { - LowPrecisionInt32 = 0x01, - LowPrecisionInt64 = 0x02, - LowPrecisionDouble = 0x04, - - HighPrecision = 0 - }; -} - -Q_DECLARE_OPERATORS_FOR_FLAGS(QSql::ParamType) - -QT_END_NAMESPACE - -#endif // QSQL_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 #include "QtSql/qsqlresult.h" #include "QtSql/private/qsqlresult_p.h" 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 #include -#include 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 #include #include #include -#include 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 #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 #include #include -#include 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 #include -#include 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 #include #include -#include 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 #include #include #include 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 #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 +#include #include #include 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 #include -#include 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 #include #include -#include // 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 #include #include "qsqlerror.h" #include "qsqlresult.h" diff --git a/src/sql/kernel/qtsqlglobal.h b/src/sql/kernel/qtsqlglobal.h new file mode 100644 index 0000000000..d421adc84b --- /dev/null +++ b/src/sql/kernel/qtsqlglobal.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** 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_H +#define QTSQLGLOBAL_H + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_STATIC +# if defined(QT_BUILD_SQL_LIB) +# define Q_SQL_EXPORT Q_DECL_EXPORT +# else +# define Q_SQL_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_SQL_EXPORT +#endif + +namespace QSql +{ + enum Location + { + BeforeFirstRow = -1, + AfterLastRow = -2 + }; + + enum ParamTypeFlag + { + In = 0x00000001, + Out = 0x00000002, + InOut = In | Out, + Binary = 0x00000004 + }; + Q_DECLARE_FLAGS(ParamType, ParamTypeFlag) + + enum TableType + { + Tables = 0x01, + SystemTables = 0x02, + Views = 0x04, + AllTables = 0xff + }; + + enum NumericalPrecisionPolicy + { + LowPrecisionInt32 = 0x01, + LowPrecisionInt64 = 0x02, + LowPrecisionDouble = 0x04, + + HighPrecision = 0 + }; +} + +Q_DECLARE_OPERATORS_FOR_FLAGS(QSql::ParamType) + +QT_END_NAMESPACE + +#endif // QSQL_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 +#include + +#endif // QTSQLGLOBAL_P_H -- cgit v1.2.3