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
PIM Messagelib
Commits
41a9526d
Commit
41a9526d
authored
Sep 03, 2021
by
Laurent Montel
😁
Browse files
Fix some clazy warnings
parent
8c3174ec
Pipeline
#78201
passed with stage
in 43 minutes and 6 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagecomposer/autotests/messagefactoryngtest.cpp
View file @
41a9526d
...
...
@@ -768,11 +768,11 @@ void MessageFactoryTest::testCreateRedirect()
QString
datetime
=
rdir
->
date
()
->
asUnicodeString
();
const
QRegularExpression
rx
(
Q
Latin1
String
(
"Resent-Message-ID: ([^
\n
]*)"
));
const
QRegularExpression
rx
(
QString
Literal
(
"Resent-Message-ID: ([^
\n
]*)"
));
const
QRegularExpressionMatch
rxMatch
=
rx
.
match
(
QString
::
fromLatin1
(
rdir
->
head
()));
QVERIFY
(
rxMatch
.
hasMatch
());
const
QRegularExpression
rxmessageid
(
Q
Latin1
String
(
"Message-ID: ([^
\n
]+)"
));
const
QRegularExpression
rxmessageid
(
QString
Literal
(
"Message-ID: ([^
\n
]+)"
));
const
QRegularExpressionMatch
rxmessageidMatch
=
rxmessageid
.
match
(
QString
::
fromLatin1
(
rdir
->
head
()));
QVERIFY
(
rxmessageidMatch
.
hasMatch
());
...
...
messagecore/autotests/autocryptutilstest.cpp
View file @
41a9526d
...
...
@@ -106,7 +106,7 @@ void AutocryptUtilsTest::test_gossip()
auto
storage
=
AutocryptStorage
::
self
();
QCOMPARE
(
storage
->
d_func
()
->
recipients
.
keys
().
size
(),
expectedKeys
.
size
());
for
(
const
auto
&
addr
:
expectedKeys
)
{
for
(
const
auto
&
addr
:
std
::
as_const
(
expectedKeys
)
)
{
QVERIFY2
(
storage
->
getRecipient
(
addr
),
qPrintable
(
QStringLiteral
(
"storage missing %1"
).
arg
(
QString
::
fromLatin1
(
addr
))));
}
...
...
messagelist/src/core/view.cpp
View file @
41a9526d
...
...
@@ -2357,7 +2357,8 @@ bool View::event(QEvent *e)
break
;
}
}
else
{
if
(
ghi
->
label
().
contains
(
QRegularExpression
(
QStringLiteral
(
"[0-9]"
))))
{
static
const
QRegularExpression
reg
(
QStringLiteral
(
"[0-9]"
));
if
(
ghi
->
label
().
contains
(
reg
))
{
if
(
storageModel
()
->
containsOutboundMessages
())
{
description
=
i18nc
(
"@info:tooltip Formats to something like 'Messages sent on 2008-12-21'"
,
"Messages sent on %1"
,
ghi
->
label
());
}
else
{
...
...
@@ -2476,9 +2477,7 @@ bool View::event(QEvent *e)
"<nobr>%2</nobr>"
"</td>"
"</tr>"
)
.
arg
(
darkerColorName
)
.
arg
(
statsText
)
.
arg
(
textDirection
);
.
arg
(
darkerColorName
,
statsText
,
textDirection
);
}
break
;
...
...
messagelist/src/core/widgets/quicksearchline.h
View file @
41a9526d
...
...
@@ -68,7 +68,7 @@ Q_SIGNALS:
void
statusButtonsClicked
();
void
forceLostFocus
();
void
saveFilter
();
void
activateFilter
(
Filter
*
f
);
void
activateFilter
(
MessageList
::
Core
::
Filter
*
f
);
protected:
bool
eventFilter
(
QObject
*
object
,
QEvent
*
e
)
override
;
...
...
messageviewer/src/dkim-verify/dkimchecksignaturejob.cpp
View file @
41a9526d
...
...
@@ -324,7 +324,8 @@ QString DKIMCheckSignatureJob::headerCanonizationSimple() const
DKIMHeaderParser
parser
=
mHeaderParser
;
for
(
const
QString
&
header
:
mDkimInfo
.
listSignedHeader
())
{
const
auto
listSignedHeader
{
mDkimInfo
.
listSignedHeader
()};
for
(
const
QString
&
header
:
listSignedHeader
)
{
const
QString
str
=
parser
.
headerType
(
header
.
toLower
());
if
(
!
str
.
isEmpty
())
{
if
(
!
headers
.
isEmpty
())
{
...
...
messageviewer/src/dkim-verify/dkimutil.cpp
View file @
41a9526d
...
...
@@ -56,7 +56,8 @@ QString MessageViewer::DKIMUtil::bodyCanonizationSimple(QString body)
// Note that a completely empty or missing body is canonicalized as a
// single "CRLF"; that is, the canonicalized length will be 2 octets.
body
.
replace
(
QStringLiteral
(
"
\n
"
),
QStringLiteral
(
"
\r\n
"
));
body
.
replace
(
QRegularExpression
(
QStringLiteral
(
"((
\r\n
)+)?$"
)),
QStringLiteral
(
"
\r\n
"
));
static
const
QRegularExpression
reg
(
QStringLiteral
(
"((
\r\n
)+)?$"
));
body
.
replace
(
reg
,
QStringLiteral
(
"
\r\n
"
));
if
(
body
.
endsWith
(
QLatin1String
(
"
\r\n
"
)))
{
// Remove it from start
body
.
chop
(
2
);
}
...
...
@@ -103,9 +104,12 @@ QString MessageViewer::DKIMUtil::headerCanonizationRelaxed(const QString &header
// colon separator MUST be retained.
QString
newHeaderName
=
headerName
.
toLower
();
QString
newHeaderValue
=
headerValue
;
newHeaderValue
.
replace
(
QRegularExpression
(
QStringLiteral
(
"
\r\n
[
\t
]+"
)),
QStringLiteral
(
" "
));
newHeaderValue
.
replace
(
QRegularExpression
(
QStringLiteral
(
"[
\t
]+"
)),
QStringLiteral
(
" "
));
newHeaderValue
.
replace
(
QRegularExpression
(
QStringLiteral
(
"[
\t
]+
\r\n
"
)),
QStringLiteral
(
"
\r\n
"
));
static
const
QRegularExpression
reg1
(
QStringLiteral
(
"
\r\n
[
\t
]+"
));
newHeaderValue
.
replace
(
reg1
,
QStringLiteral
(
" "
));
static
const
QRegularExpression
reg2
(
QStringLiteral
(
"[
\t
]+"
));
newHeaderValue
.
replace
(
reg2
,
QStringLiteral
(
" "
));
static
const
QRegularExpression
reg3
(
QStringLiteral
(
"[
\t
]+
\r\n
"
));
newHeaderValue
.
replace
(
reg3
,
QStringLiteral
(
"
\r\n
"
));
// Perhaps remove tab after headername and before value name
// newHeaderValue.replace(QRegularExpression(QStringLiteral("[ \t]*:[ \t]")), QStringLiteral(":"));
if
(
newHeaderName
==
QLatin1String
(
"content-type"
)
&&
removeQuoteOnContentType
)
{
// Remove quote in charset
...
...
messageviewer/src/header/headerstyle_util.cpp
View file @
41a9526d
...
...
@@ -274,10 +274,12 @@ HeaderStyleUtil::xfaceSettings HeaderStyleUtil::xface(const MessageViewer::Heade
style
->
nodeHelper
()
->
setBodyPartMemento
(
message
,
"contactphoto"
,
photoMemento
);
QObject
::
connect
(
photoMemento
,
SIGNAL
(
update
(
MimeTreeParser
::
UpdateMode
)),
style
->
sourceObject
(),
SLOT
(
update
(
MimeTreeParser
::
UpdateMode
)));
// clang-format off
QObject
::
connect
(
photoMemento
,
SIGNAL
(
changeDisplayMail
(
Viewer
::
DisplayFormatMessage
,
bool
)),
SIGNAL
(
changeDisplayMail
(
Viewer
::
DisplayFormatMessage
,
bool
)),
style
->
sourceObject
(),
SIGNAL
(
changeDisplayMail
(
Viewer
::
DisplayFormatMessage
,
bool
)));
SIGNAL
(
changeDisplayMail
(
Viewer
::
DisplayFormatMessage
,
bool
)));
// clang-format on
}
if
(
photoMemento
->
finished
())
{
...
...
messageviewer/src/header/headerstylepluginmanager.cpp
View file @
41a9526d
...
...
@@ -200,7 +200,8 @@ QStringList HeaderStylePluginManager::pluginListName() const
{
QStringList
lst
;
lst
.
reserve
(
d
->
pluginsList
().
count
());
for
(
MessageViewer
::
HeaderStylePlugin
*
plugin
:
d
->
pluginsList
())
{
const
auto
pluginsList
{
d
->
pluginsList
()};
for
(
MessageViewer
::
HeaderStylePlugin
*
plugin
:
pluginsList
)
{
lst
<<
plugin
->
name
();
}
return
lst
;
...
...
messageviewer/src/widgets/htmlstatusbar.h
View file @
41a9526d
...
...
@@ -62,7 +62,7 @@ public Q_SLOTS:
/** Switch to "normal mode". */
void
setNormalMode
();
/** Switch to mode @p m */
void
setMode
(
MimeTreeParser
::
Util
::
HtmlMode
m
,
UpdateMode
mode
=
Update
);
void
setMode
(
MimeTreeParser
::
Util
::
HtmlMode
m
,
MessageViewer
::
HtmlStatusBar
::
UpdateMode
mode
=
Update
);
Q_SIGNALS:
/** The user has clicked the status bar. */
...
...
templateparser/src/templateparserjob.cpp
View file @
41a9526d
...
...
@@ -681,7 +681,8 @@ void TemplateParserJob::slotExtractInfoDone(const TemplateParserExtractHtmlInfoR
// insert specified content of header from current message
qCDebug
(
TEMPLATEPARSER_LOG
)
<<
"Command: HEADER("
;
QRegularExpressionMatch
match
;
const
int
res
=
cmd
.
indexOf
(
QRegularExpression
(
QStringLiteral
(
"^HEADER
\\
((.+)
\\
)"
)),
0
,
&
match
);
static
QRegularExpression
reg
(
QStringLiteral
(
"^HEADER
\\
((.+)
\\
)"
));
const
int
res
=
cmd
.
indexOf
(
reg
,
0
,
&
match
);
if
(
res
!=
0
)
{
// something wrong
i
+=
strlen
(
"HEADER( "
);
...
...
Write
Preview
Supports
Markdown
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