Commit d1eeb1fb authored by Laurent Montel's avatar Laurent Montel 😁

Don't add empty variable name

parent 95f31be9
......@@ -52,7 +52,7 @@ SieveGlobalVariableActionWidget::~SieveGlobalVariableActionWidget()
void SieveGlobalVariableActionWidget::generatedScript(QString &script)
{
const QString variableName = mVariableName->text();
if (variableName.isEmpty()) {
if (variableName.trimmed().isEmpty()) {
return;
}
script += QLatin1String("global ");
......@@ -107,7 +107,11 @@ bool SieveGlobalVariableActionWidget::isInitialized() const
QString SieveGlobalVariableActionWidget::variableName() const
{
return mVariableName->text();
const QString varName = mVariableName->text();
if (varName.trimmed().isEmpty()) {
return {};
}
return varName;
}
void SieveGlobalVariableActionWidget::setVariableValue(const QString &name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment