diff options
| author | 2018-07-27 23:51:12 -0400 | |
|---|---|---|
| committer | 2018-07-27 23:51:12 -0400 | |
| commit | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (patch) | |
| tree | 1e50f5f666f419143f510d5ded00fe2006b7bd85 /SQLiteStudio3/guiSQLiteStudio/formview.cpp | |
| parent | d9aa870e5d509cc7309ab82dd102a937ab58613a (diff) | |
New upstream version 3.2.1+dfsg1upstream/3.2.1+dfsg1
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/formview.cpp')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/formview.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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); } |
