Explorar el Código

Give the tag cache connection the same name as the database connection

This avoids accidental closing of the tag cache database connection
when more than one database instance accesses the same tag cache.
Steve Pieper hace 12 años
padre
commit
366d22d059
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      Libs/DICOM/Core/ctkDICOMDatabase.cpp

+ 1 - 2
Libs/DICOM/Core/ctkDICOMDatabase.cpp

@@ -283,7 +283,6 @@ void ctkDICOMDatabase::openDatabase(const QString databaseFile, const QString& c
   QFileInfo fileInfo(d->DatabaseFileName);
   d->TagCacheDatabaseFilename = QString( fileInfo.dir().path() + "/ctkDICOMTagCache.sql" );
   d->TagCacheVerified = false;
-
   if ( !this->tagCacheExists() )
     {
     this->initializeTagCache();
@@ -1469,7 +1468,7 @@ bool ctkDICOMDatabase::tagCacheExists()
   if ( !(d->TagCacheDatabase.isOpen()) )
     {
     qDebug() << "TagCacheDatabase not open\n";
-    d->TagCacheDatabase = QSqlDatabase::addDatabase("QSQLITE", "TagCache");
+    d->TagCacheDatabase = QSqlDatabase::addDatabase("QSQLITE", d->Database.connectionName() + "TagCache");
     d->TagCacheDatabase.setDatabaseName(d->TagCacheDatabaseFilename);
     if ( !(d->TagCacheDatabase.open()) )
       {