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

Fix generate indentation in sieve condition

parent 4d5a06dc
......@@ -70,6 +70,7 @@ void SieveConditionWidget::setFilterCondition(QWidget *widget)
void SieveConditionWidget::generatedScript(QString &script, QStringList &requires, bool inForEveryPartLoop)
{
Q_UNUSED(inForEveryPartLoop);
const int index = mComboBox->currentIndex();
if (index != mComboBox->count() - 1) {
KSieveUi::SieveCondition *widgetCondition = mConditionList.at(mComboBox->currentIndex());
......@@ -80,9 +81,6 @@ void SieveConditionWidget::generatedScript(QString &script, QStringList &require
requires.append(r);
}
}
if (inForEveryPartLoop) {
//FIXME script += AutoCreateScriptUtil::indentation();
}
script += mConditionList.at(mComboBox->currentIndex())->code(currentWidget) + QLatin1Char('\n');
}
}
......@@ -296,6 +294,9 @@ void SieveConditionWidgetLister::generatedScript(QString &script, int &numberOfC
w->generatedScript(condition, requires, inForEveryPartLoop);
if (!condition.isEmpty()) {
if (!wasFirst) {
if (inForEveryPartLoop) {
script += AutoCreateScriptUtil::indentation();
}
script += QLatin1String(", ");
}
script += condition;
......
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