1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

* Use unique db connection names.

This commit is contained in:
Christian Muehlhaeuser
2012-06-21 00:04:46 +02:00
parent d687bdb54f
commit 55537ce5f8

View File

@@ -706,8 +706,12 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
bool bool
DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema ) DatabaseImpl::openDatabase( const QString& dbname, bool checkSchema )
{ {
const QStringList conns = QSqlDatabase::connectionNames(); QString connName( "tomahawk" );
const QString connName = QString( "tomahawk%1" ).arg( conns.count() ? QString::number( conns.count() ) : "" ); if ( !checkSchema )
{
// secondary connection, use a unique connection name
connName += "_" + uuid();
}
bool schemaUpdated = false; bool schemaUpdated = false;
int version = -1; int version = -1;