Skip to content
GitLab
Menu
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
8cba0d38
Commit
8cba0d38
authored
Feb 01, 2022
by
Laurent Montel
😁
Browse files
Port to QRegularExpression
parent
b1b09372
Pipeline
#131481
passed with stage
in 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/incidenceformatter.cpp
View file @
8cba0d38
...
...
@@ -47,6 +47,7 @@ using namespace KCalendarCore;
#include <QLocale>
#include <QMimeDatabase>
#include <QPalette>
#include <QRegularExpression>
using
namespace
KCalUtils
;
using
namespace
IncidenceFormatter
;
...
...
@@ -749,11 +750,13 @@ QString IncidenceFormatter::extensiveDisplayStr(const QString &sourceName, const
//@cond PRIVATE
static
QString
cleanHtml
(
const
QString
&
html
)
{
QRegExp
rx
(
QStringLiteral
(
"<body[^>]*>(.*)</body>"
),
Qt
::
CaseInsensitive
);
rx
.
indexIn
(
html
);
QString
body
=
rx
.
cap
(
1
);
return
body
.
remove
(
QRegExp
(
QStringLiteral
(
"<[^>]*>"
))).
trimmed
().
toHtmlEscaped
();
static
QRegularExpression
rx
=
QRegularExpression
(
QStringLiteral
(
"<body[^>]*>(.*)</body>"
),
QRegularExpression
::
CaseInsensitiveOption
);
QRegularExpressionMatch
match
=
rx
.
match
(
html
);
if
(
match
.
hasMatch
())
{
QString
body
=
match
.
captured
(
1
);
return
body
.
remove
(
QRegularExpression
(
QStringLiteral
(
"<[^>]*>"
))).
trimmed
().
toHtmlEscaped
();
}
return
html
;
}
static
QString
invitationSummary
(
const
Incidence
::
Ptr
&
incidence
,
bool
noHtmlMode
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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