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
KMail
Commits
c55a8c66
Commit
c55a8c66
authored
Mar 21, 2019
by
Laurent Montel
Browse files
Compile without foreach
parent
372107d7
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
c55a8c66
...
...
@@ -143,7 +143,10 @@ include_directories(${kmail_SOURCE_DIR} ${kmail_BINARY_DIR})
configure_file
(
kmail-version.h.cmake
${
CMAKE_CURRENT_BINARY_DIR
}
/kmail-version.h @ONLY
)
add_definitions
(
-DQT_DISABLE_DEPRECATED_BEFORE=0x060000
)
if
(
${
KF5Config_VERSION
}
STRGREATER
"5.56.0"
)
add_definitions
(
-DQT_NO_FOREACH
)
MESSAGE
(
STATUS
"compile without foreach"
)
endif
()
add_subdirectory
(
src
)
add_subdirectory
(
agents
)
add_subdirectory
(
ktnef
)
...
...
agents/archivemailagent/archivemailmanager.cpp
View file @
c55a8c66
...
...
@@ -105,7 +105,8 @@ void ArchiveMailManager::removeCollectionId(Akonadi::Collection::Id id)
group
.
deleteGroup
();
mConfig
->
sync
();
mConfig
->
reparseConfiguration
();
foreach
(
ArchiveMailInfo
*
info
,
mListArchiveInfo
)
{
//Don't port to for(...:...)
const
auto
lst
=
mListArchiveInfo
;
for
(
ArchiveMailInfo
*
info
:
lst
)
{
if
(
info
->
saveCollectionId
()
==
id
)
{
mListArchiveInfo
.
removeAll
(
info
);
}
...
...
src/editor/kmcomposerwin.cpp
View file @
c55a8c66
...
...
@@ -1378,7 +1378,8 @@ void KMComposerWin::initializePluginActions()
QHash
<
QString
,
QList
<
QAction
*>
>::
const_iterator
i
=
hashActions
.
constBegin
();
while
(
i
!=
hashActions
.
constEnd
())
{
Q_FOREACH
(
KXMLGUIClient
*
client
,
guiFactory
()
->
clients
())
{
const
auto
lst
=
guiFactory
()
->
clients
();
for
(
KXMLGUIClient
*
client
:
lst
)
{
client
->
unplugActionList
(
i
.
key
());
client
->
plugActionList
(
i
.
key
(),
i
.
value
());
}
...
...
@@ -2340,7 +2341,8 @@ void KMComposerWin::setEncryption(bool encrypt, bool setByUser)
if
(
setByUser
)
{
// User has toggled encryption, go over all recipients
Q_FOREACH
(
auto
line
,
mComposerBase
->
recipientsEditor
()
->
lines
())
{
const
auto
lst
=
mComposerBase
->
recipientsEditor
()
->
lines
();
for
(
auto
line
:
lst
)
{
if
(
encrypt
)
{
// Encryption was enabled, update encryption status of all recipients
slotRecipientAdded
(
qobject_cast
<
MessageComposer
::
RecipientLineNG
*>
(
line
));
...
...
@@ -3420,7 +3422,8 @@ void KMComposerWin::slotRecipientEditorFocusChanged()
// (unless user enabled it manually), because we want to encrypt by default,
// but not by force
bool
encrypt
=
false
;
Q_FOREACH
(
auto
line_
,
mComposerBase
->
recipientsEditor
()
->
lines
())
{
const
auto
lst
=
mComposerBase
->
recipientsEditor
()
->
lines
();
for
(
auto
line_
:
lst
)
{
auto
line
=
qobject_cast
<
MessageComposer
::
RecipientLineNG
*>
(
line_
);
// There's still a lookup job running, so wait, slotKeyForMailBoxResult()
...
...
src/kmkernel.cpp
View file @
c55a8c66
...
...
@@ -536,7 +536,8 @@ void KMKernel::openReader(bool onlyCheck, bool startInTray)
{
KMainWindow
*
ktmw
=
nullptr
;
foreach
(
KMainWindow
*
window
,
KMainWindow
::
memberList
())
{
const
auto
lst
=
KMainWindow
::
memberList
();
for
(
KMainWindow
*
window
:
lst
)
{
if
(
::
qobject_cast
<
KMMainWin
*>
(
window
))
{
ktmw
=
window
;
break
;
...
...
@@ -685,7 +686,8 @@ bool KMKernel::showMail(qint64 serialNumber)
KMMainWidget
*
mainWidget
=
nullptr
;
// First look for a KMainWindow.
foreach
(
KMainWindow
*
window
,
KMainWindow
::
memberList
())
{
const
auto
lst
=
KMainWindow
::
memberList
();
for
(
KMainWindow
*
window
:
lst
)
{
// Then look for a KMMainWidget.
QList
<
KMMainWidget
*>
l
=
window
->
findChildren
<
KMMainWidget
*>
();
if
(
!
l
.
isEmpty
()
&&
l
.
first
())
{
...
...
@@ -1078,7 +1080,8 @@ void KMKernel::setFirstInstance(bool value)
void
KMKernel
::
closeAllKMailWindows
()
{
foreach
(
KMainWindow
*
window
,
KMainWindow
::
memberList
())
{
const
auto
lst
=
KMainWindow
::
memberList
();
for
(
KMainWindow
*
window
:
lst
)
{
if
(
::
qobject_cast
<
KMMainWin
*>
(
window
)
||
::
qobject_cast
<
KMail
::
SecondaryWindow
*>
(
window
))
{
// close and delete the window
...
...
@@ -1139,7 +1142,8 @@ void KMKernel::dumpDeadLetters()
}
// make all composer windows autosave their contents
foreach
(
KMainWindow
*
window
,
KMainWindow
::
memberList
())
{
const
auto
lst
=
KMainWindow
::
memberList
();
for
(
KMainWindow
*
window
:
lst
)
{
if
(
KMail
::
Composer
*
win
=
::
qobject_cast
<
KMail
::
Composer
*>
(
window
))
{
win
->
autoSaveMessage
(
true
);
...
...
@@ -1274,7 +1278,8 @@ JobScheduler *KMKernel::jobScheduler() const
KMainWindow
*
KMKernel
::
mainWin
()
{
// First look for a KMMainWin.
foreach
(
KMainWindow
*
window
,
KMainWindow
::
memberList
())
{
const
auto
lst
=
KMainWindow
::
memberList
();
for
(
KMainWindow
*
window
:
lst
)
{
if
(
::
qobject_cast
<
KMMainWin
*>
(
window
))
{
return
window
;
}
...
...
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