summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-01-30 13:46:49 +0100
committerLaurent Montel <[email protected]>2018-01-30 13:46:49 +0100
commit1bc8901791ae113e0a4eccb66ef87aecad0a7075 (patch)
treeb36cd63e5e85c46e3ff35b34611269fbd2281f16
parentbeaafa19e3ceb0586776500ab7127828a60d6997 (diff)
Avoid to create an empty name
-rw-r--r--templateparser/src/customtemplates.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/templateparser/src/customtemplates.cpp b/templateparser/src/customtemplates.cpp
index 5d46949..9080e20 100644
--- a/templateparser/src/customtemplates.cpp
+++ b/templateparser/src/customtemplates.cpp
@@ -452,7 +452,7 @@ void CustomTemplates::slotItemChanged(QTreeWidgetItem *item, int column)
if (item) {
CustomTemplateItem *vitem = static_cast<CustomTemplateItem *>(item);
if (column == 1) {
- const QString newName = vitem->text(1);
+ const QString newName = vitem->text(1).trimmed();
if (!newName.isEmpty()) {
const QString oldName = vitem->oldName();
if (nameAlreadyExists(newName, item)) {