Commit 5410a2b3 authored by Laurent Montel's avatar Laurent Montel 😁

coding style

parent 419fd4b3
......@@ -173,7 +173,6 @@ QString AutoCreateScriptUtil::fixListValue(QString valueStr)
if (!(valueStr.startsWith(QLatin1Char('[')) && valueStr.endsWith(QLatin1Char(']')))) {
valueStr = QStringLiteral("\"%1\"").arg(valueStr);
} else if (valueStr.contains(QRegularExpression(QStringLiteral("^\\[\\s*\".*\"\\s*]$")))) {
;
} else {
valueStr = QStringLiteral("\"%1\"").arg(valueStr);
}
......
......@@ -83,7 +83,6 @@ void SieveEditorGraphicalModeWidgetTest::shouldLoadScripts()
QCOMPARE(hasError, !error.isEmpty());
generatedScript = w.currentscript();
//Create generated file
QFile f(generatedFile);
QVERIFY(f.open(QIODevice::WriteOnly | QIODevice::Truncate));
......
......@@ -98,7 +98,7 @@ bool SieveActionRedirect::setParamWidgetValue(const QDomElement &element, QWidge
} else if (tagName == QLatin1String("crlf")) {
//nothing
} else if (tagName == QLatin1String("comment")) {
setComment(e.text());
setComment(e.text());
//implement in the future ?
} else {
unknownTag(tagName, error);
......
......@@ -90,7 +90,7 @@ QString SieveConditionAddress::code(QWidget *w) const
const QLineEdit *edit = w->findChild<QLineEdit *>(QStringLiteral("editaddress"));
const QString addressStr = AutoCreateScriptUtil::createAddressList(edit->text().trimmed(), false);
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("address %1 %2 %3 %4").arg(selectAddressPartStr, matchTypeStr, selectHeaderTypeStr, addressStr)
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
QStringList SieveConditionAddress::needRequires(QWidget *w) const
......
......@@ -72,7 +72,7 @@ QString SieveConditionBody::code(QWidget *w) const
QLineEdit *edit = w->findChild<QLineEdit *>(QStringLiteral("edit"));
const QString editValue = AutoCreateScriptUtil::createAddressList(edit->text().trimmed(), false);
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("body %1 %2 %3").arg(bodyValue, matchValue, editValue)
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
QStringList SieveConditionBody::needRequires(QWidget *) const
......
......@@ -65,7 +65,7 @@ QString SieveConditionCurrentDate::code(QWidget *w) const
const QString dateWidgetStr = dateWidget->code();
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("currentdate %1 %2").arg(matchTypeStr, dateWidgetStr)
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
bool SieveConditionCurrentDate::needCheckIfServerHasCapability() const
......
......@@ -80,7 +80,7 @@ QString SieveConditionDate::code(QWidget *w) const
const QString dateWidgetStr = dateWidget->code();
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("date %1 \"%2\" %3").arg(matchTypeStr, headerStr, dateWidgetStr)
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
bool SieveConditionDate::needCheckIfServerHasCapability() const
......
......@@ -93,7 +93,7 @@ QString SieveConditionEnvelope::code(QWidget *w) const
const QLineEdit *edit = w->findChild<QLineEdit *>(QStringLiteral("editaddress"));
const QString addressStr = AutoCreateScriptUtil::createAddressList(edit->text().trimmed(), false);
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("envelope %1 %2 %3 %4").arg(selectAddressPartStr, matchTypeStr, selectHeaderTypeStr, addressStr)
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
QStringList SieveConditionEnvelope::needRequires(QWidget *w) const
......
......@@ -80,7 +80,7 @@ QString SieveConditionHeader::code(QWidget *w) const
valueStr = AutoCreateScriptUtil::fixListValue(valueStr);
return AutoCreateScriptUtil::negativeString(isNegative) + QStringLiteral("header %1 %2 %3").arg(matchString, headerStr, valueStr)
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
QString SieveConditionHeader::help() const
......
......@@ -56,7 +56,7 @@ QString SieveConditionIhave::code(QWidget *w) const
const QLineEdit *edit = w->findChild<QLineEdit *>(QStringLiteral("edit"));
const QString editValue = edit->text();
return QStringLiteral("ihave %1").arg(AutoCreateScriptUtil::createList(editValue, QLatin1Char(',')))
+ AutoCreateScriptUtil::generateConditionComment(comment());
+ AutoCreateScriptUtil::generateConditionComment(comment());
}
QStringList SieveConditionIhave::needRequires(QWidget *) const
......
......@@ -128,7 +128,6 @@ void SieveConditionWidget::initWidget()
mCommentButton->setIcon(QIcon::fromTheme(QStringLiteral("view-pim-notes")));
connect(mCommentButton, &QToolButton::clicked, this, &SieveConditionWidget::slotAddComment);
mComboBox->addItem(QLatin1String(""));
mLayout->addWidget(mComboBox, 1, 2);
connect(mComboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::activated), this, &SieveConditionWidget::slotConditionChanged);
......
......@@ -51,7 +51,7 @@ private Q_SLOTS:
void slotAddWidget();
void slotRemoveWidget();
void slotConditionChanged(int index);
void slotHelp();
void slotHelp();
void slotAddComment();
Q_SIGNALS:
......
......@@ -81,7 +81,6 @@ QString SieveScriptListItem::generatedScript(QStringList &requires) const
{
QString script;
if (!mDescription.trimmed().isEmpty()) {
const QStringList commentList = mDescription.split(QLatin1Char('\n'));
for (const QString &str : commentList) {
if (str.isEmpty()) {
......
......@@ -195,7 +195,7 @@ void VacationEditWidgetTest::shouldGetValues()
#if 0
KMime::Types::AddrSpecList mailAliases() const;
void setMailAliases(const KMime::Types::AddrSpecList & aliases);
void setMailAliases(const KMime::Types::AddrSpecList &aliases);
void setMailAliases(const QString &aliases);
bool sendForSpam() const;
......
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