diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2018-02-06 15:59:18 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2018-02-07 08:45:21 +0000 |
commit | 1ec660a399854937a276e0008ca59ea53d1051b3 (patch) | |
tree | 1a72df6a83275c218ce6f76cedf2c17ce70fa6bb | |
parent | 842f2ac90dc7bc570bd0009f9babe3df6416827b (diff) | |
download | qtapplicationmanager-1ec660a399854937a276e0008ca59ea53d1051b3.tar.gz |
Remove support for Qt 5.6, 5.7 and 5.8
We supported these old version as long as they wouldn't break new features,
but that is happening now: Qt < 5.9 does not support including enums of
unrelated C++ classes into the QML scope of another exported C++ class.
At least this will get rid of nearly all the ugly QT_VERSION #ifdefs we had.
Change-Id: I1bc4e9289e685eedb0af7b20e928ed550569196b
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r-- | 3rdparty/libarchive.pri | 18 | ||||
-rw-r--r-- | 3rdparty/libbacktrace.pri | 16 | ||||
-rw-r--r-- | 3rdparty/libyaml.pri | 17 | ||||
-rw-r--r-- | 3rdparty/libz.pri | 29 | ||||
-rw-r--r-- | application-manager.pro | 2 | ||||
-rw-r--r-- | doc/installation.qdoc | 2 | ||||
-rw-r--r-- | src/common-lib/dbus-utilities.cpp | 7 | ||||
-rw-r--r-- | src/common-lib/global.h | 20 | ||||
-rw-r--r-- | src/common-lib/logging.cpp | 11 | ||||
-rw-r--r-- | src/common-lib/qml-utilities.cpp | 9 | ||||
-rw-r--r-- | src/manager-lib/fakeapplicationmanagerwindow.cpp | 10 | ||||
-rw-r--r-- | src/window-lib/waylandcompositor.cpp | 159 | ||||
-rw-r--r-- | src/window-lib/waylandcompositor.h | 32 | ||||
-rw-r--r-- | src/window-lib/waylandcompositor_p.h | 5 | ||||
-rw-r--r-- | src/window-lib/windowmanager.cpp | 4 |
15 files changed, 21 insertions, 320 deletions
diff --git a/3rdparty/libarchive.pri b/3rdparty/libarchive.pri index eb352e2b..ad1e0bc6 100644 --- a/3rdparty/libarchive.pri +++ b/3rdparty/libarchive.pri @@ -2,23 +2,7 @@ include(libz.pri) !config_libarchive|no-system-libarchive { - lessThan(QT_MINOR_VERSION, 8) { - # this is the "old way" used by Qt <= 5.7 - load(fix-library-path) - - LIBARCHIVE_PATH = $$PWD/libarchive - LIBARCHIVE_BUILD_PATH = $$shadowed($$LIBARCHIVE_PATH) - - INCLUDEPATH += $$LIBARCHIVE_PATH/libarchive - LIBS_PRIVATE += $$fixLibraryPath(-L$$LIBARCHIVE_BUILD_PATH) -lqtarchive$$qtPlatformTargetSuffix() - - win32:DEFINES += LIBARCHIVE_STATIC - - CONFIG *= link_prl - } else { - # the "new way", starting with Qt 5.8 - QMAKE_USE_PRIVATE += archive - } + QMAKE_USE_PRIVATE += archive } else { PKGCONFIG_PRIVATE += "'libarchive >= 3.1.2'" CONFIG *= link_pkgconfig diff --git a/3rdparty/libbacktrace.pri b/3rdparty/libbacktrace.pri index 58ce43bf..ec9d1da8 100644 --- a/3rdparty/libbacktrace.pri +++ b/3rdparty/libbacktrace.pri @@ -1,16 +1,2 @@ -lessThan(QT_MINOR_VERSION, 8) { - # this is the "old way" used by Qt <= 5.7 - load(fix-library-path) - - LIBBACKTRACE_PATH = $$PWD/libbacktrace - LIBBACKTRACE_BUILD_PATH = $$shadowed($$LIBBACKTRACE_PATH) - - INCLUDEPATH += $$LIBBACKTRACE_PATH - LIBS_PRIVATE += $$fixLibraryPath(-L$$LIBBACKTRACE_BUILD_PATH) -lqtbacktrace$$qtPlatformTargetSuffix() - - CONFIG *= link_prl -} else { - # the "new way", starting with Qt 5.8 - QMAKE_USE_PRIVATE += backtrace -} +QMAKE_USE_PRIVATE += backtrace diff --git a/3rdparty/libyaml.pri b/3rdparty/libyaml.pri index 02e10ed5..bac439f0 100644 --- a/3rdparty/libyaml.pri +++ b/3rdparty/libyaml.pri @@ -1,21 +1,6 @@ !config_libyaml|no-system-libyaml { - lessThan(QT_MINOR_VERSION, 8) { - # this is the "old way" used by Qt <= 5.7 - load(fix-library-path) - - LIBYAML_PATH = $$PWD/libyaml - LIBYAML_BUILD_PATH = $$shadowed($$LIBYAML_PATH) - - DEFINES *= YAML_DECLARE_STATIC - INCLUDEPATH += $$LIBYAML_PATH/include - LIBS_PRIVATE += $$fixLibraryPath(-L$$LIBYAML_BUILD_PATH) -lqtyaml$$qtPlatformTargetSuffix() - - CONFIG *= link_prl - } else { - # the "new way", starting with Qt 5.8 - QMAKE_USE_PRIVATE += yaml - } + QMAKE_USE_PRIVATE += yaml } else { PKGCONFIG_PRIVATE += "'yaml-0.1 >= 0.1.6'" CONFIG *= link_pkgconfig diff --git a/3rdparty/libz.pri b/3rdparty/libz.pri index 7e4b8136..682bf410 100644 --- a/3rdparty/libz.pri +++ b/3rdparty/libz.pri @@ -1,29 +1,8 @@ # zlib dependency satisfied by bundled 3rd party zlib or system zlib -lessThan(QT_MINOR_VERSION, 8) { - # this is the "old way" used by Qt <= 5.7 +CONFIG *= qt - contains(QT_CONFIG, system-zlib) { - unix|mingw: LIBS_PRIVATE += -lz - else: LIBS += zdll.lib - } else { - CONFIG *= qt - QT *= core - - load(qt_build_paths) - git_build: { - INCLUDEPATH += $$[QT_INSTALL_HEADERS/get]/QtZlib - } else { - INCLUDEPATH += $$[QT_INSTALL_HEADERS/src]/QtZlib - } - } +qtConfig(system-zlib) { + QMAKE_USE_PRIVATE *= zlib } else { - # the "new way", starting with Qt 5.8 - - CONFIG *= qt - - qtConfig(system-zlib) { - QMAKE_USE_PRIVATE *= zlib - } else { - QT_PRIVATE *= core zlib-private - } + QT_PRIVATE *= core zlib-private } diff --git a/application-manager.pro b/application-manager.pro index 9d6f85a5..15cbf405 100644 --- a/application-manager.pro +++ b/application-manager.pro @@ -26,7 +26,7 @@ if(linux|force-libcrypto) { !if(contains(QT_CONFIG,"openssl")|contains(QT_CONFIG,"openssl-linked")|contains(QT_CONFIG,"ssl")):error("Qt was built without OpenSSL support.") } -MIN_MINOR=6 +MIN_MINOR=9 !equals(QT_MAJOR_VERSION, 5)|lessThan(QT_MINOR_VERSION, $$MIN_MINOR):error("This application needs to be built against Qt 5.$${MIN_MINOR}+") diff --git a/doc/installation.qdoc b/doc/installation.qdoc index 5748509e..3a59ed81 100644 --- a/doc/installation.qdoc +++ b/doc/installation.qdoc @@ -50,7 +50,7 @@ In order to build the application-manager with all its features, the following components are required: \list - \li \b Qt 5.6 or higher. + \li \b Qt 5.9.0 or higher. \li \b libyaml 1.6 or higher. \li \b openssl 1.0.1 or higher \e{- Linux only}. At compile time, only the headers need to be available. The needed libraries will be dynamically loaded at runtime. diff --git a/src/common-lib/dbus-utilities.cpp b/src/common-lib/dbus-utilities.cpp index 6952c63b..4ad1bebb 100644 --- a/src/common-lib/dbus-utilities.cpp +++ b/src/common-lib/dbus-utilities.cpp @@ -68,12 +68,7 @@ QVariant convertFromJSVariant(const QVariant &variant) } else if (type == QMetaType::QVariant) { // got a matryoshka variant return convertFromJSVariant(variant.value<QVariant>()); - } else if ((type == QMetaType::UnknownType) -# if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - || ((type == QMetaType::VoidStar) && (qvariant_cast<void *>(variant) == nullptr))) { -# else - || (type == QMetaType::Nullptr)) { -#endif + } else if ((type == QMetaType::UnknownType) || (type == QMetaType::Nullptr)) { // we cannot send QVariant::Invalid and null values via DBus, so we abuse BYTE(0) for this purpose return QVariant::fromValue<uchar>(0); } else if (type == QMetaType::QVariantList) { diff --git a/src/common-lib/global.h b/src/common-lib/global.h index 11c03231..5ef78a56 100644 --- a/src/common-lib/global.h +++ b/src/common-lib/global.h @@ -56,23 +56,3 @@ QT_END_NAMESPACE_AM #define qL1C(x) QLatin1Char(x) #define qSL(x) QStringLiteral(x) -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -namespace QtPrivate { -template <typename T> struct QAddConst { typedef const T Type; }; -} - -// this adds const to non-const objects (like std::as_const) -template <typename T> -Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } -// prevent rvalue arguments: -template <typename T> -void qAsConst(const T &&) Q_DECL_EQ_DELETE; -#endif - -#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) -# if (defined(Q_CC_GNU) && Q_CC_GNU >= 700) && !defined(Q_CC_INTEL) -# define Q_FALLTHROUGH() __attribute__((fallthrough)) -# else -# define Q_FALLTHROUGH() (void)0 -# endif -#endif diff --git a/src/common-lib/logging.cpp b/src/common-lib/logging.cpp index 42af5482..a3e2237d 100644 --- a/src/common-lib/logging.cpp +++ b/src/common-lib/logging.cpp @@ -226,18 +226,7 @@ static void colorLogToStderr(QtMsgType msgType, const QMessageLogContext &contex while (spacing < 0) spacing += consoleWidth; } -#if QT_VERSION < QT_VERSION_CHECK(5,7,0) - // efficiently appending spaces without allocating is hard in Qt 5.6 - static const char spacingStr[] = " "; - Q_STATIC_ASSERT(sizeof(spacingStr) == 80); - while (spacing > 0) { - int spacingLen = qMin(spacing, int(sizeof(spacingStr)) - 1); - out.append(spacingStr, spacingLen); - spacing -= spacingLen; - } -#else out.append(spacing, ' '); -#endif out.append('['); color(out, Magenta); diff --git a/src/common-lib/qml-utilities.cpp b/src/common-lib/qml-utilities.cpp index 53f3a069..b232bd92 100644 --- a/src/common-lib/qml-utilities.cpp +++ b/src/common-lib/qml-utilities.cpp @@ -83,14 +83,7 @@ void fixNullValuesForQml(QVariant &v) break; } case QVariant::Invalid: { - QVariant v2 = -#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - // QML < 5.8 expects null values in this format - QVariant(QMetaType::VoidStar, (void *) 0); -#else - // QML >= 5.8 expects null values in this format - QVariant::fromValue(nullptr); -#endif + QVariant v2 = QVariant::fromValue(nullptr); qSwap(v.data_ptr(), v2.data_ptr()); break; } diff --git a/src/manager-lib/fakeapplicationmanagerwindow.cpp b/src/manager-lib/fakeapplicationmanagerwindow.cpp index ffa65051..7a4ca15a 100644 --- a/src/manager-lib/fakeapplicationmanagerwindow.cpp +++ b/src/manager-lib/fakeapplicationmanagerwindow.cpp @@ -266,11 +266,7 @@ QJSValue FakeApplicationManagerWindow::getUndefined() const void FakeApplicationManagerWindow::referenceError(const char *symbol) const { -#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) - qWarning().noquote() << "ReferenceError:" << symbol << "is not defined"; -#else - qmlWarning(this) << "ReferenceError: " << symbol << " is not defined"; -#endif + qmlWarning(this) << "ReferenceError: " << symbol << " is not defined"; } void FakeApplicationManagerWindow::grabToImage() const { referenceError("grabToImage"); } @@ -314,11 +310,7 @@ void FakeApplicationManagerWindow::connectNotify(const QMetaMethod &signal) QString name = qSL("on") + QString::fromUtf8(signal.name()); name[2] = name[2].toUpper(); -#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) - qWarning() << "QML ApplicationManagerWindow: Cannot assign to non-existent property" << name; -#else qmlWarning(this) << "Cannot assign to non-existent property \"" << name << "\""; -#endif } } diff --git a/src/window-lib/waylandcompositor.cpp b/src/window-lib/waylandcompositor.cpp index 4374a668..01ec2c3e 100644 --- a/src/window-lib/waylandcompositor.cpp +++ b/src/window-lib/waylandcompositor.cpp @@ -50,39 +50,15 @@ #include "applicationmanager.h" #include "waylandcompositor.h" -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -# include <QWaylandQuickSurface> -# include <QWaylandSurfaceItem> -# include <QWaylandClient> - -# include "window.h" -#else -# include <QWaylandWlShell> -# include <QWaylandQuickOutput> -# include <QWaylandTextInputManager> -# include <private/qwlextendedsurface_p.h> -# if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) -# include <QWaylandWindowManagerExtension> -typedef QWaylandWindowManagerExtension QWaylandQtWindowManager; -# else -# include <QWaylandQtWindowManager> -# endif -# include "waylandcompositor_p.h" -#endif +#include <QWaylandWlShell> +#include <QWaylandQuickOutput> +#include <QWaylandTextInputManager> +#include <private/qwlextendedsurface_p.h> +#include <QWaylandQtWindowManager> +#include "waylandcompositor_p.h" QT_BEGIN_NAMESPACE_AM -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -WindowSurface::WindowSurface(QWaylandSurface *surface) - : m_item(nullptr) - , m_surface(surface) -{ - connect(m_surface, &QObject::destroyed, [this]() { delete this; }); - connect(m_surface, &QWaylandSurface::pong, this, &WindowSurface::pong); - connect(m_surface, &QWaylandSurface::windowPropertyChanged, this, &WindowSurface::windowPropertyChanged); -} -#else - WindowSurface::WindowSurface(QWaylandCompositor *comp, QWaylandClient *client, uint id, int version) : QWaylandQuickSurface(comp, client, id, version) , m_surface(this) @@ -110,8 +86,6 @@ QWaylandWlShellSurface *WindowSurface::shellSurface() const return m_shellSurface; } -#endif - QWaylandSurface *WindowSurface::surface() const { @@ -130,16 +104,8 @@ qint64 WindowSurface::processId() const QWindow *WindowSurface::outputWindow() const { -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - if (QWaylandOutput *o = m_surface->mainOutput()) - return o->window(); -#elif QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - if (QWaylandView *v = m_surface->throttlingView()) - return v->output()->window(); -#else if (QWaylandView *v = m_surface->primaryView()) return v->output()->window(); -#endif return nullptr; } @@ -150,33 +116,20 @@ void WindowSurface::takeFocus() void WindowSurface::ping() { -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - m_surface->ping(); -#else m_shellSurface->ping(); -#endif } QVariantMap WindowSurface::windowProperties() const { -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - return m_surface->windowProperties(); -#else return m_extendedSurface ? m_extendedSurface->windowProperties() : QVariantMap(); -#endif } void WindowSurface::setWindowProperty(const QString &name, const QVariant &value) { -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - m_surface->setWindowProperty(name, value); -#else if (m_extendedSurface) m_extendedSurface->setWindowProperty(name, value); -#endif } -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) WindowSurfaceQuickItem::WindowSurfaceQuickItem(WindowSurface *windowSurface) : QWaylandQuickItem() @@ -202,22 +155,8 @@ void WindowSurfaceQuickItem::geometryChanged(const QRectF &newGeometry, const QR QWaylandQuickItem::geometryChanged(newGeometry, oldGeometry); } -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylandSocketName, WindowManager *manager) -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - : QWaylandQuickCompositor(qPrintable(waylandSocketName), DefaultExtensions | SubSurfaceExtension) - , m_manager(manager) -{ - registerOutputWindow(window); - window->winId(); - addDefaultShell(); - QObject::connect(window, &QQuickWindow::beforeSynchronizing, [this]() { frameStarted(); }); - QObject::connect(window, &QQuickWindow::afterRendering, [this]() { sendCallbacks(); }); - setOutputGeometry(window->geometry()); - -#else // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) : QWaylandQuickCompositor() , m_shell(new QWaylandWlShell(this)) , m_surfExt(new QtWayland::SurfaceExtensionGlobal(this)) @@ -227,11 +166,7 @@ WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylan setSocketName(waylandSocketName.toUtf8()); registerOutputWindow(window); -# if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - connect(this, &QWaylandCompositor::createSurface, this, &WaylandCompositor::doCreateSurface); -# else connect(this, &QWaylandCompositor::surfaceRequested, this, &WaylandCompositor::doCreateSurface); -# endif connect(this, &QWaylandCompositor::surfaceCreated, [this](QWaylandSurface *s) { connect(s, &QWaylandSurface::surfaceDestroyed, this, [this, s]() { m_manager->waylandSurfaceDestroyed(static_cast<WindowSurface *>(s)); @@ -239,11 +174,7 @@ WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylan m_manager->waylandSurfaceCreated(static_cast<WindowSurface *>(s)); }); -# if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - connect(m_shell, &QWaylandWlShell::createShellSurface, this, &WaylandCompositor::createShellSurface); -# else connect(m_shell, &QWaylandWlShell::wlShellSurfaceRequested, this, &WaylandCompositor::createShellSurface); -# endif connect(m_surfExt, &QtWayland::SurfaceExtensionGlobal::extendedSurfaceReady, this, &WaylandCompositor::extendedSurfaceReady); auto wmext = new QWaylandQtWindowManager(this); @@ -253,18 +184,13 @@ WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylan }); create(); -#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) } void WaylandCompositor::registerOutputWindow(QQuickWindow* window) { -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - createOutput(window, QString(), QString()); -#else auto output = new QWaylandQuickOutput(this, window); output->setSizeFollowsWindow(true); m_outputs.append(output); -#endif window->winId(); } @@ -272,17 +198,11 @@ QWaylandSurface *WaylandCompositor::waylandSurfaceFromItem(QQuickItem *surfaceIt { // QWaylandQuickItem::surface() will return a nullptr to WindowManager::waylandSurfaceDestroyed, // if the app crashed. We return our internal copy of that surface pointer instead. -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) - if (QWaylandSurfaceItem *item = qobject_cast<QWaylandSurfaceItem *>(surfaceItem)) - return item->surface(); -#else if (WindowSurfaceQuickItem *item = qobject_cast<WindowSurfaceQuickItem *>(surfaceItem)) return item->m_windowSurface->surface(); -#endif return nullptr; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) void WaylandCompositor::doCreateSurface(QWaylandClient *client, uint id, int version) { @@ -295,13 +215,8 @@ void WaylandCompositor::createShellSurface(QWaylandSurface *surface, const QWayl QWaylandWlShellSurface *ss = new QWaylandWlShellSurface(m_shell, windowSurface, resource); windowSurface->setShellSurface(ss); -#if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - connect(windowSurface, &QWaylandSurface::mappedChanged, this, [this, windowSurface]() { - if (windowSurface->isMapped()) -#else connect(windowSurface, &QWaylandSurface::hasContentChanged, this, [this, windowSurface]() { if (windowSurface->hasContent()) -#endif m_manager->waylandSurfaceMapped(windowSurface); else m_manager->waylandSurfaceUnmapped(windowSurface); @@ -314,66 +229,4 @@ void WaylandCompositor::extendedSurfaceReady(QtWayland::ExtendedSurface *ext, QW windowSurface->setExtendedSurface(ext); } -#else // if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - -void WaylandCompositor::surfaceCreated(QWaylandSurface *surface) -{ - WindowSurface *windowSurface = new WindowSurface(surface); - m_manager->waylandSurfaceCreated(windowSurface); - QObject::connect(surface, &QWaylandSurface::mapped, [windowSurface, surface, this]() { - windowSurface->m_item = static_cast<QWaylandSurfaceItem *>(surface->views().at(0)); - windowSurface->m_item->setResizeSurfaceToItem(true); - windowSurface->m_item->setTouchEventsEnabled(true); - m_manager->waylandSurfaceMapped(windowSurface); - }); - QObject::connect(surface, &QWaylandSurface::unmapped, [windowSurface, this]() { - m_manager->waylandSurfaceUnmapped(windowSurface); - }); - QObject::connect(surface, &QWaylandSurface::surfaceDestroyed, [windowSurface, this]() { - m_manager->waylandSurfaceDestroyed(windowSurface); - }); - -} - -bool WaylandCompositor::openUrl(QWaylandClient *client, const QUrl &url) -{ - if (ApplicationManager::instance()->fromProcessId(client->processId())) - return ApplicationManager::instance()->openUrl(url.toString()); - return false; -} - -void WaylandCompositor::sendCallbacks() -{ - QList<QWaylandSurface *> listToSend; - - // TODO: optimize! no need to send this to hidden/minimized/offscreen/etc. surfaces - const auto windows = m_manager->windows(); - for (const Window *win : windows) { - if (!win->isClosing() && !win->isInProcess()) { - if (QWaylandSurface *surface = waylandSurfaceFromItem(win->windowItem())) { - listToSend << surface; - } - } - } - - if (!listToSend.isEmpty()) - sendFrameCallbacks(listToSend); -} - -const char *WaylandCompositor::socketName() const -{ - static QByteArray sn; - if (sn.isEmpty()) { - sn = QWaylandCompositor::socketName(); - if (sn.isEmpty()) { - sn = qgetenv("WAYLAND_DISPLAY"); - if (sn.isEmpty()) - sn = "wayland-0"; - } - } - return sn.constData(); -} - -#endif // if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - QT_END_NAMESPACE_AM diff --git a/src/window-lib/waylandcompositor.h b/src/window-lib/waylandcompositor.h index 79f863e1..c1884d12 100644 --- a/src/window-lib/waylandcompositor.h +++ b/src/window-lib/waylandcompositor.h @@ -49,9 +49,8 @@ #include <QWaylandQuickCompositor> #include <QtAppManWindow/windowmanager.h> -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) -# include <QWaylandQuickSurface> -# include <QWaylandQuickItem> +#include <QWaylandQuickSurface> +#include <QWaylandQuickItem> QT_FORWARD_DECLARE_CLASS(QWaylandResource) QT_FORWARD_DECLARE_CLASS(QWaylandWlShell) @@ -64,13 +63,6 @@ class SurfaceExtensionGlobal; } QT_END_NAMESPACE -#else // QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) -# include <QtAppManWindow/windowmanager.h> - -QT_FORWARD_DECLARE_CLASS(QWaylandSurfaceItem) - -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - QT_BEGIN_NAMESPACE_AM class WindowSurfaceQuickItem; @@ -79,17 +71,6 @@ class WindowSurfaceQuickItem; // Not every WindowSurface maybe an application's Window though - those that are, are available // through the WindowManager model. -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -class WindowSurface : public QObject -{ - Q_OBJECT -public: - WindowSurface(QWaylandSurface *surface); - -private: - QWaylandSurfaceItem *m_item; - -#else class WindowSurface : public QWaylandQuickSurface { Q_OBJECT @@ -105,7 +86,6 @@ private: WindowSurfaceQuickItem *m_item = nullptr; QWaylandWlShellSurface *m_shellSurface = nullptr; QtWayland::ExtendedSurface *m_extendedSurface = nullptr; -#endif public: QWaylandSurface *surface() const; @@ -137,7 +117,6 @@ public: QWaylandSurface *waylandSurfaceFromItem(QQuickItem *surfaceItem) const; protected: -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) void doCreateSurface(QWaylandClient *client, uint id, int version); void createShellSurface(QWaylandSurface *surface, const QWaylandResource &resource); void extendedSurfaceReady(QtWayland::ExtendedSurface *ext, QWaylandSurface *surface); @@ -146,13 +125,6 @@ protected: QVector<QWaylandOutput *> m_outputs; QtWayland::SurfaceExtensionGlobal *m_surfExt; QWaylandTextInputManager *m_textInputManager; -#else - void surfaceCreated(QWaylandSurface *surface) override; - bool openUrl(QWaylandClient *client, const QUrl &url) override; - void sendCallbacks(); -public: - const char *socketName() const; // we need to shadow the base class' version, since it is broken -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) private: WindowManager *m_manager; diff --git a/src/window-lib/waylandcompositor_p.h b/src/window-lib/waylandcompositor_p.h index 6f645138..322b229a 100644 --- a/src/window-lib/waylandcompositor_p.h +++ b/src/window-lib/waylandcompositor_p.h @@ -43,9 +43,7 @@ #pragma once #include <QtAppManCommon/global.h> - -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) -# include <QWaylandQuickItem> +#include <QWaylandQuickItem> QT_BEGIN_NAMESPACE_AM @@ -63,5 +61,4 @@ public: QT_END_NAMESPACE_AM -#endif // We mean it. Dummy comment since syncqt needs this also for completely private Qt modules. diff --git a/src/window-lib/windowmanager.cpp b/src/window-lib/windowmanager.cpp index 2502c158..41968aca 100644 --- a/src/window-lib/windowmanager.cpp +++ b/src/window-lib/windowmanager.cpp @@ -518,11 +518,7 @@ QVariant WindowManager::data(const QModelIndex &index, int role) const #if defined(AM_MULTI_PROCESS) auto ww = qobject_cast<const WaylandWindow*>(win); if (ww && ww->surface() && ww->surface()->surface()) -# if QT_VERSION < QT_VERSION_CHECK(5, 8, 0) - return ww->surface()->surface()->isMapped(); -# else return ww->surface()->surface()->hasContent(); -# endif #endif return false; } |