mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
SqlDatabase: Remove existing database before adding new
Fixes duplicate connection warning.
This commit is contained in:
parent
b9c4a92aef
commit
4990eed417
@ -120,8 +120,9 @@ QSqlDatabase SqlDatabase::database()
|
||||
}
|
||||
|
||||
if (!s_databases.hasLocalData()) {
|
||||
const QString threadStr = QString::number((quintptr) QThread::currentThread());
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase(QSL("QSQLITE"), QSL("Falkon/") + threadStr);
|
||||
const QString threadStr = QStringLiteral("Falkon/%1").arg((quintptr) QThread::currentThread());
|
||||
QSqlDatabase::removeDatabase(threadStr);
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase(QSL("QSQLITE"), threadStr);
|
||||
db.setDatabaseName(m_databaseName);
|
||||
db.setConnectOptions(m_connectOptions);
|
||||
db.open();
|
||||
|
Loading…
Reference in New Issue
Block a user