Require Qt 5.7 and remove pre-5.7 code

Summary:
Increases minimum Qt version to 5.7. This allows to drop the pre-5.7
virtual keyboard and various ifdefs for now unsupported versions.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4485
This commit is contained in:
Martin Gräßlin 2017-02-07 20:31:22 +01:00
parent 0fcbf4bafb
commit 16647c3a3c
12 changed files with 3 additions and 78 deletions

View file

@ -3,7 +3,7 @@ set(PROJECT_VERSION "5.9.90")
set(PROJECT_VERSION_MAJOR 5)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.5.0")
set(QT_MIN_VERSION "5.7.0")
set(KF5_MIN_VERSION "5.26.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} )

View file

@ -177,10 +177,6 @@ int main(int argc, char *argv[]) \
return QTest::qExec(&tc, argc, argv); \
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
#define WAYLANDTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject, QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling) )
#else
#define WAYLANDTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject,)
#endif
#endif

View file

@ -297,13 +297,6 @@ void TestScreenEdges::testCreatingInitialEdges()
// approach windows for edges not created as screen too small
s->updateLayout();
auto edgeWindows = s->windows();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 1))
if (!Xcb::Extensions::self()->isRandrAvailable()) {
QEXPECT_FAIL("", "Broken on no xrandr systems in Qt 5.5", Abort);
}
#endif
#endif
QCOMPARE(edgeWindows.size(), 12);
auto testWindowGeometry = [&](int index) {
@ -422,13 +415,6 @@ void TestScreenEdges::testCallback()
auto it = std::find_if(edges.constBegin(), edges.constEnd(), [](Edge *e) {
return e->isScreenEdge() && e->isLeft() && e->approachGeometry().bottom() < 768;
});
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 1))
if (!Xcb::Extensions::self()->isRandrAvailable()) {
QEXPECT_FAIL("", "Broken on no xrandr systems in Qt 5.5", Abort);
}
#endif
#endif
QVERIFY(it != edges.constEnd());
xcb_enter_notify_event_t event;

View file

@ -68,9 +68,7 @@ static void xkbLogHandler(xkb_context *context, xkb_log_level priority, const ch
qCDebug(KWIN_XKB) << "XKB:" << buf;
break;
case XKB_LOG_LEVEL_INFO:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
qCInfo(KWIN_XKB) << "XKB:" << buf;
#endif
break;
case XKB_LOG_LEVEL_WARNING:
qCWarning(KWIN_XKB) << "XKB:" << buf;

View file

@ -44,9 +44,7 @@ static void libinputLogHandler(libinput *libinput, libinput_log_priority priorit
qCDebug(KWIN_LIBINPUT) << "Libinput:" << buf;
break;
case LIBINPUT_LOG_PRIORITY_INFO:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
qCInfo(KWIN_LIBINPUT) << "Libinput:" << buf;
#endif
break;
case LIBINPUT_LOG_PRIORITY_ERROR:
default:

View file

@ -468,9 +468,7 @@ int main(int argc, char * argv[])
qunsetenv("QT_DEVICE_PIXEL_RATIO");
qputenv("QT_IM_MODULE", "qtvirtualkeyboard");
qputenv("QSG_RENDER_LOOP", "basic");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
#endif
KWin::ApplicationWayland a(argc, argv);
a.setupTranslator();
// reset QT_QPA_PLATFORM to a sane value for any processes started from KWin

View file

@ -406,9 +406,7 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
setenv("QT_QPA_PLATFORM", "xcb", true);
qunsetenv("QT_DEVICE_PIXEL_RATIO");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
#endif
KWin::ApplicationX11 a(argc, argv);
a.setupTranslator();

View file

@ -119,17 +119,10 @@ QSurfaceFormat AbstractPlatformContext::format() const
return m_format;
}
#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
QFunctionPointer AbstractPlatformContext::getProcAddress(const QByteArray &procName)
{
return eglGetProcAddress(procName.constData());
}
#else
QFunctionPointer AbstractPlatformContext::getProcAddress(const char *procName)
{
return eglGetProcAddress(procName);
}
#endif
bool AbstractPlatformContext::isValid() const
{

View file

@ -39,11 +39,7 @@ public:
void doneCurrent() override;
QSurfaceFormat format() const override;
bool isValid() const override;
#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
QFunctionPointer getProcAddress(const QByteArray &procName) override;
#else
QFunctionPointer getProcAddress(const char *procName) override;
#endif
protected:
EGLDisplay eglDisplay() const {

View file

@ -227,9 +227,7 @@ void Integration::initializeWayland()
void Integration::createWaylandOutput(quint32 name, quint32 version)
{
if (m_dummyScreen) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
destroyScreen(m_dummyScreen);
#endif
m_dummyScreen = nullptr;
}
using namespace KWayland::Client;

View file

@ -1,32 +0,0 @@
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2016 Martin Gräßlin <mgraesslin@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 2.0
import QtQuick.Enterprise.VirtualKeyboard 2.0
Item {
id: window
InputPanel {
id: inputPanel
objectName: "inputPanel"
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}

View file

@ -72,12 +72,8 @@ void VirtualKeyboard::init()
m_inputWindow->setResizeMode(QQuickView::SizeRootObjectToView);
m_inputWindow->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/virtualkeyboard/main.qml"))));
if (m_inputWindow->status() != QQuickView::Status::Ready) {
// try enterprise
m_inputWindow->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/virtualkeyboard/main-enterprise.qml"))));
if (m_inputWindow->status() != QQuickView::Status::Ready) {
m_inputWindow.reset();
return;
}
m_inputWindow.reset();
return;
}
m_inputWindow->setProperty("__kwin_input_method", true);