Commit eee2ace6 authored by Martin Flöser's avatar Martin Flöser

Make Q_FALLTHROUGH code compile with Qt < 5.8

sorry for breaking FreeBSD CI build. I didn't expect Q_FALLTHROUGH being
newer.
parent a13ecb1c
......@@ -281,7 +281,9 @@ QPixmap PlastikButtonProvider::icon(ButtonIcon icon, int size, bool active, bool
drawObject(p, HorizontalLine, r.x()+(r.width()-lwMark)/2, r.y()+(r.height()-lwMark)/2, lwMark, lwMark);
// Fall through to OnAllDesktopsIcon intended!
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
}
case OnAllDesktopsIcon:
{
......@@ -307,7 +309,9 @@ QPixmap PlastikButtonProvider::icon(ButtonIcon icon, int size, bool active, bool
drawObject(p, HorizontalLine, center-(lwArrow-2), r.y()+2*lwArrow, (lwArrow-2)*2, lwArrow);
// Fall through to KeepAboveIcon intended!
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
}
case KeepAboveIcon:
{
......@@ -333,7 +337,9 @@ QPixmap PlastikButtonProvider::icon(ButtonIcon icon, int size, bool active, bool
drawObject(p, HorizontalLine, center-(lwArrow-2), r.bottom()-(lwArrow-1)-2*lwArrow, (lwArrow-2)*2, lwArrow);
// Fall through to KeepBelowIcon intended!
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
}
case KeepBelowIcon:
{
......
......@@ -97,7 +97,9 @@ OpenGLBackend *X11StandalonePlatform::createOpenGLBackend()
} else {
qCWarning(KWIN_X11STANDALONE) << "Glx not available, trying EGL instead.";
// no break, needs fall-through
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
}
#endif
case EglPlatformInterface:
......@@ -212,7 +214,9 @@ void X11StandalonePlatform::createOpenGLSafePoint(OpenGLSafePoint safePoint)
group.writeEntry(unsafeKey, true);
group.sync();
// Deliberately continue with PreFrame
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
case OpenGLSafePoint::PreFrame:
if (m_openGLFreezeProtectionThread == nullptr) {
Q_ASSERT(m_openGLFreezeProtection == nullptr);
......@@ -241,7 +245,9 @@ void X11StandalonePlatform::createOpenGLSafePoint(OpenGLSafePoint safePoint)
group.writeEntry(unsafeKey, false);
group.sync();
// Deliberately continue with PostFrame
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
case OpenGLSafePoint::PostFrame:
QMetaObject::invokeMethod(m_openGLFreezeProtection, "stop", Qt::QueuedConnection);
break;
......
......@@ -525,7 +525,9 @@ void SceneOpenGL::initDebugOutput()
if (strstr(message, "Buffer detailed info:") && strstr(message, "has been updated"))
scheduleVboReInit();
// fall through! for general message printing
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
Q_FALLTHROUGH();
#endif
case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
case GL_DEBUG_TYPE_PORTABILITY:
case GL_DEBUG_TYPE_PERFORMANCE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment