mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
Fix bug in 9e36f21112
This fixes a bug in the code to modify multiple table columns in one go. We were accidentally adding more tracked columns when adding a new column and then changing its name. See issue #1627.
This commit is contained in:
@@ -323,7 +323,7 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
|
||||
// Update the field name in the map of old column names to new column names
|
||||
if(!m_bNewTable)
|
||||
{
|
||||
for(const auto& key : trackColumns)
|
||||
for(const auto& key : trackColumns.keys())
|
||||
{
|
||||
if(trackColumns[key] == oldFieldName)
|
||||
trackColumns[key] = field.name();
|
||||
@@ -588,7 +588,7 @@ void EditTableDialog::removeField()
|
||||
|
||||
// Update the map of tracked columns to indicate the column is deleted
|
||||
QString name = ui->treeWidget->currentItem()->text(0);
|
||||
for(const auto& key : trackColumns)
|
||||
for(const auto& key : trackColumns.keys())
|
||||
{
|
||||
if(trackColumns[key] == name)
|
||||
trackColumns[key] = QString();
|
||||
|
||||
Reference in New Issue
Block a user