From feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 27 Jul 2018 23:51:12 -0400 Subject: New upstream version 3.2.1+dfsg1 --- SQLiteStudio3/guiSQLiteStudio/formview.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'SQLiteStudio3/guiSQLiteStudio/formview.cpp') diff --git a/SQLiteStudio3/guiSQLiteStudio/formview.cpp b/SQLiteStudio3/guiSQLiteStudio/formview.cpp index 0ebb9aa..575c2de 100644 --- a/SQLiteStudio3/guiSQLiteStudio/formview.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/formview.cpp @@ -85,7 +85,7 @@ void FormView::reloadInternal() { // Cleanup dataMapper->clearMapping(); - foreach (QWidget* widget, widgets) + for (QWidget* widget : widgets) { contents->layout()->removeWidget(widget); delete widget; @@ -97,7 +97,7 @@ void FormView::reloadInternal() // Recreate dataMapper->setModel(model.data()); int i = 0; - foreach (SqlQueryModelColumnPtr column, model->getColumns()) + for (SqlQueryModelColumnPtr column : model->getColumns()) addColumn(i++, column->displayName, column->dataType, (column->editionForbiddenReason.size() > 0)); } @@ -150,12 +150,18 @@ void FormView::updateDeletedState() { SqlQueryItem* item = model->itemFromIndex(dataMapper->getCurrentIndex(), 0); if (!item) + { + for (MultiEditor* editor : editors) + editor->setEnabled(false); + return; + } bool deleted = item->isDeletedRow(); int i = 0; - foreach (MultiEditor* editor, editors) + for (MultiEditor* editor : editors) { + editor->setEnabled(true); editor->setDeletedRow(deleted); editor->setReadOnly(readOnly[i++] || deleted); } -- cgit v1.2.3