diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-02-27 11:32:15 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-02-27 17:03:41 +0000 |
commit | c4bd9198b4a0fac809903dd2c09276c2c3c1b22e (patch) | |
tree | 83325fe11d258c922ede480e0ad3de3df45032fa /src/compositor | |
parent | 72999738489b5251d025c954a77c93e8e1fdfd9d (diff) |
Init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file \
-checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \
-config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \
-header-filter='qtwayland' \
-fix
Afterwards I ran search and replace on the diff to clean up some whitespace errors:
- Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: '
- Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, '
- Replaced '\n\+\s*\n' with '\n'
I also had to do some manual edits, because for some reason, this particular
clang-tidy check doesn't trigger for some files.
Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/compositor')
57 files changed, 165 insertions, 375 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 289af2f38..ae5ed1ec1 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -148,15 +148,6 @@ public: } // namespace QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) - : display(nullptr) -#if QT_CONFIG(opengl) - , use_hw_integration_extension(true) - , client_buffer_integration(nullptr) - , server_buffer_integration(nullptr) -#endif - , retainSelection(false) - , preInitialized(false) - , initialized(false) { if (QGuiApplication::platformNativeInterface()) display = static_cast<wl_display*>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); diff --git a/src/compositor/compositor_api/qwaylandcompositor_p.h b/src/compositor/compositor_api/qwaylandcompositor_p.h index 18595a806..b1959e68f 100644 --- a/src/compositor/compositor_api/qwaylandcompositor_p.h +++ b/src/compositor/compositor_api/qwaylandcompositor_p.h @@ -128,7 +128,7 @@ protected: void loadServerBufferIntegration(); QByteArray socket_name; - struct wl_display *display; + struct wl_display *display = nullptr; QList<QWaylandSeat *> seats; QList<QWaylandOutput *> outputs; @@ -147,7 +147,7 @@ protected: QList<QWaylandClient *> clients; #if QT_CONFIG(opengl) - bool use_hw_integration_extension; + bool use_hw_integration_extension = true; QScopedPointer<QtWayland::HardwareIntegration> hw_integration; QScopedPointer<QtWayland::ClientBufferIntegration> client_buffer_integration; QScopedPointer<QtWayland::ServerBufferIntegration> server_buffer_integration; @@ -155,9 +155,9 @@ protected: QScopedPointer<QWindowSystemEventHandler> eventHandler; - bool retainSelection; - bool preInitialized; - bool initialized; + bool retainSelection = false; + bool preInitialized = false; + bool initialized = false; QList<QPointer<QObject> > polish_objects; Q_DECLARE_PUBLIC(QWaylandCompositor) diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index 69e5971eb..a443502fa 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -150,11 +150,9 @@ void QWaylandInputMethodControl::defaultSeatChanged() } QWaylandInputMethodControlPrivate::QWaylandInputMethodControlPrivate(QWaylandSurface *surface) - : QObjectPrivate() - , compositor(surface->compositor()) + : compositor(surface->compositor()) , seat(compositor->defaultSeat()) , surface(surface) - , enabled(false) { } diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h index aedff6486..337cf0087 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h @@ -72,10 +72,10 @@ public: QWaylandTextInput *textInput() const; - QWaylandCompositor *compositor; - QWaylandSeat *seat; - QWaylandSurface *surface; - bool enabled; + QWaylandCompositor *compositor = nullptr; + QWaylandSeat *seat = nullptr; + QWaylandSurface *surface = nullptr; + bool enabled = false; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index e35c0f371..7ab8bff9e 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -59,22 +59,7 @@ QT_BEGIN_NAMESPACE QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) - : QtWaylandServer::wl_keyboard() - , seat(seat) - , focus() - , focusResource() - , keys() - , modsDepressed() - , modsLatched() - , modsLocked() - , group() - , pendingKeymap(false) -#if QT_CONFIG(xkbcommon_evdev) - , keymap_fd(-1) - , xkb_state(nullptr) -#endif - , repeatRate(40) - , repeatDelay(400) + : seat(seat) { } diff --git a/src/compositor/compositor_api/qwaylandkeyboard_p.h b/src/compositor/compositor_api/qwaylandkeyboard_p.h index 0b47f8e8e..bcc4abb1a 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard_p.h +++ b/src/compositor/compositor_api/qwaylandkeyboard_p.h @@ -114,29 +114,29 @@ private: void sendRepeatInfo(); - QWaylandSeat *seat; + QWaylandSeat *seat = nullptr; - QWaylandSurface *focus; - Resource *focusResource; + QWaylandSurface *focus = nullptr; + Resource *focusResource = nullptr; QWaylandDestroyListener focusDestroyListener; QVector<uint32_t> keys; - uint32_t modsDepressed; - uint32_t modsLatched; - uint32_t modsLocked; - uint32_t group; + uint32_t modsDepressed = 0; + uint32_t modsLatched = 0; + uint32_t modsLocked = 0; + uint32_t group = 0; - bool pendingKeymap; + bool pendingKeymap = false; #if QT_CONFIG(xkbcommon_evdev) size_t keymap_size; - int keymap_fd; - char *keymap_area; - struct xkb_context *xkb_context; - struct xkb_state *xkb_state; + int keymap_fd = -1; + char *keymap_area = nullptr; + struct xkb_context *xkb_context = nullptr; + struct xkb_state *xkb_state = nullptr; #endif - quint32 repeatRate; - quint32 repeatDelay; + quint32 repeatRate = 40; + quint32 repeatDelay = 400; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 7627195da..f7782da9c 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -104,16 +104,6 @@ static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput: } QWaylandOutputPrivate::QWaylandOutputPrivate() - : QtWaylandServer::wl_output() - , compositor(nullptr) - , window(nullptr) - , currentMode(-1) - , preferredMode(-1) - , subpixel(QWaylandOutput::SubpixelUnknown) - , transform(QWaylandOutput::TransformNormal) - , scaleFactor(1) - , sizeFollowsWindow(false) - , initialized(false) { } diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index 5a21c3de7..28a19ff89 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -70,15 +70,11 @@ QT_BEGIN_NAMESPACE struct QWaylandSurfaceViewMapper { QWaylandSurfaceViewMapper() - : surface(nullptr) - , views() - , has_entered(false) {} QWaylandSurfaceViewMapper(QWaylandSurface *s, QWaylandView *v) : surface(s) , views(1, v) - , has_entered(false) {} QWaylandView *maybePrimaryView() const @@ -90,9 +86,9 @@ struct QWaylandSurfaceViewMapper return nullptr; } - QWaylandSurface *surface; + QWaylandSurface *surface = nullptr; QVector<QWaylandView *> views; - bool has_entered; + bool has_entered = false; }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandOutputPrivate : public QObjectPrivate, public QtWaylandServer::wl_output @@ -116,22 +112,22 @@ protected: void output_bind_resource(Resource *resource) override; private: - QWaylandCompositor *compositor; - QWindow *window; + QWaylandCompositor *compositor = nullptr; + QWindow *window = nullptr; QString manufacturer; QString model; QPoint position; QVector<QWaylandOutputMode> modes; - int currentMode; - int preferredMode; + int currentMode = -1; + int preferredMode = -1; QRect availableGeometry; QVector<QWaylandSurfaceViewMapper> surfaceViews; QSize physicalSize; - QWaylandOutput::Subpixel subpixel; - QWaylandOutput::Transform transform; - int scaleFactor; - bool sizeFollowsWindow; - bool initialized; + QWaylandOutput::Subpixel subpixel = QWaylandOutput::SubpixelUnknown; + QWaylandOutput::Transform transform = QWaylandOutput::TransformNormal; + int scaleFactor = 1; + bool sizeFollowsWindow = false; + bool initialized = false; Q_DECLARE_PUBLIC(QWaylandOutput) Q_DISABLE_COPY(QWaylandOutputPrivate) diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp index 4bdee9be2..77e736a58 100644 --- a/src/compositor/compositor_api/qwaylandpointer.cpp +++ b/src/compositor/compositor_api/qwaylandpointer.cpp @@ -47,12 +47,7 @@ QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandPointerPrivate::s_role("wl_pointer"); QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandSeat *seat) - : QObjectPrivate() - , wl_pointer() - , seat(seat) - , output() - , enterSerial(0) - , buttonCount() + : seat(seat) { Q_UNUSED(pointer); } diff --git a/src/compositor/compositor_api/qwaylandpointer_p.h b/src/compositor/compositor_api/qwaylandpointer_p.h index 11076f34b..94f44f604 100644 --- a/src/compositor/compositor_api/qwaylandpointer_p.h +++ b/src/compositor/compositor_api/qwaylandpointer_p.h @@ -92,17 +92,17 @@ private: void sendLeave(); void ensureEntered(QWaylandSurface *surface); - QWaylandSeat *seat; - QWaylandOutput *output; + QWaylandSeat *seat = nullptr; + QWaylandOutput *output = nullptr; QPointer<QWaylandSurface> enteredSurface; QPointF localPosition; QPointF spacePosition; - bool hasSentEnter; - uint enterSerial; + bool hasSentEnter = false; + uint enterSerial = 0; - int buttonCount; + int buttonCount = 0; QWaylandDestroyListener enteredSurfaceDestroyListener; diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 91e85b884..23b52e0b4 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -140,8 +140,7 @@ static const struct { }; QWaylandBufferMaterialShader::QWaylandBufferMaterialShader(QWaylandBufferRef::BufferFormatEgl format) - : QSGMaterialShader() - , m_format(format) + : m_format(format) { setShaderSourceFile(QOpenGLShader::Vertex, QString::fromLatin1(bufferTypes[format].vertexShaderSourceFile)); setShaderSourceFile(QOpenGLShader::Fragment, QString::fromLatin1(bufferTypes[format].fragmentShaderSourceFile)); @@ -183,8 +182,7 @@ void QWaylandBufferMaterialShader::initialize() } QWaylandBufferMaterial::QWaylandBufferMaterial(QWaylandBufferRef::BufferFormatEgl format) - : QSGMaterial() - , m_format(format) + : m_format(format) { QOpenGLFunctions *gl = QOpenGLContext::currentContext()->functions(); @@ -267,8 +265,6 @@ class QWaylandSurfaceTextureProvider : public QSGTextureProvider { public: QWaylandSurfaceTextureProvider() - : m_smooth(false) - , m_sgTex(nullptr) { } @@ -313,8 +309,8 @@ public: void setSmooth(bool smooth) { m_smooth = smooth; } private: - bool m_smooth; - QSGTexture *m_sgTex; + bool m_smooth = false; + QSGTexture *m_sgTex = nullptr; QWaylandBufferRef m_ref; }; diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h index 400cda742..de405a943 100644 --- a/src/compositor/compositor_api/qwaylandquickitem_p.h +++ b/src/compositor/compositor_api/qwaylandquickitem_p.h @@ -107,22 +107,7 @@ class QWaylandQuickItemPrivate : public QQuickItemPrivate { Q_DECLARE_PUBLIC(QWaylandQuickItem) public: - QWaylandQuickItemPrivate() - : QQuickItemPrivate() - , view(nullptr) - , oldSurface(nullptr) - , provider(nullptr) - , paintEnabled(true) - , touchEventsEnabled(true) - , inputEventsEnabled(true) - , isDragging(false) - , newTexture(false) - , focusOnClick(true) - , sizeFollowsSurface(true) - , connectedWindow(nullptr) - , origin(QWaylandSurface::OriginTopLeft) - { - } + QWaylandQuickItemPrivate() = default; void init() { @@ -169,20 +154,20 @@ public: static QMutex *mutex; QScopedPointer<QWaylandView> view; - QWaylandSurface *oldSurface; - mutable QWaylandSurfaceTextureProvider *provider; - bool paintEnabled; - bool touchEventsEnabled; - bool inputEventsEnabled; - bool isDragging; - bool newTexture; - bool focusOnClick; - bool sizeFollowsSurface; + QWaylandSurface *oldSurface = nullptr; + mutable QWaylandSurfaceTextureProvider *provider = nullptr; + bool paintEnabled = true; + bool touchEventsEnabled = true; + bool inputEventsEnabled = true; + bool isDragging = false; + bool newTexture = false; + bool focusOnClick = true; + bool sizeFollowsSurface = true; QPoint hoverPos; QMatrix4x4 lastMatrix; - QQuickWindow *connectedWindow; - QWaylandSurface::Origin origin; + QQuickWindow *connectedWindow = nullptr; + QWaylandSurface::Origin origin = QWaylandSurface::OriginTopLeft; QPointer<QObject> subsurfaceHandler; QVector<QWaylandSeat *> touchingSeats; }; diff --git a/src/compositor/compositor_api/qwaylandquickoutput.cpp b/src/compositor/compositor_api/qwaylandquickoutput.cpp index db7cc50bb..79e4fdec7 100644 --- a/src/compositor/compositor_api/qwaylandquickoutput.cpp +++ b/src/compositor/compositor_api/qwaylandquickoutput.cpp @@ -45,16 +45,11 @@ QT_BEGIN_NAMESPACE QWaylandQuickOutput::QWaylandQuickOutput() - : QWaylandOutput() - , m_updateScheduled(false) - , m_automaticFrameCallback(true) { } QWaylandQuickOutput::QWaylandQuickOutput(QWaylandCompositor *compositor, QWindow *window) : QWaylandOutput(compositor, window) - , m_updateScheduled(false) - , m_automaticFrameCallback(true) { } diff --git a/src/compositor/compositor_api/qwaylandquickoutput.h b/src/compositor/compositor_api/qwaylandquickoutput.h index f023872c0..cd79f14f5 100644 --- a/src/compositor/compositor_api/qwaylandquickoutput.h +++ b/src/compositor/compositor_api/qwaylandquickoutput.h @@ -79,8 +79,8 @@ protected: private: void doFrameCallbacks(); - bool m_updateScheduled; - bool m_automaticFrameCallback; + bool m_updateScheduled = false; + bool m_automaticFrameCallback = true; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandquicksurface.cpp b/src/compositor/compositor_api/qwaylandquicksurface.cpp index 1197e9e43..a1269b117 100644 --- a/src/compositor/compositor_api/qwaylandquicksurface.cpp +++ b/src/compositor/compositor_api/qwaylandquicksurface.cpp @@ -56,9 +56,6 @@ class QWaylandQuickSurfacePrivate : public QWaylandSurfacePrivate Q_DECLARE_PUBLIC(QWaylandQuickSurface) public: QWaylandQuickSurfacePrivate() - : QWaylandSurfacePrivate() - , useTextureAlpha(true) - , clientRenderingEnabled(true) { } @@ -66,8 +63,8 @@ public: { } - bool useTextureAlpha; - bool clientRenderingEnabled; + bool useTextureAlpha = true; + bool clientRenderingEnabled = true; }; QWaylandQuickSurface::QWaylandQuickSurface() diff --git a/src/compositor/compositor_api/qwaylandresource.cpp b/src/compositor/compositor_api/qwaylandresource.cpp index 7cfcce132..f3d010830 100644 --- a/src/compositor/compositor_api/qwaylandresource.cpp +++ b/src/compositor/compositor_api/qwaylandresource.cpp @@ -42,7 +42,6 @@ QT_BEGIN_NAMESPACE QWaylandResource::QWaylandResource() - : m_resource(nullptr) { } diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h index f8c50c082..11ab64da9 100644 --- a/src/compositor/compositor_api/qwaylandresource.h +++ b/src/compositor/compositor_api/qwaylandresource.h @@ -57,7 +57,7 @@ public: wl_resource *resource() const { return m_resource; } private: - wl_resource *m_resource; + wl_resource *m_resource = nullptr; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 2ee32bfb2..c67e6020d 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -60,21 +60,11 @@ QT_BEGIN_NAMESPACE -QWaylandSeatPrivate::QWaylandSeatPrivate(QWaylandSeat *seat) - : QObjectPrivate() - , QtWaylandServer::wl_seat() - , isInitialized(false) - , compositor(nullptr) - , mouseFocus(nullptr) - , keyboardFocus(nullptr) - , capabilities() +QWaylandSeatPrivate::QWaylandSeatPrivate(QWaylandSeat *seat) : #if QT_CONFIG(wayland_datadevice) - , data_device() + drag_handle(new QWaylandDrag(seat)), #endif -#if QT_CONFIG(draganddrop) - , drag_handle(new QWaylandDrag(seat)) -#endif - , keymap(new QWaylandKeymap()) + keymap(new QWaylandKeymap()) { } diff --git a/src/compositor/compositor_api/qwaylandseat_p.h b/src/compositor/compositor_api/qwaylandseat_p.h index 28a5fd4f0..1e182f41a 100644 --- a/src/compositor/compositor_api/qwaylandseat_p.h +++ b/src/compositor/compositor_api/qwaylandseat_p.h @@ -114,10 +114,10 @@ protected: void seat_destroy_resource(wl_seat::Resource *resource) override; private: - bool isInitialized; - QWaylandCompositor *compositor; - QWaylandView *mouseFocus; - QWaylandSurface *keyboardFocus; + bool isInitialized = false; + QWaylandCompositor *compositor = nullptr; + QWaylandView *mouseFocus = nullptr; + QWaylandSurface *keyboardFocus = nullptr; QWaylandSeat::CapabilityFlags capabilities; QScopedPointer<QWaylandPointer> pointer; diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index a5316f535..ed9bef3cf 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -75,7 +75,6 @@ public: FrameCallback(QWaylandSurface *surf, wl_resource *res) : surface(surf) , resource(res) - , canSend(false) { #if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) res->data = this; @@ -112,7 +111,7 @@ public: } QWaylandSurface *surface; wl_resource *resource; - bool canSend; + bool canSend = false; }; } static QRegion infiniteRegion() { @@ -125,22 +124,7 @@ QList<QWaylandSurfacePrivate *> QWaylandSurfacePrivate::uninitializedSurfaces; #endif QWaylandSurfacePrivate::QWaylandSurfacePrivate() - : QtWaylandServer::wl_surface() - , compositor(nullptr) - , refCount(1) - , client(nullptr) - , role(nullptr) - , inputRegion(infiniteRegion()) - , bufferScale(1) - , isCursorSurface(false) - , destroyed(false) - , hasContent(false) - , isInitialized(false) - , contentOrientation(Qt::PrimaryOrientation) -#if QT_CONFIG(im) - , inputMethodControl(nullptr) -#endif - , subsurface(nullptr) + : inputRegion(infiniteRegion()) { pending.buffer = QWaylandBufferRef(); pending.newlyAttached = false; diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 3c43fc043..3dc9bf20e 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -140,13 +140,13 @@ protected: QtWayland::ClientBuffer *getBuffer(struct ::wl_resource *buffer); public: //member variables - QWaylandCompositor *compositor; - int refCount; - QWaylandClient *client; + QWaylandCompositor *compositor = nullptr; + int refCount = 1; + QWaylandClient *client = nullptr; QList<QWaylandView *> views; QRegion damage; QWaylandBufferRef bufferRef; - QWaylandSurfaceRole *role; + QWaylandSurfaceRole *role = nullptr; struct { QWaylandBufferRef buffer; @@ -167,15 +167,15 @@ public: //member variables QRegion opaqueRegion; QSize size; - int bufferScale; - bool isCursorSurface; - bool destroyed; - bool hasContent; - bool isInitialized; - Qt::ScreenOrientation contentOrientation; + int bufferScale = 1; + bool isCursorSurface = false; + bool destroyed = false; + bool hasContent = false; + bool isInitialized = false; + Qt::ScreenOrientation contentOrientation = Qt::PrimaryOrientation; QWindow::Visibility visibility; #if QT_CONFIG(im) - QWaylandInputMethodControl *inputMethodControl; + QWaylandInputMethodControl *inputMethodControl = nullptr; #endif class Subsurface : public QtWaylandServer::wl_subsurface @@ -198,7 +198,7 @@ public: //member variables QPoint position; }; - Subsurface *subsurface; + Subsurface *subsurface = nullptr; #ifndef QT_NO_DEBUG static QList<QWaylandSurfacePrivate *> uninitializedSurfaces; diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp index 396a3b689..3e7298001 100644 --- a/src/compositor/compositor_api/qwaylandtouch.cpp +++ b/src/compositor/compositor_api/qwaylandtouch.cpp @@ -50,8 +50,7 @@ QT_BEGIN_NAMESPACE QWaylandTouchPrivate::QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandSeat *seat) - : wl_touch() - , seat(seat) + : seat(seat) { Q_UNUSED(touch); } diff --git a/src/compositor/compositor_api/qwaylandview_p.h b/src/compositor/compositor_api/qwaylandview_p.h index 1cc55954c..b9cb0d07b 100644 --- a/src/compositor/compositor_api/qwaylandview_p.h +++ b/src/compositor/compositor_api/qwaylandview_p.h @@ -71,32 +71,24 @@ public: static QWaylandViewPrivate *get(QWaylandView *view) { return view->d_func(); } QWaylandViewPrivate() - : renderObject(nullptr) - , surface(nullptr) - , output(nullptr) - , nextBufferCommitted(false) - , bufferLocked(false) - , broadcastRequestedPositionChanged(false) - , forceAdvanceSucceed(false) - , allowDiscardFrontBuffer(false) { } void markSurfaceAsDestroyed(QWaylandSurface *surface); - QObject *renderObject; - QWaylandSurface *surface; - QWaylandOutput *output; + QObject *renderObject = nullptr; + QWaylandSurface *surface = nullptr; + QWaylandOutput *output = nullptr; QPointF requestedPos; QMutex bufferMutex; QWaylandBufferRef currentBuffer; QRegion currentDamage; QWaylandBufferRef nextBuffer; QRegion nextDamage; - bool nextBufferCommitted; - bool bufferLocked; - bool broadcastRequestedPositionChanged; - bool forceAdvanceSucceed; - bool allowDiscardFrontBuffer; + bool nextBufferCommitted = false; + bool bufferLocked = false; + bool broadcastRequestedPositionChanged = false; + bool forceAdvanceSucceed = false; + bool allowDiscardFrontBuffer = false; bool independentFrameCallback = false; //If frame callbacks are independent of the main quick scene graph }; diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index 8295d2a18..57b1627b5 100644 --- a/src/compositor/extensions/qwaylandiviapplication.cpp +++ b/src/compositor/extensions/qwaylandiviapplication.cpp @@ -168,8 +168,6 @@ QByteArray QWaylandIviApplication::interfaceName() */ QWaylandIviApplicationPrivate::QWaylandIviApplicationPrivate() - : QWaylandCompositorExtensionPrivate() - , ivi_application() { } diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index 2bdd4a14d..716cc868f 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -218,11 +218,6 @@ void QWaylandIviSurface::initialize() } QWaylandIviSurfacePrivate::QWaylandIviSurfacePrivate() - : QWaylandCompositorExtensionPrivate() - , ivi_surface() - , m_iviApplication(nullptr) - , m_surface(nullptr) - , m_iviId(UINT_MAX) { } diff --git a/src/compositor/extensions/qwaylandivisurface_p.h b/src/compositor/extensions/qwaylandivisurface_p.h index 3edd0b1e8..0ead0647b 100644 --- a/src/compositor/extensions/qwaylandivisurface_p.h +++ b/src/compositor/extensions/qwaylandivisurface_p.h @@ -75,9 +75,9 @@ protected: void ivi_surface_destroy(Resource *resource) override; private: - QWaylandIviApplication *m_iviApplication; - QWaylandSurface *m_surface; - uint m_iviId; + QWaylandIviApplication *m_iviApplication = nullptr; + QWaylandSurface *m_surface = nullptr; + uint m_iviId = UINT_MAX; static QWaylandSurfaceRole s_role; }; diff --git a/src/compositor/extensions/qwaylandqtwindowmanager.cpp b/src/compositor/extensions/qwaylandqtwindowmanager.cpp index 4943681c6..86678b2e6 100644 --- a/src/compositor/extensions/qwaylandqtwindowmanager.cpp +++ b/src/compositor/extensions/qwaylandqtwindowmanager.cpp @@ -50,9 +50,6 @@ QT_BEGIN_NAMESPACE QWaylandQtWindowManagerPrivate::QWaylandQtWindowManagerPrivate() - : QWaylandCompositorExtensionPrivate() - , qt_windowmanager() - , showIsFullScreen(false) { } diff --git a/src/compositor/extensions/qwaylandqtwindowmanager_p.h b/src/compositor/extensions/qwaylandqtwindowmanager_p.h index 0856b3971..91e8e26cd 100644 --- a/src/compositor/extensions/qwaylandqtwindowmanager_p.h +++ b/src/compositor/extensions/qwaylandqtwindowmanager_p.h @@ -74,7 +74,7 @@ protected: void windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &url) override; private: - bool showIsFullScreen; + bool showIsFullScreen = false; QMap<Resource*, QString> urls; }; diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp index 2b603099b..6b8845797 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp +++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp @@ -213,7 +213,7 @@ void QWaylandQuickShellEventFilter::stopFilter() QWaylandQuickShellEventFilter *QWaylandQuickShellEventFilter::self = nullptr; QWaylandQuickShellEventFilter::QWaylandQuickShellEventFilter(QObject *parent) - : QObject(parent), eventFilterInstalled(false), waitForRelease(false), closePopups(nullptr) + : QObject(parent) { } diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h b/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h index 9549cb0e3..abb56221e 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h +++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h @@ -65,14 +65,10 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellSurfaceItemPrivate : public { public: QWaylandQuickShellSurfaceItemPrivate() - : QWaylandQuickItemPrivate() - , m_shellIntegration(nullptr) - , m_shellSurface(nullptr) - , m_moveItem(nullptr) {} - QWaylandQuickShellIntegration *m_shellIntegration; - QWaylandShellSurface *m_shellSurface; - QQuickItem *m_moveItem; + QWaylandQuickShellIntegration *m_shellIntegration = nullptr; + QWaylandShellSurface *m_shellSurface = nullptr; + QQuickItem *m_moveItem = nullptr; }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellIntegration : public QObject @@ -100,10 +96,10 @@ private: QWaylandQuickShellEventFilter(QObject *parent = nullptr); bool eventFilter(QObject *, QEvent *) override; - bool eventFilterInstalled; - bool waitForRelease; + bool eventFilterInstalled = false; + bool waitForRelease = false; QPointer<QWaylandClient> client; - CallbackFunction closePopups; + CallbackFunction closePopups = nullptr; QBasicTimer mousePressTimeout; static QWaylandQuickShellEventFilter *self; }; diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp index adb5827d4..12479186b 100644 --- a/src/compositor/extensions/qwaylandshell.cpp +++ b/src/compositor/extensions/qwaylandshell.cpp @@ -43,12 +43,10 @@ QT_BEGIN_NAMESPACE QWaylandShellPrivate::QWaylandShellPrivate() - : focusPolicy(QWaylandShell::AutomaticFocus) { } QWaylandShell::QWaylandShell() - : QWaylandCompositorExtension() { } diff --git a/src/compositor/extensions/qwaylandshell_p.h b/src/compositor/extensions/qwaylandshell_p.h index 968bf5bd7..f333b9b4c 100644 --- a/src/compositor/extensions/qwaylandshell_p.h +++ b/src/compositor/extensions/qwaylandshell_p.h @@ -62,7 +62,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellPrivate : public QWaylandComposit public: QWaylandShellPrivate(); - QWaylandShell::FocusPolicy focusPolicy; + QWaylandShell::FocusPolicy focusPolicy = QWaylandShell::AutomaticFocus; }; QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp index 552aa0667..b832bb737 100644 --- a/src/compositor/extensions/qwaylandtextinput.cpp +++ b/src/compositor/extensions/qwaylandtextinput.cpp @@ -54,13 +54,6 @@ QT_BEGIN_NAMESPACE QWaylandTextInputClientState::QWaylandTextInputClientState() - : hints(Qt::ImhNone) - , cursorRectangle() - , surroundingText() - , cursorPosition(0) - , anchorPosition(0) - , preferredLanguage() - , changedState() { } @@ -121,17 +114,9 @@ Qt::InputMethodQueries QWaylandTextInputClientState::mergeChanged(const QWayland } QWaylandTextInputPrivate::QWaylandTextInputPrivate(QWaylandCompositor *compositor) - : QWaylandCompositorExtensionPrivate() - , QtWaylandServer::zwp_text_input_v2() - , compositor(compositor) - , focus(nullptr) - , focusResource(nullptr) - , focusDestroyListener() - , inputPanelVisible(false) + : compositor(compositor) , currentState(new QWaylandTextInputClientState) , pendingState(new QWaylandTextInputClientState) - , serial(0) - , enabledSurfaces() { } diff --git a/src/compositor/extensions/qwaylandtextinput_p.h b/src/compositor/extensions/qwaylandtextinput_p.h index e96b0c01e..976c96198 100644 --- a/src/compositor/extensions/qwaylandtextinput_p.h +++ b/src/compositor/extensions/qwaylandtextinput_p.h @@ -76,11 +76,11 @@ public: Qt::InputMethodQueries updatedQueries(const QWaylandTextInputClientState &other) const; Qt::InputMethodQueries mergeChanged(const QWaylandTextInputClientState &other); - Qt::InputMethodHints hints; + Qt::InputMethodHints hints = Qt::ImhNone; QRect cursorRectangle; QString surroundingText; - int cursorPosition; - int anchorPosition; + int cursorPosition = 0; + int anchorPosition = 0; QString preferredLanguage; Qt::InputMethodQueries changedState; @@ -102,18 +102,18 @@ public: void setFocus(QWaylandSurface *surface); - QWaylandCompositor *compositor; + QWaylandCompositor *compositor = nullptr; - QWaylandSurface *focus; - Resource *focusResource; + QWaylandSurface *focus = nullptr; + Resource *focusResource = nullptr; QWaylandDestroyListener focusDestroyListener; - bool inputPanelVisible; + bool inputPanelVisible = false; QScopedPointer<QWaylandTextInputClientState> currentState; QScopedPointer<QWaylandTextInputClientState> pendingState; - uint32_t serial; + uint32_t serial = 0; QHash<Resource *, QWaylandSurface*> enabledSurfaces; diff --git a/src/compositor/extensions/qwaylandtextinputmanager.cpp b/src/compositor/extensions/qwaylandtextinputmanager.cpp index 0fda80990..f18ca5d51 100644 --- a/src/compositor/extensions/qwaylandtextinputmanager.cpp +++ b/src/compositor/extensions/qwaylandtextinputmanager.cpp @@ -48,8 +48,6 @@ QT_BEGIN_NAMESPACE QWaylandTextInputManagerPrivate::QWaylandTextInputManagerPrivate() - : QWaylandCompositorExtensionPrivate() - , QtWaylandServer::zwp_text_input_manager_v2() { } diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 59b311919..c3d15c6aa 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandWlShellSurfacePrivate::s_role("wl_shell_surface"); QWaylandWlShellPrivate::QWaylandWlShellPrivate() - : QWaylandCompositorExtensionPrivate() - , wl_shell() { } @@ -102,11 +100,6 @@ void QWaylandWlShellPrivate::unregisterShellSurface(QWaylandWlShellSurface *shel } QWaylandWlShellSurfacePrivate::QWaylandWlShellSurfacePrivate() - : QWaylandCompositorExtensionPrivate() - , wl_shell_surface() - , m_shell(nullptr) - , m_surface(nullptr) - , m_windowType(Qt::WindowType::Window) { } diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index 994b4dcbf..4e91eabc9 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -100,14 +100,14 @@ public: void setWindowType(Qt::WindowType windowType); private: - QWaylandWlShell *m_shell; + QWaylandWlShell *m_shell = nullptr; QPointer<QWaylandSurface> m_surface; QSet<uint32_t> m_pings; QString m_title; QString m_className; - Qt::WindowType m_windowType; + Qt::WindowType m_windowType = Qt::WindowType::Window; void shell_surface_destroy_resource(Resource *resource) override; diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp index 7e3d31f18..9e1e9dd6d 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration.cpp +++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp @@ -52,10 +52,6 @@ WlShellIntegration::WlShellIntegration(QWaylandQuickShellSurfaceItem *item) : QWaylandQuickShellIntegration(item) , m_item(item) , m_shellSurface(qobject_cast<QWaylandWlShellSurface *>(item->shellSurface())) - , grabberState(GrabberState::Default) - , isPopup(false) - , currentState(State::Windowed) - , nextState(State::Windowed) { m_item->setSurface(m_shellSurface->surface()); connect(m_shellSurface.data(), &QWaylandWlShellSurface::startMove, this, &WlShellIntegration::handleStartMove); diff --git a/src/compositor/extensions/qwaylandwlshellintegration_p.h b/src/compositor/extensions/qwaylandwlshellintegration_p.h index 9a2e5a3a2..7b9569122 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration_p.h +++ b/src/compositor/extensions/qwaylandwlshellintegration_p.h @@ -94,7 +94,7 @@ private: QWaylandQuickShellSurfaceItem *m_item; QPointer<QWaylandWlShellSurface> m_shellSurface; - GrabberState grabberState; + GrabberState grabberState = GrabberState::Default; struct { QWaylandSeat *seat; QPointF initialOffset; @@ -108,7 +108,7 @@ private: bool initialized; } resizeState; - bool isPopup; + bool isPopup = false; enum class State { Windowed, @@ -116,8 +116,8 @@ private: FullScreen }; - State currentState; - State nextState; + State currentState = State::Windowed; + State nextState = State::Windowed; QPointF normalPosition; QPointF finalPosition; }; diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index b5db226c2..13a95e17d 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -60,8 +60,6 @@ QWaylandSurfaceRole QWaylandXdgSurfaceV5Private::s_role("xdg_surface"); QWaylandSurfaceRole QWaylandXdgPopupV5Private::s_role("xdg_popup"); QWaylandXdgShellV5Private::QWaylandXdgShellV5Private() - : QWaylandCompositorExtensionPrivate() - , xdg_shell() { } @@ -223,14 +221,7 @@ void QWaylandXdgShellV5Private::xdg_shell_pong(Resource *resource, uint32_t seri } QWaylandXdgSurfaceV5Private::QWaylandXdgSurfaceV5Private() - : QWaylandCompositorExtensionPrivate() - , xdg_surface() - , m_xdgShell(nullptr) - , m_surface(nullptr) - , m_parentSurface(nullptr) - , m_windowType(Qt::WindowType::Window) - , m_unsetWindowGeometry(true) - , m_lastAckedConfigure({{}, QSize(0, 0), 0}) + : m_lastAckedConfigure({{}, QSize(0, 0), 0}) { } @@ -490,11 +481,6 @@ void QWaylandXdgSurfaceV5Private::xdg_surface_set_window_geometry(Resource *reso } QWaylandXdgPopupV5Private::QWaylandXdgPopupV5Private() - : QWaylandCompositorExtensionPrivate() - , xdg_popup() - , m_surface(nullptr) - , m_parentSurface(nullptr) - , m_xdgShell(nullptr) { } diff --git a/src/compositor/extensions/qwaylandxdgshellv5_p.h b/src/compositor/extensions/qwaylandxdgshellv5_p.h index 9b14f525d..b0b51698d 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv5_p.h @@ -116,16 +116,16 @@ public: void setWindowType(Qt::WindowType windowType); private: - QWaylandXdgShellV5 *m_xdgShell; - QWaylandSurface *m_surface; - QWaylandXdgSurfaceV5 *m_parentSurface; + QWaylandXdgShellV5 *m_xdgShell = nullptr; + QWaylandSurface *m_surface = nullptr; + QWaylandXdgSurfaceV5 *m_parentSurface = nullptr; - Qt::WindowType m_windowType; + Qt::WindowType m_windowType = Qt::WindowType::Window; QString m_title; QString m_appId; QRect m_windowGeometry; - bool m_unsetWindowGeometry; + bool m_unsetWindowGeometry = true; QList<ConfigureEvent> m_pendingConfigures; ConfigureEvent m_lastAckedConfigure; @@ -166,9 +166,9 @@ public: QWaylandXdgPopupV5Private(); static QWaylandXdgPopupV5Private *get(QWaylandXdgPopupV5 *xdgPopup) { return xdgPopup->d_func(); } - QWaylandSurface *m_surface; - QWaylandSurface *m_parentSurface; - QWaylandXdgShellV5 *m_xdgShell; + QWaylandSurface *m_surface = nullptr; + QWaylandSurface *m_parentSurface = nullptr; + QWaylandXdgShellV5 *m_xdgShell = nullptr; QPoint m_position; void xdg_popup_destroy_resource(Resource *resource) override; diff --git a/src/compositor/extensions/qwaylandxdgshellv6.cpp b/src/compositor/extensions/qwaylandxdgshellv6.cpp index 4b1d46b8a..3485f80a4 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv6.cpp @@ -54,8 +54,6 @@ QT_BEGIN_NAMESPACE QWaylandXdgShellV6Private::QWaylandXdgShellV6Private() - : QWaylandCompositorExtensionPrivate() - , zxdg_shell_v6() { } @@ -288,14 +286,6 @@ void QWaylandXdgShellV6::handleFocusChanged(QWaylandSurface *newSurface, QWaylan } QWaylandXdgSurfaceV6Private::QWaylandXdgSurfaceV6Private() - : QWaylandCompositorExtensionPrivate() - , zxdg_surface_v6() - , m_xdgShell(nullptr) - , m_surface(nullptr) - , m_toplevel(nullptr) - , m_popup(nullptr) - , m_unsetWindowGeometry(true) - , m_windowType(Qt::WindowType::Window) { } @@ -1097,8 +1087,6 @@ QWaylandSurfaceRole QWaylandXdgToplevelV6Private::s_role("zxdg_toplevel_v6"); QWaylandXdgToplevelV6Private::QWaylandXdgToplevelV6Private(QWaylandXdgSurfaceV6 *xdgSurface, const QWaylandResource &resource) : m_xdgSurface(xdgSurface) - , m_parentToplevel(nullptr) - , m_lastAckedConfigure({{}, QSize(0, 0), 0}) { init(resource.resource()); } @@ -1756,10 +1744,7 @@ void QWaylandXdgPopupV6Private::zxdg_popup_v6_grab(QtWaylandServer::zxdg_popup_v QWaylandSurfaceRole QWaylandXdgPopupV6Private::s_role("zxdg_popup_v6"); QWaylandXdgPositionerV6Data::QWaylandXdgPositionerV6Data() - : anchorEdges(0) - , gravityEdges(0) - , constraintAdjustments(ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE) - , offset(0, 0) + : offset(0, 0) {} bool QWaylandXdgPositionerV6Data::isComplete() const diff --git a/src/compositor/extensions/qwaylandxdgshellv6_p.h b/src/compositor/extensions/qwaylandxdgshellv6_p.h index 98bcb70f7..191a936f9 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv6_p.h @@ -60,9 +60,9 @@ QT_BEGIN_NAMESPACE struct Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPositionerV6Data { QSize size; QRect anchorRect; - Qt::Edges anchorEdges; - Qt::Edges gravityEdges; - uint constraintAdjustments; + Qt::Edges anchorEdges = 0; + Qt::Edges gravityEdges = 0; + uint constraintAdjustments = ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE; QPoint offset; QWaylandXdgPositionerV6Data(); bool isComplete() const; @@ -112,15 +112,15 @@ public: void updateFallbackWindowGeometry(); private: - QWaylandXdgShellV6 *m_xdgShell; - QWaylandSurface *m_surface; + QWaylandXdgShellV6 *m_xdgShell = nullptr; + QWaylandSurface *m_surface = nullptr; - QWaylandXdgToplevelV6 *m_toplevel; - QWaylandXdgPopupV6 *m_popup; + QWaylandXdgToplevelV6 *m_toplevel = nullptr; + QWaylandXdgPopupV6 *m_popup = nullptr; QRect m_windowGeometry; - bool m_unsetWindowGeometry; + bool m_unsetWindowGeometry = true; QMargins m_windowMargins; - Qt::WindowType m_windowType; + Qt::WindowType m_windowType = Qt::WindowType::Window; void zxdg_surface_v6_destroy_resource(Resource *resource) override; void zxdg_surface_v6_destroy(Resource *resource) override; @@ -136,8 +136,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgToplevelV6Private : public QObjectP public: struct ConfigureEvent { QVector<QWaylandXdgToplevelV6::State> states; - QSize size; - uint serial; + QSize size = {0, 0}; + uint serial = 0; }; QWaylandXdgToplevelV6Private(QWaylandXdgSurfaceV6 *xdgSurface, const QWaylandResource& resource); @@ -169,7 +169,7 @@ protected: public: QWaylandXdgSurfaceV6 *m_xdgSurface; - QWaylandXdgToplevelV6 *m_parentToplevel; + QWaylandXdgToplevelV6 *m_parentToplevel = nullptr; QList<ConfigureEvent> m_pendingConfigures; ConfigureEvent m_lastAckedConfigure; QString m_title; diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp index 161ec6c18..6d1be4a35 100644 --- a/src/compositor/extensions/qwlqttouch.cpp +++ b/src/compositor/extensions/qwlqttouch.cpp @@ -52,8 +52,6 @@ TouchExtensionGlobal::TouchExtensionGlobal(QWaylandCompositor *compositor) : QWaylandCompositorExtensionTemplate(compositor) , QtWaylandServer::qt_touch_extension(compositor->display(), 1) , m_compositor(compositor) - , m_flags(BehaviorFlag::None) - , m_resources() , m_posData(maxRawPos * 2) { } diff --git a/src/compositor/extensions/qwlqttouch_p.h b/src/compositor/extensions/qwlqttouch_p.h index e605c89e1..3f046a576 100644 --- a/src/compositor/extensions/qwlqttouch_p.h +++ b/src/compositor/extensions/qwlqttouch_p.h @@ -94,7 +94,7 @@ protected: private: QWaylandCompositor *m_compositor; - BehaviorFlags m_flags; + BehaviorFlags m_flags = BehaviorFlag::None; QList<Resource *> m_resources; QVector<float> m_posData; }; diff --git a/src/compositor/global/qwaylandcompositorextension_p.h b/src/compositor/global/qwaylandcompositorextension_p.h index 68f817aa6..6ec810988 100644 --- a/src/compositor/global/qwaylandcompositorextension_p.h +++ b/src/compositor/global/qwaylandcompositorextension_p.h @@ -63,16 +63,13 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandCompositorExtensionPrivate : public QO public: QWaylandCompositorExtensionPrivate() - : QObjectPrivate() - , extension_container(nullptr) - , initialized(false) { } static QWaylandCompositorExtensionPrivate *get(QWaylandCompositorExtension *extension) { return extension->d_func(); } - QWaylandObject *extension_container; - bool initialized; + QWaylandObject *extension_container = nullptr; + bool initialized = false; }; QT_END_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp index 3f4d4a412..7407aca58 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp @@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE namespace QtWayland { ClientBufferIntegration::ClientBufferIntegration() - : m_compositor(nullptr) { } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index 1b54786f2..13a69fce9 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -79,7 +79,7 @@ public: virtual ClientBuffer *createBufferFor(struct ::wl_resource *buffer) = 0; protected: - QWaylandCompositor *m_compositor; + QWaylandCompositor *m_compositor = nullptr; }; } diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp index 86331a744..d5c661e93 100644 --- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp +++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp @@ -57,13 +57,12 @@ BufferManager::BufferManager(QWaylandCompositor *compositor) struct buffer_manager_destroy_listener : wl_listener { buffer_manager_destroy_listener() - : d(nullptr) { notify = BufferManager::destroy_listener_callback; wl_list_init(&this->link); } - BufferManager *d; + BufferManager *d = nullptr; }; ClientBuffer *BufferManager::getBuffer(wl_resource *buffer_resource) diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp index 7d7e787c4..7df9ead3c 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp @@ -58,9 +58,6 @@ namespace QtWayland { ClientBuffer::ClientBuffer(struct ::wl_resource *buffer) : m_buffer(buffer) - , m_textureDirty(false) - , m_committed(false) - , m_destroyed(false) { } @@ -117,9 +114,6 @@ QWaylandBufferRef::BufferFormatEgl ClientBuffer::bufferFormatEgl() const SharedMemoryBuffer::SharedMemoryBuffer(wl_resource *bufferResource) : ClientBuffer(bufferResource) -#if QT_CONFIG(opengl) - , m_shmTexture(nullptr) -#endif { } diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h index 5a66a67a7..5f3475ed7 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h @@ -114,11 +114,11 @@ protected: struct ::wl_resource *m_buffer; QRegion m_damage; - bool m_textureDirty; + bool m_textureDirty = false; private: - bool m_committed; - bool m_destroyed; + bool m_committed = false; + bool m_destroyed = false; QAtomicInt m_refCount; @@ -139,7 +139,7 @@ public: QOpenGLTexture *toOpenGlTexture(int plane = 0) override; private: - QOpenGLTexture *m_shmTexture; + QOpenGLTexture *m_shmTexture = nullptr; #endif }; diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 3b557a109..6dc1355d5 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -61,18 +61,8 @@ QT_BEGIN_NAMESPACE namespace QtWayland { DataDevice::DataDevice(QWaylandSeat *seat) - : wl_data_device() - , m_compositor(seat->compositor()) + : m_compositor(seat->compositor()) , m_seat(seat) - , m_selectionSource(nullptr) -#if QT_CONFIG(draganddrop) - , m_dragClient(nullptr) - , m_dragDataSource(nullptr) - , m_dragFocus(nullptr) - , m_dragFocusResource(nullptr) - , m_dragIcon(nullptr) - , m_dragOrigin(nullptr) -#endif { } diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index d041f0158..4cb492509 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -99,17 +99,17 @@ private: QWaylandCompositor *m_compositor; QWaylandSeat *m_seat; - DataSource *m_selectionSource; + DataSource *m_selectionSource = nullptr; #if QT_CONFIG(draganddrop) - struct ::wl_client *m_dragClient; - DataSource *m_dragDataSource; + struct ::wl_client *m_dragClient = nullptr; + DataSource *m_dragDataSource = nullptr; - QWaylandSurface *m_dragFocus; - Resource *m_dragFocusResource; + QWaylandSurface *m_dragFocus = nullptr; + Resource *m_dragFocusResource = nullptr; - QWaylandSurface *m_dragIcon; - QWaylandSurface *m_dragOrigin; + QWaylandSurface *m_dragIcon = nullptr; + QWaylandSurface *m_dragOrigin = nullptr; #endif }; diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 0c0855d24..acca08e07 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -59,12 +59,8 @@ QT_BEGIN_NAMESPACE namespace QtWayland { DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor) - : QObject(nullptr) - , wl_data_device_manager(compositor->display(), 1) + : wl_data_device_manager(compositor->display(), 1) , m_compositor(compositor) - , m_current_selection_source(nullptr) - , m_retainedReadNotifier(nullptr) - , m_compositorOwnsSelection(false) { } diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index d6ace5c00..9c6672db6 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -104,15 +104,15 @@ private: QWaylandCompositor *m_compositor; QList<DataDevice *> m_data_device_list; - DataSource *m_current_selection_source; + DataSource *m_current_selection_source = nullptr; QMimeData m_retainedData; - QSocketNotifier *m_retainedReadNotifier; + QSocketNotifier *m_retainedReadNotifier = nullptr; QList<QSocketNotifier *> m_obsoleteRetainedReadNotifiers; int m_retainedReadIndex; QByteArray m_retainedReadBuf; - bool m_compositorOwnsSelection; + bool m_compositorOwnsSelection = false; static void comp_accept(struct wl_client *client, diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 2d523dad9..baa47d6fc 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -52,8 +52,6 @@ namespace QtWayland { DataSource::DataSource(struct wl_client *client, uint32_t id, uint32_t time) : QtWaylandServer::wl_data_source(client, id, 1) , m_time(time) - , m_device(nullptr) - , m_manager(nullptr) { } diff --git a/src/compositor/wayland_wrapper/qwldatasource_p.h b/src/compositor/wayland_wrapper/qwldatasource_p.h index cf54d762f..d5437a301 100644 --- a/src/compositor/wayland_wrapper/qwldatasource_p.h +++ b/src/compositor/wayland_wrapper/qwldatasource_p.h @@ -92,8 +92,8 @@ private: uint32_t m_time; QList<QString> m_mimeTypes; - DataDevice *m_device; - DataDeviceManager *m_manager; + DataDevice *m_device = nullptr; + DataDeviceManager *m_manager = nullptr; }; } |