xcb: eradicate Q_FOREACH loops [already const]
... (or trivially marked const) local variables, parameters, or data members, by replacing them with C++11 range-for loops. Saves ~1.5KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: Ief6c0cbf08bcdcda28cb8ce6d72a13b7b6ac59c2 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>bb10
parent
654a5fe529
commit
a79c599df1
|
|
@ -168,7 +168,7 @@ static int ioErrorHandler(Display *dpy)
|
|||
|
||||
QXcbScreen* QXcbConnection::findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc) const
|
||||
{
|
||||
foreach (QXcbScreen *screen, m_screens) {
|
||||
for (QXcbScreen *screen : m_screens) {
|
||||
if (screen->root() == rootWindow && screen->crtc() == crtc)
|
||||
return screen;
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ QXcbScreen* QXcbConnection::findScreenForCrtc(xcb_window_t rootWindow, xcb_randr
|
|||
|
||||
QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output) const
|
||||
{
|
||||
foreach (QXcbScreen *screen, m_screens) {
|
||||
for (QXcbScreen *screen : m_screens) {
|
||||
if (screen->root() == rootWindow && screen->output() == output)
|
||||
return screen;
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_ran
|
|||
|
||||
QXcbVirtualDesktop* QXcbConnection::virtualDesktopForRootWindow(xcb_window_t rootWindow) const
|
||||
{
|
||||
foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) {
|
||||
for (QXcbVirtualDesktop *virtualDesktop : m_virtualDesktops) {
|
||||
if (virtualDesktop->screen()->root == rootWindow)
|
||||
return virtualDesktop;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -692,8 +692,8 @@ void QXcbKeyboard::updateKeymap()
|
|||
if (!xkb_context) {
|
||||
if (qEnvironmentVariableIsSet("QT_XKB_CONFIG_ROOT")) {
|
||||
xkb_context = xkb_context_new((xkb_context_flags)XKB_CONTEXT_NO_DEFAULT_INCLUDES);
|
||||
QList<QByteArray> xkbRootList = QByteArray(qgetenv("QT_XKB_CONFIG_ROOT")).split(':');
|
||||
foreach (const QByteArray &xkbRoot, xkbRootList)
|
||||
const QList<QByteArray> xkbRootList = QByteArray(qgetenv("QT_XKB_CONFIG_ROOT")).split(':');
|
||||
for (const QByteArray &xkbRoot : xkbRootList)
|
||||
xkb_context_include_path_append(xkb_context, xkbRoot.constData());
|
||||
} else {
|
||||
xkb_context = xkb_context_new((xkb_context_flags)0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue