From eee2ace6a107bf4872b29e8b8519abf30ffa8feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Thu, 27 Jul 2017 21:51:47 +0200 Subject: [PATCH] Make Q_FALLTHROUGH code compile with Qt < 5.8 sorry for breaking FreeBSD CI build. I didn't expect Q_FALLTHROUGH being newer. --- .../aurorae/themes/plastik/code/plastikbutton.cpp | 6 ++++++ plugins/platforms/x11/standalone/x11_platform.cpp | 6 ++++++ scene_opengl.cpp | 2 ++ 3 files changed, 14 insertions(+) diff --git a/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp b/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp index 51720ecb15..e4d03a910d 100644 --- a/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp +++ b/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp @@ -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: { diff --git a/plugins/platforms/x11/standalone/x11_platform.cpp b/plugins/platforms/x11/standalone/x11_platform.cpp index 24d7a51bbb..b6a9150c1e 100644 --- a/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/plugins/platforms/x11/standalone/x11_platform.cpp @@ -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; diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 21816f12de..991b6ffef5 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -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: