Update
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:
parent
ca1bb8d91d
commit
bbb5065dc7
|
@ -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() ) {
|
||||
|
|
Loading…
Reference in New Issue