Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KCalUtils
Commits
b1b09372
Commit
b1b09372
authored
Feb 01, 2022
by
Laurent Montel
Browse files
Use QRegularExpression
parent
a0b30823
Pipeline
#131472
passed with stage
in 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/testincidenceformatter.cpp
View file @
b1b09372
...
...
@@ -25,10 +25,10 @@
#include
<QIcon>
#include
<QLocale>
#include
<QProcess>
#include
<QRegularExpression>
#include
<QStandardPaths>
#include
<QTest>
#include
<QTimeZone>
QTEST_MAIN
(
IncidenceFormatterTest
)
#ifndef Q_OS_WIN
void
initLocale
()
...
...
@@ -200,11 +200,11 @@ bool IncidenceFormatterTest::compareHtml(const QString &name)
}
QString
content
=
QString
::
fromUtf8
(
f
.
readAll
());
f
.
close
();
content
.
replace
(
QReg
Exp
(
QStringLiteral
(
"
\"
file:[^
\"
]*[/(?:%2F)]([^
\"
/(?:%2F)]*)
\"
"
)),
QStringLiteral
(
"
\"
file:
\\
1
\"
"
));
content
.
replace
(
QReg
ularExpression
(
QStringLiteral
(
"
\"
file:[^
\"
]*[/(?:%2F)]([^
\"
/(?:%2F)]*)
\"
"
)),
QStringLiteral
(
"
\"
file:
\\
1
\"
"
));
// emoticons give us absolute paths without file:
content
.
replace
(
QReg
Exp
(
QStringLiteral
(
"src=
\"
/[^
\"
]*[/(?:%2F)]([^
\"
/(?:%2F)]*)
\"
"
)),
QStringLiteral
(
"src=
\"\\
1
\"
"
));
content
.
replace
(
QReg
ularExpression
(
QStringLiteral
(
"src=
\"
/[^
\"
]*[/(?:%2F)]([^
\"
/(?:%2F)]*)
\"
"
)),
QStringLiteral
(
"src=
\"\\
1
\"
"
));
// icon filename extensions depend on used theme, Oxygen has PNG, Breeze has SVG
content
.
replace
(
QReg
Exp
(
QStringLiteral
(
".(png|svg)
\"
"
)),
QStringLiteral
(
"
\"
"
));
content
.
replace
(
QReg
ularExpression
(
QStringLiteral
(
".(png|svg)
\"
"
)),
QStringLiteral
(
"
\"
"
));
if
(
!
f
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment