#289 Data source renaming has been fixed

This commit is contained in:
Arin Alexandex 2020-08-16 17:54:44 +03:00
parent bf6a7ce462
commit 2777cbb744
3 changed files with 6 additions and 7 deletions

View File

@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 66
LIMEREPORT_VERSION_RELEASE = 67
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

@ -677,7 +677,7 @@ SQLEditResult::ResultMode DataBrowser::currentDatasourceType(const QString& data
void DataBrowser::applyChanges(SQLEditResult result)
{
if (result.resultMode == currentDatasourceType(result.datasourceName)){
if (result.resultMode == currentDatasourceType(result.oldDatasourceName)){
switch(result.resultMode){
case SQLEditResult::Query:
changeQuery(result);
@ -694,7 +694,7 @@ void DataBrowser::applyChanges(SQLEditResult result)
default: break;
}
} else {
removeDatasource(result.datasourceName);
removeDatasource(result.oldDatasourceName);
addDatasource(result);
}
activateItem(result.datasourceName, DataBrowserTree::Table);

View File

@ -675,8 +675,6 @@ CSVDesc *DataSourceManager::csvByName(const QString &datasourceName)
void DataSourceManager::removeDatasource(const QString &name)
{
invalidateLinkedDatasources(name);
if (m_datasources.contains(name)){
IDataSourceHolder *holder;
holder=m_datasources.value(name);
@ -703,6 +701,7 @@ void DataSourceManager::removeDatasource(const QString &name)
delete m_csvs.at(csvIndex);
m_csvs.removeAt(csvIndex);
}
invalidateLinkedDatasources(name);
m_hasChanges = true;
emit datasourcesChanged();
}
@ -1348,12 +1347,12 @@ void DataSourceManager::invalidateLinkedDatasources(QString datasourceName)
{
foreach(QString name, dataSourceNames()){
if (isSubQuery(name)){
if (subQueryByName(name)->master() == datasourceName)
if (subQueryByName(name)->master().compare(datasourceName) == 0)
dataSourceHolder(name)->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE);
}
if (isProxy(name)){
ProxyDesc* proxy = proxyByName(name);
if ((proxy->master() == datasourceName) || (proxy->child() == datasourceName))
if ((proxy->master().compare(datasourceName) == 0) || (proxy->child().compare(datasourceName) == 0))
dataSourceHolder(name)->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE);
}