diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-04-25 11:04:20 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-04-26 13:28:19 +0000 |
commit | ee2e441018aa390de1edfdc03909272771e4835c (patch) | |
tree | b762201e0909f082d138d6a59ac7aab3cf2925a4 /src/plugins/platforms | |
parent | 80fd691340e0e7c43a6216dc37a01e3a6509606e (diff) |
QXcbConnection: add some qAsConst()
... to prevent hidden detach(es| attempts).
Saves ~160b in text size on optimized GCC 6.0
Linux AMD64 builds.
Change-Id: I74e1f1304c522b9a4349918e99f562853ec8684e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index c4e929ebf1..8626606713 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -287,7 +287,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) } } - qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); + qCDebug(lcQpaScreen) << "primary output is" << qAsConst(m_screens).first()->name(); } } @@ -322,7 +322,7 @@ void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_cha // If the screen became primary, reshuffle the order in QGuiApplicationPrivate const int idx = m_screens.indexOf(screen); if (idx > 0) { - m_screens.first()->setPrimary(false); + qAsConst(m_screens).first()->setPrimary(false); m_screens.swap(0, idx); } screen->virtualDesktop()->setPrimaryScreen(screen); @@ -342,7 +342,7 @@ QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop, if (screen->isPrimary()) { if (!m_screens.isEmpty()) - m_screens.first()->setPrimary(false); + qAsConst(m_screens).first()->setPrimary(false); m_screens.prepend(screen); } else { @@ -529,7 +529,7 @@ void QXcbConnection::initializeScreens() } else { // Ensure the primary screen is first on the list if (primaryScreen) { - if (m_screens.first() != primaryScreen) { + if (qAsConst(m_screens).first() != primaryScreen) { m_screens.removeOne(primaryScreen); m_screens.prepend(primaryScreen); } @@ -541,7 +541,7 @@ void QXcbConnection::initializeScreens() QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); } - qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); + qCDebug(lcQpaScreen) << "primary output is" << qAsConst(m_screens).first()->name(); } } @@ -1013,8 +1013,8 @@ void QXcbConnection::handleXcbError(xcb_generic_error_t *error) } } if (i == m_callLog.size() && !m_callLog.isEmpty()) - qDebug("Caused some time after: %s:%d", m_callLog.first().file.constData(), - m_callLog.first().line); + qDebug("Caused some time after: %s:%d", qAsConst(m_callLog).first().file.constData(), + qAsConst(m_callLog).first().line); #endif } |