From 0bbf90c7e3d0fec6c16e0aaaa798786906fc1a19 2017-09-07 09:47:08 From: Alexandre Leroux Date: 2017-09-07 09:47:08 Subject: [PATCH] Fixes the ability to enter a name with only spaces when renaming variables --- diff --git a/gui/src/Variable/RenameVariableDialog.cpp b/gui/src/Variable/RenameVariableDialog.cpp index 1af8af5..2f49e6e 100644 --- a/gui/src/Variable/RenameVariableDialog.cpp +++ b/gui/src/Variable/RenameVariableDialog.cpp @@ -25,7 +25,7 @@ RenameVariableDialog::~RenameVariableDialog() noexcept QString RenameVariableDialog::name() const noexcept { - return ui->nameLineEdit->text(); + return ui->nameLineEdit->text().trimmed(); } void RenameVariableDialog::accept() @@ -38,7 +38,7 @@ void RenameVariableDialog::accept() }; // Empty name - auto name = ui->nameLineEdit->text(); + auto name = this->name(); if (name.isEmpty()) { invalidateInput(tr("A variable name must be specified")); return;