Removed use of the default connection for the database as consequence of
the introduction of the worker updating it in a separate thread: avoid
query errors and crashes
This commit is contained in:
Valentino Orlandi 2023-01-27 02:39:57 +01:00
parent ca1bb8d91d
commit bbb5065dc7
Signed by: elB4RTO
GPG Key ID: 1719E976DB2D4E71
1 changed files with 1 additions and 6 deletions

View File

@ -179,12 +179,7 @@ const bool HashOps::insertUsedHashes( const std::string& db_path, const std::vec
bool proceed = true;
const QString db_name = QString::fromStdString( db_path.substr( db_path.find_last_of( '/' ) + 1 ) );
QSqlDatabase db;
if ( QSqlDatabase::contains("qt_sql_default_connection") ) {
db = QSqlDatabase::database("qt_sql_default_connection");
} else {
db = QSqlDatabase::addDatabase("QSQLITE");
}
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName( QString::fromStdString( db_path ) );
if ( ! db.open() ) {