summaryrefslogtreecommitdiffstats
path: root/src/compositor
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-20 13:35:03 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-02-20 14:15:08 +0000
commit1ebb4e0d64bf27dfc6c38b9770ae744fad87fb82 (patch)
treef92eb1649a32785f93fe6af8df82c8d0611b21e0 /src/compositor
parentabfdf34f510b64439c85cc54f47b41c4ce3f9c61 (diff)
Use nullptr instead of 0 or NULL
Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor_api/qwaylandbufferref.cpp2
-rw-r--r--src/compositor/compositor_api/qwaylandclient.cpp6
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp8
-rw-r--r--src/compositor/compositor_api/qwaylanddrag.cpp4
-rw-r--r--src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp2
-rw-r--r--src/compositor/compositor_api/qwaylandkeyboard.cpp10
-rw-r--r--src/compositor/compositor_api/qwaylandoutput_p.h2
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp8
-rw-r--r--src/compositor/compositor_api/qwaylandresource.cpp2
-rw-r--r--src/compositor/compositor_api/qwaylandseat.cpp6
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.cpp8
-rw-r--r--src/compositor/extensions/qwaylandtextinput.cpp6
-rw-r--r--src/compositor/extensions/qwaylandwlshell.cpp2
-rw-r--r--src/compositor/extensions/qwlqtkey.cpp2
-rw-r--r--src/compositor/extensions/qwlqttouch.cpp2
-rw-r--r--src/compositor/hardware_integration/qwlclientbufferintegration.cpp2
-rw-r--r--src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp2
-rw-r--r--src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h2
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp2
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h2
-rw-r--r--src/compositor/wayland_wrapper/qwlbuffermanager.cpp2
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevice.cpp26
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager.cpp10
-rw-r--r--src/compositor/wayland_wrapper/qwldatasource.cpp4
24 files changed, 61 insertions, 61 deletions
diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp
index 8ceeeea56..affd7af33 100644
--- a/src/compositor/compositor_api/qwaylandbufferref.cpp
+++ b/src/compositor/compositor_api/qwaylandbufferref.cpp
@@ -71,7 +71,7 @@ public:
QWaylandBufferRef::QWaylandBufferRef()
: d(new QWaylandBufferRefPrivate)
{
- d->buffer = 0;
+ d->buffer = nullptr;
}
/*!
diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp
index 122fd41c3..471c1b5a1 100644
--- a/src/compositor/compositor_api/qwaylandclient.cpp
+++ b/src/compositor/compositor_api/qwaylandclient.cpp
@@ -69,7 +69,7 @@ public:
Q_UNUSED(data);
QWaylandClient *client = reinterpret_cast<Listener *>(listener)->parent;
- Q_ASSERT(client != 0);
+ Q_ASSERT(client != nullptr);
delete client;
}
@@ -144,7 +144,7 @@ QWaylandClient::~QWaylandClient()
QWaylandClient *QWaylandClient::fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient)
{
if (!wlClient)
- return 0;
+ return nullptr;
QWaylandClient *client = nullptr;
@@ -152,7 +152,7 @@ QWaylandClient *QWaylandClient::fromWlClient(QWaylandCompositor *compositor, wl_
QWaylandClientPrivate::client_destroy_callback);
if (l)
client = reinterpret_cast<QWaylandClientPrivate::Listener *>(
- wl_container_of(l, (QWaylandClientPrivate::Listener *)0, listener))->parent;
+ wl_container_of(l, (QWaylandClientPrivate::Listener *)nullptr, listener))->parent;
if (!client) {
// The original idea was to create QWaylandClient instances when
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index 4c662a34a..289af2f38 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -148,11 +148,11 @@ public:
} // namespace
QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor)
- : display(0)
+ : display(nullptr)
#if QT_CONFIG(opengl)
, use_hw_integration_extension(true)
- , client_buffer_integration(0)
- , server_buffer_integration(0)
+ , client_buffer_integration(nullptr)
+ , server_buffer_integration(nullptr)
#endif
, retainSelection(false)
, preInitialized(false)
@@ -834,7 +834,7 @@ QWaylandSeat *QWaylandCompositor::defaultSeat() const
QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent)
{
Q_D(QWaylandCompositor);
- QWaylandSeat *dev = NULL;
+ QWaylandSeat *dev = nullptr;
for (int i = 0; i < d->seats.size(); i++) {
QWaylandSeat *candidate = d->seats.at(i);
if (candidate->isOwner(inputEvent)) {
diff --git a/src/compositor/compositor_api/qwaylanddrag.cpp b/src/compositor/compositor_api/qwaylanddrag.cpp
index c52e424d5..34f936a56 100644
--- a/src/compositor/compositor_api/qwaylanddrag.cpp
+++ b/src/compositor/compositor_api/qwaylanddrag.cpp
@@ -83,7 +83,7 @@ QWaylandSurface *QWaylandDrag::icon() const
const QtWayland::DataDevice *dataDevice = d->dataDevice();
if (!dataDevice)
- return 0;
+ return nullptr;
return dataDevice->dragIcon();
}
@@ -110,7 +110,7 @@ bool QWaylandDrag::visible() const
if (!dataDevice)
return false;
- return dataDevice->dragIcon() != 0;
+ return dataDevice->dragIcon() != nullptr;
}
void QWaylandDrag::dragMove(QWaylandSurface *target, const QPointF &pos)
diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp
index 575a64df4..69e5971eb 100644
--- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp
+++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp
@@ -138,7 +138,7 @@ void QWaylandInputMethodControl::defaultSeatChanged()
{
Q_D(QWaylandInputMethodControl);
- disconnect(d->textInput(), 0, this, 0);
+ disconnect(d->textInput(), nullptr, this, nullptr);
d->seat = d->compositor->defaultSeat();
QWaylandTextInput *textInput = d->textInput();
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp
index 930eae1ae..e35c0f371 100644
--- a/src/compositor/compositor_api/qwaylandkeyboard.cpp
+++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp
@@ -71,7 +71,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat)
, pendingKeymap(false)
#if QT_CONFIG(xkbcommon_evdev)
, keymap_fd(-1)
- , xkb_state(0)
+ , xkb_state(nullptr)
#endif
, repeatRate(40)
, repeatDelay(400)
@@ -168,7 +168,7 @@ void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *reso
void QWaylandKeyboardPrivate::keyboard_destroy_resource(wl_keyboard::Resource *resource)
{
if (focusResource == resource)
- focusResource = 0;
+ focusResource = nullptr;
}
void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource)
@@ -333,7 +333,7 @@ void QWaylandKeyboardPrivate::createXKBState(xkb_keymap *keymap)
return;
}
- keymap_area = static_cast<char *>(mmap(0, keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, keymap_fd, 0));
+ keymap_area = static_cast<char *>(mmap(nullptr, keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, keymap_fd, 0));
if (keymap_area == MAP_FAILED) {
close(keymap_fd);
keymap_fd = -1;
@@ -448,8 +448,8 @@ void QWaylandKeyboard::focusDestroyed(void *data)
Q_D(QWaylandKeyboard);
d->focusDestroyListener.reset();
- d->focus = 0;
- d->focusResource = 0;
+ d->focus = nullptr;
+ d->focusResource = nullptr;
}
void QWaylandKeyboard::updateKeymap()
diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h
index dab6daf73..5a21c3de7 100644
--- a/src/compositor/compositor_api/qwaylandoutput_p.h
+++ b/src/compositor/compositor_api/qwaylandoutput_p.h
@@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE
struct QWaylandSurfaceViewMapper
{
QWaylandSurfaceViewMapper()
- : surface(0)
+ : surface(nullptr)
, views()
, has_entered(false)
{}
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 74ce326e5..91e85b884 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -163,7 +163,7 @@ void QWaylandBufferMaterialShader::updateState(const QSGMaterialShader::RenderSt
const char * const *QWaylandBufferMaterialShader::attributeNames() const
{
- static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", 0 };
+ static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", nullptr };
return attr;
}
@@ -261,14 +261,14 @@ void QWaylandBufferMaterial::ensureTextures(int count)
}
}
-QMutex *QWaylandQuickItemPrivate::mutex = 0;
+QMutex *QWaylandQuickItemPrivate::mutex = nullptr;
class QWaylandSurfaceTextureProvider : public QSGTextureProvider
{
public:
QWaylandSurfaceTextureProvider()
: m_smooth(false)
- , m_sgTex(0)
+ , m_sgTex(nullptr)
{
}
@@ -283,7 +283,7 @@ public:
Q_ASSERT(QThread::currentThread() == thread());
m_ref = buffer;
delete m_sgTex;
- m_sgTex = 0;
+ m_sgTex = nullptr;
if (m_ref.hasBuffer()) {
if (buffer.isSharedMemory()) {
m_sgTex = surfaceItem->window()->createTextureFromImage(buffer.image());
diff --git a/src/compositor/compositor_api/qwaylandresource.cpp b/src/compositor/compositor_api/qwaylandresource.cpp
index 07e67a9b1..7cfcce132 100644
--- a/src/compositor/compositor_api/qwaylandresource.cpp
+++ b/src/compositor/compositor_api/qwaylandresource.cpp
@@ -42,7 +42,7 @@
QT_BEGIN_NAMESPACE
QWaylandResource::QWaylandResource()
- : m_resource(0)
+ : m_resource(nullptr)
{
}
diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp
index 4b506bcda..2ee32bfb2 100644
--- a/src/compositor/compositor_api/qwaylandseat.cpp
+++ b/src/compositor/compositor_api/qwaylandseat.cpp
@@ -89,15 +89,15 @@ void QWaylandSeatPrivate::setCapabilities(QWaylandSeat::CapabilityFlags caps)
QWaylandSeat::CapabilityFlags changed = caps ^ capabilities;
if (changed & QWaylandSeat::Pointer) {
- pointer.reset(pointer.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreatePointerDevice(q) : 0);
+ pointer.reset(pointer.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreatePointerDevice(q) : nullptr);
}
if (changed & QWaylandSeat::Keyboard) {
- keyboard.reset(keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateKeyboardDevice(q) : 0);
+ keyboard.reset(keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateKeyboardDevice(q) : nullptr);
}
if (changed & QWaylandSeat::Touch) {
- touch.reset(touch.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateTouchDevice(q) : 0);
+ touch.reset(touch.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateTouchDevice(q) : nullptr);
}
capabilities = caps;
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp
index 37b6876ac..a5316f535 100644
--- a/src/compositor/compositor_api/qwaylandsurface.cpp
+++ b/src/compositor/compositor_api/qwaylandsurface.cpp
@@ -81,7 +81,7 @@ public:
res->data = this;
res->destroy = destroyCallback;
#else
- wl_resource_set_implementation(res, 0, this, destroyCallback);
+ wl_resource_set_implementation(res, nullptr, this, destroyCallback);
#endif
}
~FrameCallback()
@@ -129,7 +129,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate()
, compositor(nullptr)
, refCount(1)
, client(nullptr)
- , role(0)
+ , role(nullptr)
, inputRegion(infiniteRegion())
, bufferScale(1)
, isCursorSurface(false)
@@ -140,7 +140,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate()
#if QT_CONFIG(im)
, inputMethodControl(nullptr)
#endif
- , subsurface(0)
+ , subsurface(nullptr)
{
pending.buffer = QWaylandBufferRef();
pending.newlyAttached = false;
@@ -843,7 +843,7 @@ void QWaylandSurfacePrivate::derefView(QWaylandView *view)
void QWaylandSurfacePrivate::initSubsurface(QWaylandSurface *parent, wl_client *client, int id, int version)
{
Q_Q(QWaylandSurface);
- QWaylandSurface *oldParent = 0; // TODO: implement support for switching parents
+ QWaylandSurface *oldParent = nullptr; // TODO: implement support for switching parents
subsurface = new Subsurface(this);
subsurface->init(client, id, version);
diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp
index 11454da06..552aa0667 100644
--- a/src/compositor/extensions/qwaylandtextinput.cpp
+++ b/src/compositor/extensions/qwaylandtextinput.cpp
@@ -54,7 +54,7 @@
QT_BEGIN_NAMESPACE
QWaylandTextInputClientState::QWaylandTextInputClientState()
- : hints(0)
+ : hints(Qt::ImhNone)
, cursorRectangle()
, surroundingText()
, cursorPosition(0)
@@ -339,7 +339,7 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_bind_resource(Resource *resourc
void QWaylandTextInputPrivate::zwp_text_input_v2_destroy_resource(Resource *resource)
{
if (focusResource == resource)
- focusResource = 0;
+ focusResource = nullptr;
}
void QWaylandTextInputPrivate::zwp_text_input_v2_destroy(Resource *resource)
@@ -426,7 +426,7 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_set_content_type(Resource *reso
if (resource != focusResource)
return;
- pendingState->hints = 0;
+ pendingState->hints = Qt::ImhNone;
if ((hint & content_hint_auto_completion) == 0
&& (hint & content_hint_auto_correction) == 0)
diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp
index c588c1063..59b311919 100644
--- a/src/compositor/extensions/qwaylandwlshell.cpp
+++ b/src/compositor/extensions/qwaylandwlshell.cpp
@@ -704,7 +704,7 @@ QWaylandWlShellSurface *QWaylandWlShellSurface::fromResource(wl_resource *resour
QWaylandWlShellSurfacePrivate::Resource *res = QWaylandWlShellSurfacePrivate::Resource::fromResource(resource);
if (res)
return static_cast<QWaylandWlShellSurfacePrivate *>(res->shell_surface_object)->q_func();
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/compositor/extensions/qwlqtkey.cpp b/src/compositor/extensions/qwlqtkey.cpp
index 99f71f140..73d06ae6b 100644
--- a/src/compositor/extensions/qwlqtkey.cpp
+++ b/src/compositor/extensions/qwlqtkey.cpp
@@ -61,7 +61,7 @@ bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, QWaylandSurface *sur
if (target) {
send_qtkey(target->handle,
- surface ? surface->resource() : 0,
+ surface ? surface->resource() : nullptr,
time, event->type(), event->key(), event->modifiers(),
event->nativeScanCode(),
event->nativeVirtualKey(),
diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp
index 3a0752b81..161ec6c18 100644
--- a/src/compositor/extensions/qwlqttouch.cpp
+++ b/src/compositor/extensions/qwlqttouch.cpp
@@ -52,7 +52,7 @@ TouchExtensionGlobal::TouchExtensionGlobal(QWaylandCompositor *compositor)
: QWaylandCompositorExtensionTemplate(compositor)
, QtWaylandServer::qt_touch_extension(compositor->display(), 1)
, m_compositor(compositor)
- , m_flags(0)
+ , m_flags(BehaviorFlag::None)
, m_resources()
, m_posData(maxRawPos * 2)
{
diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp
index 67d4e5f54..3f4d4a412 100644
--- a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp
+++ b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
ClientBufferIntegration::ClientBufferIntegration()
- : m_compositor(0)
+ : m_compositor(nullptr)
{
}
diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp
index 57359190d..68c8ac4c6 100644
--- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp
+++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp
@@ -90,7 +90,7 @@ ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &n
if (ClientBufferIntegration *ret = qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(loader(), name, args))
return ret;
#endif
- return 0;
+ return nullptr;
}
}
diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h
index bc8f0a48a..edf4fea0a 100644
--- a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h
+++ b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h
@@ -68,7 +68,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ClientBufferIntegrationPlugin : public QObject
{
Q_OBJECT
public:
- explicit ClientBufferIntegrationPlugin(QObject *parent = 0);
+ explicit ClientBufferIntegrationPlugin(QObject *parent = nullptr);
~ClientBufferIntegrationPlugin();
virtual ClientBufferIntegration *create(const QString &key, const QStringList &paramList) = 0;
diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp
index 6425f7c38..2b60de5eb 100644
--- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp
+++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp
@@ -90,7 +90,7 @@ ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &n
if (ServerBufferIntegration *ret = qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(loader(), name, args))
return ret;
#endif
- return 0;
+ return nullptr;
}
}
diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h
index e1b123c6f..0cb5ed323 100644
--- a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h
+++ b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h
@@ -68,7 +68,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ServerBufferIntegrationPlugin : public QObject
{
Q_OBJECT
public:
- explicit ServerBufferIntegrationPlugin(QObject *parent = 0);
+ explicit ServerBufferIntegrationPlugin(QObject *parent = nullptr);
~ServerBufferIntegrationPlugin();
virtual ServerBufferIntegration *create(const QString &key, const QStringList &paramList) = 0;
diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
index a8314daea..86331a744 100644
--- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
+++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp
@@ -57,7 +57,7 @@ BufferManager::BufferManager(QWaylandCompositor *compositor)
struct buffer_manager_destroy_listener : wl_listener
{
buffer_manager_destroy_listener()
- : d(0)
+ : d(nullptr)
{
notify = BufferManager::destroy_listener_callback;
wl_list_init(&this->link);
diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp
index 73d7bb1fa..3b557a109 100644
--- a/src/compositor/wayland_wrapper/qwldatadevice.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp
@@ -64,13 +64,13 @@ DataDevice::DataDevice(QWaylandSeat *seat)
: wl_data_device()
, m_compositor(seat->compositor())
, m_seat(seat)
- , m_selectionSource(0)
+ , m_selectionSource(nullptr)
#if QT_CONFIG(draganddrop)
- , m_dragClient(0)
- , m_dragDataSource(0)
- , m_dragFocus(0)
- , m_dragFocusResource(0)
- , m_dragIcon(0)
+ , m_dragClient(nullptr)
+ , m_dragDataSource(nullptr)
+ , m_dragFocus(nullptr)
+ , m_dragFocusResource(nullptr)
+ , m_dragIcon(nullptr)
, m_dragOrigin(nullptr)
#endif
{
@@ -95,7 +95,7 @@ void DataDevice::setFocus(QWaylandClient *focusClient)
void DataDevice::sourceDestroyed(DataSource *source)
{
if (m_selectionSource == source)
- m_selectionSource = 0;
+ m_selectionSource = nullptr;
}
#if QT_CONFIG(draganddrop)
@@ -103,8 +103,8 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi
{
if (m_dragFocusResource) {
send_leave(m_dragFocusResource->handle);
- m_dragFocus = 0;
- m_dragFocusResource = 0;
+ m_dragFocus = nullptr;
+ m_dragFocusResource = nullptr;
}
if (!focus)
@@ -120,7 +120,7 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi
uint32_t serial = m_compositor->nextSerial();
- DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : 0;
+ DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : nullptr;
if (m_dragDataSource && !offer)
return;
@@ -174,7 +174,7 @@ void DataDevice::cancelDrag()
void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial)
{
m_dragClient = resource->client();
- m_dragDataSource = source ? DataSource::fromResource(source) : 0;
+ m_dragDataSource = source ? DataSource::fromResource(source) : nullptr;
m_dragOrigin = QWaylandSurface::fromResource(origin);
QWaylandDrag *drag = m_seat->drag();
setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr);
@@ -198,7 +198,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou
{
Q_UNUSED(serial);
- DataSource *dataSource = source ? DataSource::fromResource(source) : 0;
+ DataSource *dataSource = source ? DataSource::fromResource(source) : nullptr;
if (m_selectionSource)
m_selectionSource->cancel();
@@ -215,7 +215,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou
DataOffer *offer = new DataOffer(m_selectionSource, resource);
send_selection(resource->handle, offer->resource()->handle);
} else if (resource) {
- send_selection(resource->handle, 0);
+ send_selection(resource->handle, nullptr);
}
}
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
index a1937c923..0c0855d24 100644
--- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
+++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp
@@ -59,11 +59,11 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor)
- : QObject(0)
+ : QObject(nullptr)
, wl_data_device_manager(compositor->display(), 1)
, m_compositor(compositor)
- , m_current_selection_source(0)
- , m_retainedReadNotifier(0)
+ , m_current_selection_source(nullptr)
+ , m_retainedReadNotifier(nullptr)
, m_compositorOwnsSelection(false)
{
}
@@ -137,7 +137,7 @@ void DataDeviceManager::finishReadFromClient(bool exhausted)
// or else clients may SIGPIPE.
m_obsoleteRetainedReadNotifiers.append(m_retainedReadNotifier);
}
- m_retainedReadNotifier = 0;
+ m_retainedReadNotifier = nullptr;
}
}
@@ -219,7 +219,7 @@ bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDevic
struct wl_resource *selectionOffer =
wl_resource_create(client, &wl_data_offer_interface, -1, 0);
- wl_resource_set_implementation(selectionOffer, &compositor_offer_interface, this, 0);
+ wl_resource_set_implementation(selectionOffer, &compositor_offer_interface, this, nullptr);
wl_data_device_send_data_offer(clientDataDeviceResource, selectionOffer);
foreach (const QString &format, m_retainedData.formats()) {
QByteArray ba = format.toLatin1();
diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp
index 3a50cd0ff..2d523dad9 100644
--- a/src/compositor/wayland_wrapper/qwldatasource.cpp
+++ b/src/compositor/wayland_wrapper/qwldatasource.cpp
@@ -52,8 +52,8 @@ 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(0)
- , m_manager(0)
+ , m_device(nullptr)
+ , m_manager(nullptr)
{
}