Fix compilation with QT_NO_WARNING_OUTPUT

Use qCWarning instead of qWarning if logging into a category. This
fixes compilation with QT_NO_WARNING_OUPUT, but in addition also
avoids unnecessary string formatting if the category is disabled.

Fixes: QTBUG-74359
Change-Id: I0e316a833f3f7d4a9122377a1154e739bcb080b1
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
Kai Koehne 2019-03-22 11:24:27 +01:00
parent 5098f9f6e7
commit 3d147d01e3
2 changed files with 15 additions and 14 deletions

View File

@ -316,7 +316,7 @@ void QWaylandInputDevice::Pointer::updateCursorTheme()
while (scale > 1 && arrowPixelSize / scale < cursorSize()) while (scale > 1 && arrowPixelSize / scale < cursorSize())
--scale; --scale;
} else { } else {
qWarning(lcQpaWayland) << "Cursor theme does not support the arrow cursor"; qCWarning(lcQpaWayland) << "Cursor theme does not support the arrow cursor";
} }
mCursor.themeBufferScale = scale; mCursor.themeBufferScale = scale;
} }
@ -585,9 +585,9 @@ void QWaylandInputDevice::Pointer::pointer_enter(uint32_t serial, struct wl_surf
QWaylandWindow *window = QWaylandWindow::fromWlSurface(surface); QWaylandWindow *window = QWaylandWindow::fromWlSurface(surface);
if (mFocus) { if (mFocus) {
qWarning(lcQpaWayland) << "The compositor sent a wl_pointer.enter event before sending a" qCWarning(lcQpaWayland) << "The compositor sent a wl_pointer.enter event before sending a"
<< "leave event first, this is not allowed by the wayland protocol" << "leave event first, this is not allowed by the wayland protocol"
<< "attempting to work around it by invalidating the current focus"; << "attempting to work around it by invalidating the current focus";
invalidateFocus(); invalidateFocus();
} }
mFocus = window; mFocus = window;

View File

@ -487,11 +487,11 @@ void QWaylandWindow::surface_enter(wl_output *output)
auto addedScreen = QWaylandScreen::fromWlOutput(output); auto addedScreen = QWaylandScreen::fromWlOutput(output);
if (mScreens.contains(addedScreen)) { if (mScreens.contains(addedScreen)) {
qWarning(lcQpaWayland) << "Ignoring unexpected wl_surface.enter received for output with id:" qCWarning(lcQpaWayland)
<< wl_proxy_get_id(reinterpret_cast<wl_proxy *>(output)) << "Ignoring unexpected wl_surface.enter received for output with id:"
<< "screen name:" << addedScreen->name() << wl_proxy_get_id(reinterpret_cast<wl_proxy *>(output))
<< "screen model:" << addedScreen->model() << "screen name:" << addedScreen->name() << "screen model:" << addedScreen->model()
<< "This is most likely a bug in the compositor."; << "This is most likely a bug in the compositor.";
return; return;
} }
@ -508,11 +508,12 @@ void QWaylandWindow::surface_leave(wl_output *output)
auto *removedScreen = QWaylandScreen::fromWlOutput(output); auto *removedScreen = QWaylandScreen::fromWlOutput(output);
bool wasRemoved = mScreens.removeOne(removedScreen); bool wasRemoved = mScreens.removeOne(removedScreen);
if (!wasRemoved) { if (!wasRemoved) {
qWarning(lcQpaWayland) << "Ignoring unexpected wl_surface.leave received for output with id:" qCWarning(lcQpaWayland)
<< wl_proxy_get_id(reinterpret_cast<wl_proxy *>(output)) << "Ignoring unexpected wl_surface.leave received for output with id:"
<< "screen name:" << removedScreen->name() << wl_proxy_get_id(reinterpret_cast<wl_proxy *>(output))
<< "screen model:" << removedScreen->model() << "screen name:" << removedScreen->name()
<< "This is most likely a bug in the compositor."; << "screen model:" << removedScreen->model()
<< "This is most likely a bug in the compositor.";
return; return;
} }