summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/psql/main.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-20 09:51:30 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-01-09 21:41:01 +0000
commit8551b7d93ce3767b2cebb0d442e72d8ad450539e (patch)
tree1ec898b581178376a8a500a3e0f4dc4a451553e8 /src/plugins/sqldrivers/psql/main.cpp
parent0cc9c304798a436d844d3c2a51025729d888bfb2 (diff)
QSQL: cleanup/modernize PostgreSQL plugin
Cleanup/modernize the PostgreSQL plugin - use nullptr - use range-based for loop - use QStringLiteral or QByteArray::fromRawData instead QLatin1String/QString::fromLatin1 where possible - use QRegularExpression instead QRegExp - use QQueue instead QList - uppercase SQL keywords Change-Id: Ie22be1538328ff1e2b663066ede96741d271e050 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/psql/main.cpp')
-rw-r--r--src/plugins/sqldrivers/psql/main.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/sqldrivers/psql/main.cpp b/src/plugins/sqldrivers/psql/main.cpp
index c5d546f6ff..a0862a238a 100644
--- a/src/plugins/sqldrivers/psql/main.cpp
+++ b/src/plugins/sqldrivers/psql/main.cpp
@@ -61,11 +61,9 @@ QPSQLDriverPlugin::QPSQLDriverPlugin()
QSqlDriver* QPSQLDriverPlugin::create(const QString &name)
{
- if (name == QLatin1String("QPSQL") || name == QLatin1String("QPSQL7")) {
- QPSQLDriver* driver = new QPSQLDriver();
- return driver;
- }
- return 0;
+ if (name == QLatin1String("QPSQL") || name == QLatin1String("QPSQL7"))
+ return new QPSQLDriver;
+ return nullptr;
}
QT_END_NAMESPACE