Explorar o 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 %!s(int64=12) %!d(string=hai) anos
pai
achega
366d22d059
Modificáronse 1 ficheiros con 1 adicións e 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()) )
       {