mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-05 08:32:42 +02:00
Merge pull request #277 from tomahawk-player/fix-qsqldatabase-warning
Look into the list of driver instead of probing.
This commit is contained in:
commit
c6157ebba2
@ -739,10 +739,15 @@ Tomahawk::DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema )
|
||||
{
|
||||
if ( sqlDriver.isEmpty() )
|
||||
{
|
||||
sqlDriver = QString( "QSQLITE3" );
|
||||
QSqlDatabase testdb = QSqlDatabase::addDatabase( sqlDriver, "testDriverConnection" );
|
||||
if ( !testdb.isValid() )
|
||||
sqlDriver = QString( "QSQLITE" );
|
||||
QStringList drivers = QSqlDatabase::drivers();
|
||||
if (drivers.contains( "QSQLITE3" ))
|
||||
{
|
||||
sqlDriver = "QSQLITE3";
|
||||
}
|
||||
else
|
||||
{
|
||||
sqlDriver = "QSQLITE";
|
||||
}
|
||||
}
|
||||
|
||||
QSqlDatabase db = QSqlDatabase::addDatabase( sqlDriver, connName );
|
||||
|
Loading…
x
Reference in New Issue
Block a user