DolphinQt: Fix regression that caused the regex expression to be evaluated incorrectly. If an input expression has a non-alpha character in it, we want to quote it with backticks
This commit is contained in:
parent
9d04fd1ccb
commit
77c68a3142
|
@ -51,8 +51,10 @@ QString GetExpressionForControl(const QString& control_name,
|
||||||
|
|
||||||
if (quote == Quote::On)
|
if (quote == Quote::On)
|
||||||
{
|
{
|
||||||
const QRegularExpression reg(QStringLiteral("[a-zA-Z]+"));
|
// If our expression contains any non-alpha characters
|
||||||
if (!reg.match(expr).hasMatch())
|
// we should quote it
|
||||||
|
const QRegularExpression reg(QStringLiteral("[^a-zA-Z]"));
|
||||||
|
if (reg.match(expr).hasMatch())
|
||||||
expr = QStringLiteral("`%1`").arg(expr);
|
expr = QStringLiteral("`%1`").arg(expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue