mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
* Reuse precalculated connection name.
This commit is contained in:
parent
28e15122ea
commit
2dc73d04af
@ -742,7 +742,7 @@ DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema )
|
||||
|
||||
if ( version > 0 && version != CURRENT_SCHEMA_VERSION )
|
||||
{
|
||||
QSqlDatabase::removeDatabase( "tomahawk" );
|
||||
QSqlDatabase::removeDatabase( connName );
|
||||
|
||||
QString newname = QString( "%1.v%2" ).arg( dbname ).arg( version );
|
||||
tLog() << endl << "****************************" << endl;
|
||||
@ -753,7 +753,7 @@ DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema )
|
||||
|
||||
QFile::copy( dbname, newname );
|
||||
{
|
||||
m_db = QSqlDatabase::addDatabase( "QSQLITE", "tomahawk" );
|
||||
m_db = QSqlDatabase::addDatabase( "QSQLITE", connName );
|
||||
m_db.setDatabaseName( dbname );
|
||||
if ( !m_db.open() )
|
||||
throw "db moving failed";
|
||||
|
Loading…
x
Reference in New Issue
Block a user