Commit f2d32761 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some clazy warning

parent 58af6279
Pipeline #74124 passed with stage
in 16 minutes and 21 seconds
......@@ -161,9 +161,10 @@ QStringList AutoCreateScriptUtil::listValue(QXmlStreamReader &element)
QString AutoCreateScriptUtil::fixListValue(QString valueStr)
{
static QRegularExpression reg(QStringLiteral("^\\[\\s*\".*\"\\s*]$"));
if (!(valueStr.startsWith(QLatin1Char('[')) && valueStr.endsWith(QLatin1Char(']')))) {
valueStr = QStringLiteral("\"%1\"").arg(valueStr);
} else if (valueStr.contains(QRegularExpression(QStringLiteral("^\\[\\s*\".*\"\\s*]$")))) {
} else if (valueStr.contains(reg)) {
} else {
valueStr = QStringLiteral("\"%1\"").arg(valueStr);
}
......
......@@ -40,9 +40,6 @@ public:
explicit SieveDebugDialog(SieveImapPasswordProvider *passwordProvider, QWidget *parent = nullptr);
~SieveDebugDialog() override;
Q_SIGNALS:
void result(bool success);
private Q_SLOTS:
void slotGetScript(KManageSieve::SieveJob *job, bool success, const QString &script, bool active);
void slotGetScriptList(KManageSieve::SieveJob *job, bool success, const QStringList &scriptList, const QString &activeScript);
......
......@@ -21,7 +21,8 @@ static inline QString stringReplaceRegExp(QString s)
static inline QString stringReplaceRegularExpression(QString s)
{
s.replace(QRegularExpression(QStringLiteral("[\n\t]+")), QStringLiteral(" "));
static QRegularExpression reg(QStringLiteral("[\n\t]+"));
s.replace(reg, QStringLiteral(" "));
return s.replace(QLatin1Char('\"'), QStringLiteral("\\\""));
}
......
......@@ -32,7 +32,8 @@ static inline QString dotstuff(QString s) // krazy:exclude=passbyvalue
static inline QString stringReplace(QString s)
{
s.replace(QRegularExpression(QStringLiteral("[\n\t]+")), QStringLiteral(" "));
static QRegularExpression reg(QStringLiteral("[\n\t]+"));
s.replace(reg, QStringLiteral(" "));
return s.replace(QLatin1Char('\"'), QStringLiteral("\\\""));
}
......
......@@ -30,7 +30,8 @@ static inline QString dotstuff(QString s) // krazy:exclude=passbyvalue
static inline QString stringReplace(QString s)
{
s.replace(QRegularExpression(QStringLiteral("[\n\t]+")), QStringLiteral(" "));
static QRegularExpression reg(QStringLiteral("[\n\t]+"));
s.replace(reg, QStringLiteral(" "));
return s.replace(QLatin1Char('\"'), QStringLiteral("\\\""));
}
......
Supports Markdown
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