Mark QNX plugin as free of Q_FOREACH, except where it isn't

The density of Q_FOREACH uses is high here, too high for this author
to tackle in a short amount of time. But they're concentrated in just
a few TUs, so pick a different strategy:

Mark the whole plugin with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. Since the TUs are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too).

Task-number: QTBUG-115839
Change-Id: I42c26cb5d95add115e57cc484a0e1a93ed368ddd
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
This commit is contained in:
Marc Mutz 2023-08-07 17:42:52 +02:00
parent 73fd7f2d4a
commit 574aa256cf
6 changed files with 18 additions and 0 deletions

View File

@ -31,6 +31,14 @@ qt_internal_add_plugin(QQnxIntegrationPlugin
qqnxscreeneventthread.cpp qqnxscreeneventthread.h
qqnxservices.cpp qqnxservices.h
qqnxwindow.cpp qqnxwindow.h
NO_PCH_SOURCES
qqnxclipboard.cpp # undef QT_NO_FOREACH
qqnxintegration.cpp # undef QT_NO_FOREACH
qqnxscreen.cpp # undef QT_NO_FOREACH
qqnxscreeneventhandler.cpp # undef QT_NO_FOREACH
qqnxwindow.cpp # undef QT_NO_FOREACH
DEFINES
QT_NO_FOREACH
LIBRARIES
Qt::Core
Qt::CorePrivate

View File

@ -1,6 +1,8 @@
// Copyright (C) 2011 - 2012 Research In Motion
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#if !defined(QT_NO_CLIPBOARD)
#include "qqnxclipboard.h"

View File

@ -1,6 +1,8 @@
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "qqnxglobal.h"
#include "qqnxintegration.h"

View File

@ -1,6 +1,8 @@
// Copyright (C) 2011 - 2013 BlackBerry Limited. All rights reserved.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "qqnxglobal.h"
#include "qqnxscreen.h"

View File

@ -1,6 +1,8 @@
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "qqnxglobal.h"
#include "qqnxscreeneventhandler.h"

View File

@ -1,6 +1,8 @@
// Copyright (C) 2011 - 2013 BlackBerry Limited. All rights reserved.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include "qqnxglobal.h"
#include "qqnxwindow.h"