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
db5b23ae
Commit
db5b23ae
authored
Apr 03, 2017
by
Laurent Montel
😁
Browse files
Minor optimization
parent
942bc617
Changes
2
Hide whitespace changes
Inline
Side-by-side
mimetreeparser/src/utils/util.cpp
View file @
db5b23ae
...
...
@@ -31,13 +31,14 @@ using namespace MimeTreeParser::Util;
bool
MimeTreeParser
::
Util
::
isTypeBlacklisted
(
KMime
::
Content
*
node
)
{
bool
typeBlacklisted
=
node
->
contentType
()
->
mediaType
().
toLower
()
==
"multipart"
;
const
QByteArray
mediaTypeLower
=
node
->
contentType
()
->
mediaType
().
toLower
();
bool
typeBlacklisted
=
mediaTypeLower
==
"multipart"
;
if
(
!
typeBlacklisted
)
{
typeBlacklisted
=
KMime
::
isCryptoPart
(
node
);
}
typeBlacklisted
=
typeBlacklisted
||
node
==
node
->
topLevel
();
const
bool
firstTextChildOfEncapsulatedMsg
=
node
->
contentType
()
->
mediaType
().
to
Lower
()
==
"text"
&&
mediaTypeLower
==
"text"
&&
node
->
contentType
()
->
subType
().
toLower
()
==
"plain"
&&
node
->
parent
()
&&
node
->
parent
()
->
contentType
()
->
mediaType
().
toLower
()
==
"message"
;
return
typeBlacklisted
||
firstTextChildOfEncapsulatedMsg
;
...
...
mimetreeparser/src/viewer/nodehelper.cpp
View file @
db5b23ae
...
...
@@ -65,9 +65,10 @@ NodeHelper::NodeHelper() :
// is the standard for Internet, and Shift-JIS is the encoding
// for Windows and Macintosh.
if
(
mLocalCodec
)
{
if
(
mLocalCodec
->
name
().
toLower
()
==
"eucjp"
const
QByteArray
codecNameLower
=
mLocalCodec
->
name
().
toLower
();
if
(
codecNameLower
==
"eucjp"
#if defined Q_OS_WIN || defined Q_OS_MACX
||
mLocalCodec
->
name
().
to
Lower
()
==
"shift-jis"
// OK?
||
codecName
Lower
==
"shift-jis"
// OK?
#endif
)
{
mLocalCodec
=
QTextCodec
::
codecForName
(
"jis7"
);
...
...
@@ -602,10 +603,11 @@ void NodeHelper::setBodyPartMemento(KMime::Content *node, const QByteArray &whic
QMap
<
QByteArray
,
Interface
::
BodyPartMemento
*>
&
mementos
=
mBodyPartMementoMap
[
persistentIndex
(
node
)];
const
QByteArray
whichLower
=
which
.
toLower
();
const
QMap
<
QByteArray
,
Interface
::
BodyPartMemento
*>::
iterator
it
=
mementos
.
lowerBound
(
which
.
to
Lower
()
);
mementos
.
lowerBound
(
whichLower
);
if
(
it
!=
mementos
.
end
()
&&
it
.
key
()
==
which
.
to
Lower
()
)
{
if
(
it
!=
mementos
.
end
()
&&
it
.
key
()
==
whichLower
)
{
delete
it
.
value
();
if
(
memento
)
{
it
.
value
()
=
memento
;
...
...
@@ -613,7 +615,7 @@ void NodeHelper::setBodyPartMemento(KMime::Content *node, const QByteArray &whic
mementos
.
erase
(
it
);
}
}
else
{
mementos
.
insert
(
which
.
to
Lower
()
,
memento
);
mementos
.
insert
(
whichLower
,
memento
);
}
}
...
...
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