From f11c0181cab02411459040eaf5361e9a72a237ad Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Mon, 10 Apr 2017 14:17:01 +0200 Subject: [PATCH] Improve wording in comment --- src/EditTableDialog.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EditTableDialog.cpp b/src/EditTableDialog.cpp index dc8d09bb..6cf3cb88 100644 --- a/src/EditTableDialog.cpp +++ b/src/EditTableDialog.cpp @@ -257,12 +257,12 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column) { case kName: { - // When a field of that name already exists, show a warning to the user and don't apply the new name. There is one exception, however, - // to this rule: if the field that is about to be renamed the one we're finding here, this can only mean that the user is trying to - // rename the field to essentially the same name but with different case. Example: if I rename column 'COLUMN' to 'column', findField() - // is going to return the current field number because it's doing a case-independent search and it can't return another field number - // because SQLite prohibits duplicate field names (no matter the case). So when this happens we just allow the renaming because there's - // no harm to be expected from it. + // When a field of that name already exists, show a warning to the user and don't apply the new name. This is done by searching for an + // existing field with the new name. There is one exception, however, to this rule: if the field that we have found is the same field + // as the one we are currently trying to rename, this means the user is trying to rename the field to essentially the same name but + // with different case. Example: if I rename column 'COLUMN' to 'column', findField() is going to return the current field number + // because it's doing a case-independent search and it can't return another field number because SQLite prohibits duplicate field + // names (no matter the case). So when this happens we just allow the renaming because there's no harm to be expected from it. int foundField = m_table.findField(item->text(column)); if(foundField != -1 && foundField != index) {