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
PIM Messagelib
Commits
34db6b7c
Commit
34db6b7c
authored
Dec 18, 2016
by
Laurent Montel
Browse files
Port to for(...:...)
parent
54e63a49
Changes
7
Hide whitespace changes
Inline
Side-by-side
messagelist/src/core/filter.cpp
View file @
34db6b7c
...
...
@@ -142,7 +142,7 @@ void Filter::setSearchString(const QString &search, QuickSearchLine::SearchOptio
const
QStringList
searchListTmp
=
mSearchString
.
split
(
QLatin1Char
(
' '
),
QString
::
SkipEmptyParts
);
mSearchList
.
clear
();
newStr
.
clear
();
Q_FOREACH
(
const
QString
&
text
,
searchListTmp
)
{
for
(
const
QString
&
text
:
searchListTmp
)
{
if
(
text
.
size
()
>=
3
)
{
mSearchList
<<
text
;
if
(
!
newStr
.
isEmpty
())
{
...
...
messagelist/src/pane.cpp
View file @
34db6b7c
...
...
@@ -1077,7 +1077,7 @@ void Pane::writeConfig(bool restoreSession)
// Delete list before
const
QStringList
list
=
MessageList
::
MessageListSettings
::
self
()
->
config
()
->
groupList
().
filter
(
QRegularExpression
(
QStringLiteral
(
"MessageListTab
\\
d+"
)));
for
each
(
const
QString
&
group
,
list
)
{
for
(
const
QString
&
group
:
list
)
{
MessageList
::
MessageListSettings
::
self
()
->
config
()
->
deleteGroup
(
group
);
}
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
34db6b7c
...
...
@@ -2539,9 +2539,9 @@ void ViewerPrivate::slotAttachmentSaveAll()
void
ViewerPrivate
::
slotAttachmentView
()
{
auto
contents
=
selectedContents
();
const
auto
contents
=
selectedContents
();
Q_FOREACH
(
KMime
::
Content
*
content
,
contents
)
{
for
(
KMime
::
Content
*
content
:
contents
)
{
attachmentView
(
content
);
}
...
...
@@ -2549,13 +2549,13 @@ void ViewerPrivate::slotAttachmentView()
void
ViewerPrivate
::
slotAttachmentProperties
()
{
auto
contents
=
selectedContents
();
const
auto
contents
=
selectedContents
();
if
(
contents
.
isEmpty
())
{
return
;
}
Q_FOREACH
(
KMime
::
Content
*
content
,
contents
)
{
for
(
KMime
::
Content
*
content
:
contents
)
{
attachmentProperties
(
content
);
}
}
...
...
@@ -2582,7 +2582,7 @@ void ViewerPrivate::attachmentCopy(const KMime::Content::List &contents)
}
QList
<
QUrl
>
urls
;
Q_FOREACH
(
KMime
::
Content
*
content
,
contents
)
{
for
(
KMime
::
Content
*
content
:
contents
)
{
auto
url
=
QUrl
::
fromLocalFile
(
mNodeHelper
->
writeNodeToTempFile
(
content
));
if
(
!
url
.
isValid
())
{
continue
;
...
...
@@ -2602,13 +2602,13 @@ void ViewerPrivate::attachmentCopy(const KMime::Content::List &contents)
void
ViewerPrivate
::
slotAttachmentDelete
()
{
auto
contents
=
selectedContents
();
const
auto
contents
=
selectedContents
();
if
(
contents
.
isEmpty
())
{
return
;
}
bool
showWarning
=
true
;
Q_FOREACH
(
KMime
::
Content
*
content
,
contents
)
{
for
(
KMime
::
Content
*
content
:
contents
)
{
if
(
!
deleteAttachment
(
content
,
showWarning
))
{
return
;
}
...
...
@@ -2619,7 +2619,7 @@ void ViewerPrivate::slotAttachmentDelete()
void
ViewerPrivate
::
slotAttachmentEdit
()
{
auto
contents
=
selectedContents
();
const
auto
contents
=
selectedContents
();
if
(
contents
.
isEmpty
())
{
return
;
}
...
...
@@ -2631,7 +2631,7 @@ void ViewerPrivate::slotAttachmentEdit()
job
->
setMessage
(
mMessage
);
bool
showWarning
=
true
;
Q_FOREACH
(
KMime
::
Content
*
content
,
contents
)
{
for
(
KMime
::
Content
*
content
:
contents
)
{
if
(
!
job
->
addAttachment
(
content
,
showWarning
))
{
break
;
}
...
...
messageviewer/src/viewerplugins/viewerplugintoolmanager.cpp
View file @
34db6b7c
...
...
@@ -81,8 +81,8 @@ void ViewerPluginToolManagerPrivate::refreshActionList()
void
ViewerPluginToolManagerPrivate
::
createView
()
{
QVector
<
MessageViewer
::
ViewerPlugin
*>
listPlugin
=
MessageViewer
::
ViewerPluginManager
::
self
()
->
pluginsList
();
Q_FOREACH
(
MessageViewer
::
ViewerPlugin
*
plugin
,
listPlugin
)
{
const
QVector
<
MessageViewer
::
ViewerPlugin
*>
listPlugin
=
MessageViewer
::
ViewerPluginManager
::
self
()
->
pluginsList
();
for
(
MessageViewer
::
ViewerPlugin
*
plugin
:
listPlugin
)
{
if
(
plugin
->
isEnabled
())
{
MessageViewer
::
ViewerPluginInterface
*
interface
=
plugin
->
createView
(
mParentWidget
,
mActionCollection
);
q
->
connect
(
interface
,
&
MessageViewer
::
ViewerPluginInterface
::
activatePlugin
,
q
,
&
ViewerPluginToolManager
::
activatePlugin
);
...
...
mimetreeparser/src/utils/util.cpp
View file @
34db6b7c
...
...
@@ -57,8 +57,8 @@ QMimeType MimeTreeParser::Util::mimetype(const QString &name)
{
QMimeDatabase
db
;
// consider the filename if mimetype cannot be found by content-type
auto
mimeTypes
=
db
.
mimeTypesForFileName
(
name
);
for
each
(
const
auto
&
mt
,
mimeTypes
)
{
const
auto
mimeTypes
=
db
.
mimeTypesForFileName
(
name
);
for
(
const
auto
&
mt
:
mimeTypes
)
{
if
(
mt
.
name
()
!=
QLatin1String
(
"application/octet-stream"
))
{
return
mt
;
}
...
...
@@ -132,4 +132,4 @@ QString MimeTreeParser::Util::iconNameForContent(KMime::Content *node)
mimeType
=
mimeType
.
toLower
();
return
iconNameForMimetype
(
QLatin1String
(
mimeType
),
node
->
contentDisposition
()
->
filename
(),
node
->
contentType
()
->
name
());
}
\ No newline at end of file
}
mimetreeparser/src/viewer/nodehelper.cpp
View file @
34db6b7c
...
...
@@ -850,11 +850,11 @@ void NodeHelper::cleanFromExtraNodes(KMime::Content *node)
if
(
!
node
)
{
return
;
}
QList
<
KMime
::
Content
*
>
extraNodes
=
extraContents
(
node
);
Q_FOREACH
(
KMime
::
Content
*
extra
,
extraNodes
)
{
const
QList
<
KMime
::
Content
*
>
extraNodes
=
extraContents
(
node
);
for
(
KMime
::
Content
*
extra
:
extraNodes
)
{
QByteArray
s
=
extra
->
encodedContent
();
auto
children
=
node
->
contents
();
Q_FOREACH
(
KMime
::
Content
*
c
,
children
)
{
const
auto
children
=
node
->
contents
();
for
(
KMime
::
Content
*
c
:
children
)
{
if
(
c
->
encodedContent
()
==
s
)
{
node
->
removeContent
(
c
);
}
...
...
templateparser/src/templateparser.cpp
View file @
34db6b7c
...
...
@@ -54,7 +54,7 @@ static const int PipeTimeout = 15 * 1000;
static
QTextCodec
*
selectCharset
(
const
QStringList
&
charsets
,
const
QString
&
text
)
{
for
each
(
const
QString
&
name
,
charsets
)
{
for
(
const
QString
&
name
:
charsets
)
{
// We use KCharsets::codecForName() instead of QTextCodec::codecForName() here, because
// the former knows us-ascii is latin1.
bool
ok
=
true
;
...
...
@@ -1206,8 +1206,8 @@ void TemplateParser::addProcessedBodyToMessage(const QString &plainBody,
// Now, delete the old content and set the new content, which
// is either only the new text or the new text with some attachments.
auto
parts
=
mMsg
->
contents
();
for
each
(
KMime
::
Content
*
content
,
parts
)
{
const
auto
parts
=
mMsg
->
contents
();
for
(
KMime
::
Content
*
content
:
parts
)
{
mMsg
->
removeContent
(
content
,
true
/*delete*/
);
}
...
...
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