From 475c8635a2ffd530a2c8ae52cab666a3baf6e58b Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 24 Jul 2020 10:06:00 +0300 Subject: [PATCH] "Designer crash when open, close and open database connection" issue has been fixed --- common.pri | 2 +- limereport/lrdatasourcemanager.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common.pri b/common.pri index 556482b..40e980e 100644 --- a/common.pri +++ b/common.pri @@ -84,7 +84,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 136 +LIMEREPORT_VERSION_RELEASE = 137 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp index 20ff3fb..e0e6f8d 100644 --- a/limereport/lrdatasourcemanager.cpp +++ b/limereport/lrdatasourcemanager.cpp @@ -941,14 +941,15 @@ void DataSourceManager::disconnectConnection(const QString& connectionName) foreach(QString datasourceName, dataSourceNames()){ if (isQuery(datasourceName) || isSubQuery(datasourceName)){ QueryHolder* qh = dynamic_cast(dataSourceHolder(datasourceName)); - if (qh && qh->connectionName().compare(connectionName,Qt::CaseInsensitive)==0){ - qh->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE); + if (qh && qh->connectionName().compare(connectionName,Qt::CaseInsensitive) == 0){ + qh->invalidate(designTime() ? IDataSource::DESIGN_MODE : IDataSource::RENDER_MODE, true); qh->setLastError(tr("invalid connection")); } } } ConnectionDesc* connectionDesc = connectionByName(connectionName); + if (connectionDesc->isInternal()){ { QSqlDatabase db = QSqlDatabase::database(connectionName);