summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-12-23 18:17:59 +0100
committerThiago Macieira <thiago.macieira@intel.com>2022-12-23 22:23:05 +0000
commita057b026b80be3126df99503039e60f6ace4901c (patch)
tree12f3f57a64ff4147cbd5a8af61618ea5a3ab120b /src/sql/kernel
parent3642d5680df8a1b70e4a1a111347005e08555070 (diff)
QSqlDatabase: remove a pointless const_cast
The history of that one line of code is... interesting, to say the least. `defaultConnection` was originally declared as `char *`, which happened to work on older MSVC versions. Then it gained a workaround for other platforms by conditionally marking it const, with a const_cast to keep the code working on MSVC. Now it is unconditionally declared as a const char *, but the const_cast is still there. Get rid of it. Change-Id: Ibfb6728e05f15f540137c94f2d278bd5db988b63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/sql/kernel')
-rw-r--r--src/sql/kernel/qsqldatabase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index a547b1f15b..010c02eafa 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -24,7 +24,7 @@ using namespace Qt::StringLiterals;
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QSqlDriverFactoryInterface_iid, "/sqldrivers"_L1))
-const char *QSqlDatabase::defaultConnection = const_cast<char *>("qt_sql_default_connection");
+const char *QSqlDatabase::defaultConnection = "qt_sql_default_connection";
typedef QHash<QString, QSqlDriverCreatorBase*> DriverDict;