Use QScopedPointer in QWaylandDisplay for extensions
Change-Id: I783639fcefd36967f42f18417b0e07ec34b49dbb Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
parent
d44fe6a530
commit
a719dbfe80
@ -85,7 +85,7 @@ QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() con
|
||||
|
||||
QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() const
|
||||
{
|
||||
return mWindowManagerIntegration;
|
||||
return mWindowManagerIntegration.data();
|
||||
}
|
||||
|
||||
QWaylandInputDevice *QWaylandDisplay::lastKeyboardFocusInputDevice() const
|
||||
@ -133,7 +133,7 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
|
||||
|
||||
connect(mEventThreadObject, SIGNAL(newEventsRead()), this, SLOT(flushRequests()));
|
||||
|
||||
mWindowManagerIntegration = new QWaylandWindowManagerIntegration(this);
|
||||
mWindowManagerIntegration.reset(new QWaylandWindowManagerIntegration(this));
|
||||
|
||||
blockingReadEvents();
|
||||
|
||||
@ -213,28 +213,28 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
|
||||
} else if (interface == QStringLiteral("wl_shm")) {
|
||||
mShm = static_cast<struct wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface,1));
|
||||
} else if (interface == QStringLiteral("wl_shell")){
|
||||
mShell = new QtWayland::wl_shell(registry, id);
|
||||
mShell.reset(new QtWayland::wl_shell(registry, id));
|
||||
} else if (interface == QStringLiteral("wl_seat")) {
|
||||
QWaylandInputDevice *inputDevice = new QWaylandInputDevice(this, id);
|
||||
mInputDevices.append(inputDevice);
|
||||
} else if (interface == QStringLiteral("wl_data_device_manager")) {
|
||||
mDndSelectionHandler = new QWaylandDataDeviceManager(this, id);
|
||||
mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id));
|
||||
} else if (interface == QStringLiteral("qt_output_extension")) {
|
||||
mOutputExtension = new QtWayland::qt_output_extension(registry, id);
|
||||
mOutputExtension.reset(new QtWayland::qt_output_extension(registry, id));
|
||||
foreach (QPlatformScreen *screen, screens())
|
||||
static_cast<QWaylandScreen *>(screen)->createExtendedOutput();
|
||||
} else if (interface == QStringLiteral("qt_surface_extension")) {
|
||||
mWindowExtension = new QtWayland::qt_surface_extension(registry, id);
|
||||
mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id));
|
||||
} else if (interface == QStringLiteral("qt_sub_surface_extension")) {
|
||||
mSubSurfaceExtension = new QtWayland::qt_sub_surface_extension(registry, id);
|
||||
mSubSurfaceExtension.reset(new QtWayland::qt_sub_surface_extension(registry, id));
|
||||
} else if (interface == QStringLiteral("qt_touch_extension")) {
|
||||
mTouchExtension = new QWaylandTouchExtension(this, id);
|
||||
mTouchExtension.reset(new QWaylandTouchExtension(this, id));
|
||||
} else if (interface == QStringLiteral("qt_key_extension")) {
|
||||
mQtKeyExtension = new QWaylandQtKeyExtension(this, id);
|
||||
mQtKeyExtension.reset(new QWaylandQtKeyExtension(this, id));
|
||||
} else if (interface == QStringLiteral("wl_text_input_manager")) {
|
||||
mTextInputManager = new QtWayland::wl_text_input_manager(registry, id);
|
||||
mTextInputManager.reset(new QtWayland::wl_text_input_manager(registry, id));
|
||||
} else if (interface == QStringLiteral("qt_hardware_integration")) {
|
||||
mHardwareIntegration = new QWaylandHardwareIntegration(registry, id);
|
||||
mHardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id));
|
||||
}
|
||||
|
||||
foreach (Listener l, mRegistryListeners)
|
||||
|
@ -112,7 +112,7 @@ public:
|
||||
const struct wl_compositor *wl_compositor() const { return mCompositor.object(); }
|
||||
QtWayland::wl_compositor *compositor() { return &mCompositor; }
|
||||
|
||||
QtWayland::wl_shell *shell() { return mShell; }
|
||||
QtWayland::wl_shell *shell() { return mShell.data(); }
|
||||
|
||||
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
|
||||
QWaylandInputDevice *defaultInputDevice() const;
|
||||
@ -121,14 +121,14 @@ public:
|
||||
QWaylandInputDevice *lastKeyboardFocusInputDevice() const;
|
||||
void setLastKeyboardFocusInputDevice(QWaylandInputDevice *device);
|
||||
|
||||
QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler; }
|
||||
QWaylandDataDeviceManager *dndSelectionHandler() const { return mDndSelectionHandler.data(); }
|
||||
|
||||
QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension; }
|
||||
QtWayland::qt_sub_surface_extension *subSurfaceExtension() const { return mSubSurfaceExtension; }
|
||||
QtWayland::qt_output_extension *outputExtension() const { return mOutputExtension; }
|
||||
QWaylandTouchExtension *touchExtension() const { return mTouchExtension; }
|
||||
QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager; }
|
||||
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration; }
|
||||
QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); }
|
||||
QtWayland::qt_sub_surface_extension *subSurfaceExtension() const { return mSubSurfaceExtension.data(); }
|
||||
QtWayland::qt_output_extension *outputExtension() const { return mOutputExtension.data(); }
|
||||
QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); }
|
||||
QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); }
|
||||
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); }
|
||||
|
||||
/* wl_registry_add_listener does not add but rather sets a listener, so this function is used
|
||||
* to enable many listeners at once. */
|
||||
@ -158,21 +158,21 @@ private:
|
||||
struct wl_shm *mShm;
|
||||
QThread *mEventThread;
|
||||
QWaylandEventThread *mEventThreadObject;
|
||||
QtWayland::wl_shell *mShell;
|
||||
QScopedPointer<QtWayland::wl_shell> mShell;
|
||||
QList<QPlatformScreen *> mScreens;
|
||||
QList<QWaylandInputDevice *> mInputDevices;
|
||||
QList<Listener> mRegistryListeners;
|
||||
QWaylandIntegration *mWaylandIntegration;
|
||||
QWaylandInputDevice *mLastKeyboardFocusInputDevice;
|
||||
QWaylandDataDeviceManager *mDndSelectionHandler;
|
||||
QtWayland::qt_surface_extension *mWindowExtension;
|
||||
QtWayland::qt_sub_surface_extension *mSubSurfaceExtension;
|
||||
QtWayland::qt_output_extension *mOutputExtension;
|
||||
QWaylandTouchExtension *mTouchExtension;
|
||||
QWaylandQtKeyExtension *mQtKeyExtension;
|
||||
QWaylandWindowManagerIntegration *mWindowManagerIntegration;
|
||||
QtWayland::wl_text_input_manager *mTextInputManager;
|
||||
QWaylandHardwareIntegration *mHardwareIntegration;
|
||||
QScopedPointer<QWaylandDataDeviceManager> mDndSelectionHandler;
|
||||
QScopedPointer<QtWayland::qt_surface_extension> mWindowExtension;
|
||||
QScopedPointer<QtWayland::qt_sub_surface_extension> mSubSurfaceExtension;
|
||||
QScopedPointer<QtWayland::qt_output_extension> mOutputExtension;
|
||||
QScopedPointer<QWaylandTouchExtension> mTouchExtension;
|
||||
QScopedPointer<QWaylandQtKeyExtension> mQtKeyExtension;
|
||||
QScopedPointer<QWaylandWindowManagerIntegration> mWindowManagerIntegration;
|
||||
QScopedPointer<QtWayland::wl_text_input_manager> mTextInputManager;
|
||||
QScopedPointer<QWaylandHardwareIntegration> mHardwareIntegration;
|
||||
|
||||
QSocketNotifier *mReadNotifier;
|
||||
int mFd;
|
||||
|
Loading…
x
Reference in New Issue
Block a user