Unverified Commit d14eef60 authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Fix difference in syntax between QRegEx and QRegularExpression



Signed-off-by: Carl Schwan's avatarCarl Schwan <carl@carlschwan.eu>
parent 718dea24
......@@ -85,8 +85,8 @@ QString replacePrefixes(const QString &str, const QStringList &prefixRegExps, co
// construct a big regexp that
// 1. is anchored to the beginning of str (sans whitespace)
// 2. matches at least one of the part regexps in prefixRegExps
const QString bigRegExp = QStringLiteral("^(?:\\s+|(?:%1))+\\s*").arg(prefixRegExps.join(QStringLiteral(")|(?:")));
static QRegularExpression regex(bigRegExp, QRegularExpression::CaseInsensitiveOption);
const QString bigRegExp = QStringLiteral("^(\\s+|(%1))+\\s*").arg(prefixRegExps.join(QStringLiteral(")|(")));
const QRegularExpression regex(bigRegExp, QRegularExpression::CaseInsensitiveOption);
Q_ASSERT(regex.isValid());
QString tmp = str;
......@@ -106,6 +106,8 @@ const QStringList getForwardPrefixes()
// We want to be able to potentially reply to a variety of languages, so only translating is not enough
list << i18n("fwd");
list << QStringLiteral("fwd");
list << QStringLiteral("Fwd");
list << QStringLiteral("fw");
list << QStringLiteral("fw");
list << QStringLiteral("wg");
list << QStringLiteral("vs");
......
......@@ -11,7 +11,6 @@
void MimeTreeParser::Test::setupEnv()
{
qputenv("LC_ALL", "C");
qputenv("KDEHOME", QFile::encodeName(QDir::homePath() + QString::fromLatin1("/.qttest")).constData());
qputenv("LC_ALL", "en_US.UTF-8");
QStandardPaths::setTestModeEnabled(true);
}
......@@ -16,8 +16,7 @@ namespace Test
/**
* setup a environment variables for tests:
* * set LC_ALL to C
* * set KDEHOME
* * set LC_ALL to en_US.UTF-8
*/
void setupEnv();
......
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