Avoid to create empty code style name

Change-Id: I6f81aebecdb137c79d8a0a3c7d429f46672c24a6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Montel Laurent
2017-02-20 16:44:33 +01:00
committed by Laurent Montel
parent a4c0712cb2
commit 06d62e36f3

View File

@@ -272,7 +272,7 @@ void CodeStyleSelectorWidget::slotCopyClicked()
QLineEdit::Normal, QLineEdit::Normal,
tr("%1 (Copy)").arg(currentPreferences->displayName()), tr("%1 (Copy)").arg(currentPreferences->displayName()),
&ok); &ok);
if (!ok) if (!ok || newName.trimmed().isEmpty())
return; return;
ICodeStylePreferences *copy = codeStylePool->cloneCodeStyle(currentPreferences); ICodeStylePreferences *copy = codeStylePool->cloneCodeStyle(currentPreferences);
if (copy) { if (copy) {