Don't rely on implicit QScopedPointer to bool conversion

No longer available in Qt6.
This commit is contained in:
Volker Krause 2022-03-09 17:44:39 +01:00 committed by Vlad Zahorodnii
parent 1fd1c03742
commit 9d9e89fb84
6 changed files with 8 additions and 8 deletions

View file

@ -133,7 +133,7 @@ bool EglGbmLayer::endRendering(const QRegion &damagedRegion)
m_currentBuffer = buffer; m_currentBuffer = buffer;
m_currentDamage = damagedRegion; m_currentDamage = damagedRegion;
} }
return buffer; return !buffer.isNull();
} }
QRegion EglGbmLayer::currentDamage() const QRegion EglGbmLayer::currentDamage() const

View file

@ -387,12 +387,12 @@ void WaylandInputDevice::setLeds(LEDs leds)
bool WaylandInputDevice::isKeyboard() const bool WaylandInputDevice::isKeyboard() const
{ {
return m_keyboard; return !m_keyboard.isNull();
} }
bool WaylandInputDevice::isAlphaNumericKeyboard() const bool WaylandInputDevice::isAlphaNumericKeyboard() const
{ {
return m_keyboard; return !m_keyboard.isNull();
} }
bool WaylandInputDevice::isPointer() const bool WaylandInputDevice::isPointer() const
@ -407,7 +407,7 @@ bool WaylandInputDevice::isTouchpad() const
bool WaylandInputDevice::isTouch() const bool WaylandInputDevice::isTouch() const
{ {
return m_touch; return !m_touch.isNull();
} }
bool WaylandInputDevice::isTabletTool() const bool WaylandInputDevice::isTabletTool() const

View file

@ -783,7 +783,7 @@ QString ScreenShotDBusInterface1::screenshotArea(int x, int y, int width, int he
bool ScreenShotDBusInterface1::isTakingScreenshot() const bool ScreenShotDBusInterface1::isTakingScreenshot() const
{ {
return m_source; return !m_source.isNull();
} }
void ScreenShotDBusInterface1::showInfoMessage(InfoMessageMode mode) void ScreenShotDBusInterface1::showInfoMessage(InfoMessageMode mode)

View file

@ -237,7 +237,7 @@ void OffscreenQuickView::update()
return; return;
} }
bool usingGl = d->m_glcontext; bool usingGl = !d->m_glcontext.isNull();
if (usingGl) { if (usingGl) {
if (!d->m_glcontext->makeCurrent(d->m_offscreenSurface.data())) { if (!d->m_glcontext->makeCurrent(d->m_offscreenSurface.data())) {

View file

@ -21,7 +21,7 @@ OpenGLSurfaceTexture::~OpenGLSurfaceTexture()
bool OpenGLSurfaceTexture::isValid() const bool OpenGLSurfaceTexture::isValid() const
{ {
return m_texture; return !m_texture.isNull();
} }
OpenGLBackend *OpenGLSurfaceTexture::backend() const OpenGLBackend *OpenGLSurfaceTexture::backend() const

View file

@ -284,7 +284,7 @@ bool ScreenCastStream::createStream()
int n_params; int n_params;
auto canCreateDmaBuf = [this] () -> bool { auto canCreateDmaBuf = [this] () -> bool {
return QSharedPointer<DmaBufTexture>(kwinApp()->platform()->createDmaBufTexture(m_resolution)); return !QSharedPointer<DmaBufTexture>(kwinApp()->platform()->createDmaBufTexture(m_resolution)).isNull();
}; };
const auto format = m_source->hasAlphaChannel() ? SPA_VIDEO_FORMAT_BGRA : SPA_VIDEO_FORMAT_BGR; const auto format = m_source->hasAlphaChannel() ? SPA_VIDEO_FORMAT_BGRA : SPA_VIDEO_FORMAT_BGR;