Use QList instead of QVector

Task-number: QTBUG-84469
Change-Id: I4bc7b2eb2913fc828f09f96e21480b76cabf8656
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Jarek Kobus 2020-06-05 14:49:44 +02:00
parent 6ea7ae3c19
commit b4542740df
29 changed files with 84 additions and 86 deletions

View File

@ -54,7 +54,7 @@
#include "qwayland-xdg-shell-unstable-v5_p.h" #include "qwayland-xdg-shell-unstable-v5_p.h"
#include <QtCore/QSize> #include <QtCore/QSize>
#include <QtCore/QVector> #include <QtCore/QList>
#include <QtWaylandClient/qtwaylandclientglobal.h> #include <QtWaylandClient/qtwaylandclientglobal.h>
#include <QtWaylandClient/private/qwaylandshellsurface_p.h> #include <QtWaylandClient/private/qwaylandshellsurface_p.h>
@ -82,7 +82,7 @@ public:
private: private:
void xdg_shell_ping(uint32_t serial) override; void xdg_shell_ping(uint32_t serial) override;
QVector<QWaylandWindow *> m_popups; QList<QWaylandWindow *> m_popups;
uint m_popupSerial = 0; uint m_popupSerial = 0;
}; };

View File

@ -51,10 +51,10 @@
// We mean it. // We mean it.
// //
#include <QtCore/QList>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QRect>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include <QtCore/QVector> #include <QtCore/QRect>
#include <QtCore/QWaitCondition> #include <QtCore/QWaitCondition>
#include <QtCore/QLoggingCategory> #include <QtCore/QLoggingCategory>
@ -280,7 +280,7 @@ private:
QWaylandInputDevice *mLastInputDevice = nullptr; QWaylandInputDevice *mLastInputDevice = nullptr;
QPointer<QWaylandWindow> mLastInputWindow; QPointer<QWaylandWindow> mLastInputWindow;
QPointer<QWaylandWindow> mLastKeyboardFocus; QPointer<QWaylandWindow> mLastKeyboardFocus;
QVector<QWaylandWindow *> mActiveWindows; QList<QWaylandWindow *> mActiveWindows;
struct wl_callback *mSyncCallback = nullptr; struct wl_callback *mSyncCallback = nullptr;
static const wl_callback_listener syncCallbackListener; static const wl_callback_listener syncCallbackListener;

View File

@ -54,10 +54,10 @@
#include <qpa/qplatforminputcontext.h> #include <qpa/qplatforminputcontext.h>
#include <QList>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QPointer> #include <QPointer>
#include <QRectF> #include <QRectF>
#include <QVector>
#include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h> #include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h>
#include <qwaylandinputmethodeventbuilder_p.h> #include <qwaylandinputmethodeventbuilder_p.h>
@ -113,7 +113,7 @@ private:
QWaylandDisplay *m_display = nullptr; QWaylandDisplay *m_display = nullptr;
QWaylandInputMethodEventBuilder m_builder; QWaylandInputMethodEventBuilder m_builder;
QVector<Qt::KeyboardModifier> m_modifiersMap; QList<Qt::KeyboardModifier> m_modifiersMap;
uint32_t m_serial = 0; uint32_t m_serial = 0;
struct ::wl_surface *m_surface = nullptr; struct ::wl_surface *m_surface = nullptr;

View File

@ -51,8 +51,8 @@
// We mean it. // We mean it.
// //
#include <QVector>
#include <QImage> #include <QImage>
#include <QList>
#include <QtWaylandClient/qtwaylandclientglobal.h> #include <QtWaylandClient/qtwaylandclientglobal.h>
#include <QtWaylandClient/private/qwayland-wayland.h> #include <QtWaylandClient/private/qwayland-wayland.h>
@ -81,7 +81,7 @@ protected:
void shm_format(uint32_t format) override; void shm_format(uint32_t format) override;
private: private:
QVector<uint32_t> m_formats; QList<uint32_t> m_formats;
}; };

View File

@ -41,8 +41,6 @@
#include "qwaylandbuffer_p.h" #include "qwaylandbuffer_p.h"
#include <QtCore/QVector>
#include <QtCore/QDebug> #include <QtCore/QDebug>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -84,7 +84,7 @@ protected:
void surface_enter(struct ::wl_output *output) override; void surface_enter(struct ::wl_output *output) override;
void surface_leave(struct ::wl_output *output) override; void surface_leave(struct ::wl_output *output) override;
QVector<QWaylandScreen *> m_screens; //As seen by wl_surface.enter/leave events. Chronological order. QList<QWaylandScreen *> m_screens; //As seen by wl_surface.enter/leave events. Chronological order.
QWaylandWindow *m_window = nullptr; QWaylandWindow *m_window = nullptr;
friend class QWaylandWindow; // TODO: shouldn't need to be friends friend class QWaylandWindow; // TODO: shouldn't need to be friends

View File

@ -55,10 +55,10 @@
#include <QtWaylandClient/private/qtwaylandclientglobal_p.h> #include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
#include <QtGui/QTabletEvent>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include <QtCore/QPointF> #include <QtCore/QPointF>
#include <QtGui/QTabletEvent>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -93,9 +93,9 @@ protected:
void zwp_tablet_seat_v2_pad_added(struct ::zwp_tablet_pad_v2 *id) override; void zwp_tablet_seat_v2_pad_added(struct ::zwp_tablet_pad_v2 *id) override;
private: private:
QVector<QWaylandTabletV2 *> m_tablets; QList<QWaylandTabletV2 *> m_tablets;
QVector<QWaylandTabletToolV2 *> m_tools; QList<QWaylandTabletToolV2 *> m_tools;
QVector<QWaylandTabletPadV2 *> m_pads; QList<QWaylandTabletPadV2 *> m_pads;
}; };
class Q_WAYLAND_CLIENT_EXPORT QWaylandTabletV2 : public QObject, public QtWayland::zwp_tablet_v2 class Q_WAYLAND_CLIENT_EXPORT QWaylandTabletV2 : public QObject, public QtWayland::zwp_tablet_v2

View File

@ -386,7 +386,7 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect)
} }
static QVector<QPointer<QWaylandWindow>> activePopups; static QList<QPointer<QWaylandWindow>> activePopups;
void QWaylandWindow::closePopups(QWaylandWindow *parent) void QWaylandWindow::closePopups(QWaylandWindow *parent)
{ {

View File

@ -217,7 +217,7 @@ protected:
QScopedPointer<QWaylandSurface> mSurface; QScopedPointer<QWaylandSurface> mSurface;
QWaylandShellSurface *mShellSurface = nullptr; QWaylandShellSurface *mShellSurface = nullptr;
QWaylandSubSurface *mSubSurfaceWindow = nullptr; QWaylandSubSurface *mSubSurfaceWindow = nullptr;
QVector<QWaylandSubSurface *> mChildren; QList<QWaylandSubSurface *> mChildren;
QWaylandAbstractDecoration *mWindowDecoration = nullptr; QWaylandAbstractDecoration *mWindowDecoration = nullptr;
bool mMouseEventsInContentArea = false; bool mMouseEventsInContentArea = false;

View File

@ -71,7 +71,7 @@ public:
default: return QImage::Format_Invalid; default: return QImage::Format_Invalid;
} }
} }
static inline QVector<wl_shm_format> supportedWaylandFormats(); static inline QList<wl_shm_format> supportedWaylandFormats();
private: private:
//IMPLEMENTATION (which has to be inline in the header because of the include trick) //IMPLEMENTATION (which has to be inline in the header because of the include trick)
@ -127,9 +127,9 @@ wl_shm_format QWaylandSharedMemoryFormatHelper::fromQImageFormat(QImage::Format
return array.data[format]; return array.data[format];
} }
QVector<wl_shm_format> QWaylandSharedMemoryFormatHelper::supportedWaylandFormats() QList<wl_shm_format> QWaylandSharedMemoryFormatHelper::supportedWaylandFormats()
{ {
QVector<wl_shm_format> retFormats; QList<wl_shm_format> retFormats;
Array array = getData(); Array array = getData();
for (size_t i = 0; i < array.size; i++) { for (size_t i = 0; i < array.size; i++) {
if (int(array.data[i]) != INT_MIN if (int(array.data[i]) != INT_MIN

View File

@ -123,13 +123,13 @@ private:
QByteArray m_scannerName; QByteArray m_scannerName;
QByteArray m_headerPath; QByteArray m_headerPath;
QByteArray m_prefix; QByteArray m_prefix;
QVector <QByteArray> m_includes; QList <QByteArray> m_includes;
QXmlStreamReader *m_xml = nullptr; QXmlStreamReader *m_xml = nullptr;
}; };
bool Scanner::parseArguments(int argc, char **argv) bool Scanner::parseArguments(int argc, char **argv)
{ {
QVector<QByteArray> args; QList<QByteArray> args;
args.reserve(argc); args.reserve(argc);
for (int i = 0; i < argc; ++i) for (int i = 0; i < argc; ++i)
args << QByteArray(argv[i]); args << QByteArray(argv[i]);

View File

@ -85,7 +85,7 @@ QByteArray tst_inputcontext::inputContextName() const
void tst_inputcontext::ensureTextInputPresentOnCompositor() void tst_inputcontext::ensureTextInputPresentOnCompositor()
{ {
exec([&] { exec([&] {
QVector<TextInputManager *> extensions = getAll<TextInputManager>(); QList<TextInputManager *> extensions = getAll<TextInputManager>();
if (extensions.length() > 1) if (extensions.length() > 1)
QFAIL("TextInputManager is a singleton, hence there should not be more then one object returned"); QFAIL("TextInputManager is a singleton, hence there should not be more then one object returned");
if (extensions.length() == 0) if (extensions.length() == 0)
@ -96,7 +96,7 @@ void tst_inputcontext::ensureTextInputPresentOnCompositor()
void tst_inputcontext::ensureTextInputNotPresentOnCompositor() void tst_inputcontext::ensureTextInputNotPresentOnCompositor()
{ {
exec([&] { exec([&] {
QVector<TextInputManager *> extensions = getAll<TextInputManager>(); QList<TextInputManager *> extensions = getAll<TextInputManager>();
if (extensions.length() > 1) if (extensions.length() > 1)
QFAIL("TextInputManager is a singleton, hence there should not be more then one object returned"); QFAIL("TextInputManager is a singleton, hence there should not be more then one object returned");
if (extensions.length() == 1) if (extensions.length() == 1)

View File

@ -140,7 +140,7 @@ public:
PrimarySelectionDeviceManagerV1 *m_manager = nullptr; PrimarySelectionDeviceManagerV1 *m_manager = nullptr;
Seat *m_seat = nullptr; Seat *m_seat = nullptr;
QVector<PrimarySelectionOfferV1 *> m_sentSelectionOffers; QList<PrimarySelectionOfferV1 *> m_sentSelectionOffers;
PrimarySelectionSourceV1 *m_selectionSource = nullptr; PrimarySelectionSourceV1 *m_selectionSource = nullptr;
uint m_serial = 0; uint m_serial = 0;
@ -194,7 +194,7 @@ public:
int m_version = 1; // TODO: Remove on libwayland upgrade int m_version = 1; // TODO: Remove on libwayland upgrade
QMap<Seat *, PrimarySelectionDeviceV1 *> m_devices; QMap<Seat *, PrimarySelectionDeviceV1 *> m_devices;
QVector<PrimarySelectionSourceV1 *> m_sources; QList<PrimarySelectionSourceV1 *> m_sources;
protected: protected:
void zwp_primary_selection_device_manager_v1_destroy(Resource *resource) override void zwp_primary_selection_device_manager_v1_destroy(Resource *resource) override
{ {
@ -459,7 +459,7 @@ void tst_primaryselectionv1::copy()
window.show(); window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
QVector<uint> mouseSerials; QList<uint> mouseSerials;
exec([&] { exec([&] {
auto *surface = xdgSurface()->m_surface; auto *surface = xdgSurface()->m_surface;
keyboard()->sendEnter(surface); // Need to set keyboard focus according to protocol keyboard()->sendEnter(surface); // Need to set keyboard focus according to protocol

View File

@ -292,7 +292,7 @@ void tst_seatv4::simpleAxis()
QPoint pixelDelta; QPoint pixelDelta;
QPoint angleDelta; // eights of a degree, positive is upwards, left QPoint angleDelta; // eights of a degree, positive is upwards, left
}; };
QVector<Event> m_events; QList<Event> m_events;
}; };
WheelWindow window; WheelWindow window;
@ -351,7 +351,7 @@ static bool supportsCursorSize(uint size, wl_shm *shm)
return false; return false;
} }
static bool supportsCursorSizes(const QVector<uint> &sizes) static bool supportsCursorSizes(const QList<uint> &sizes)
{ {
auto *waylandIntegration = static_cast<QtWaylandClient::QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration()); auto *waylandIntegration = static_cast<QtWaylandClient::QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration());
wl_shm *shm = waylandIntegration->display()->shm()->object(); wl_shm *shm = waylandIntegration->display()->shm()->object();

View File

@ -161,7 +161,7 @@ public:
QPoint angleDelta; // eights of a degree, positive is upwards, left QPoint angleDelta; // eights of a degree, positive is upwards, left
Qt::MouseEventSource source{}; Qt::MouseEventSource source{};
}; };
QVector<Event> m_events; QList<Event> m_events;
}; };
void tst_seatv5::simpleAxis_data() void tst_seatv5::simpleAxis_data()
@ -401,7 +401,7 @@ public:
Qt::TouchPointStates touchPointStates{}; Qt::TouchPointStates touchPointStates{};
QList<QTouchEvent::TouchPoint> touchPoints; QList<QTouchEvent::TouchPoint> touchPoints;
}; };
QVector<Event> m_events; QList<Event> m_events;
}; };
void tst_seatv5::singleTap() void tst_seatv5::singleTap()

View File

@ -145,10 +145,10 @@ public:
* \brief Returns all globals with the given type, if any * \brief Returns all globals with the given type, if any
*/ */
template<typename global_type> template<typename global_type>
QVector<global_type *> getAll() QList<global_type *> getAll()
{ {
warnIfNotLockedByThread(Q_FUNC_INFO); warnIfNotLockedByThread(Q_FUNC_INFO);
QVector<global_type *> matching; QList<global_type *> matching;
for (auto *global : qAsConst(m_globals)) { for (auto *global : qAsConst(m_globals)) {
if (auto *casted = qobject_cast<global_type *>(global)) if (auto *casted = qobject_cast<global_type *>(global))
matching.append(casted); matching.append(casted);
@ -199,7 +199,7 @@ protected:
QByteArray m_socketName; QByteArray m_socketName;
wl_event_loop *m_eventLoop = nullptr; wl_event_loop *m_eventLoop = nullptr;
bool m_running = true; bool m_running = true;
QVector<Global *> m_globals; QList<Global *> m_globals;
QElapsedTimer m_timer; QElapsedTimer m_timer;
private: private:

View File

@ -485,7 +485,7 @@ uint Keyboard::sendKey(wl_client *client, uint key, uint state)
} }
// Shm implementation // Shm implementation
Shm::Shm(CoreCompositor *compositor, QVector<format> formats, int version) Shm::Shm(CoreCompositor *compositor, QList<format> formats, int version)
: QtWaylandServer::wl_shm(compositor->m_display, version) : QtWaylandServer::wl_shm(compositor->m_display, version)
, m_compositor(compositor) , m_compositor(compositor)
, m_formats(formats) , m_formats(formats)

View File

@ -120,9 +120,9 @@ public:
uint configureSerial = 0; uint configureSerial = 0;
int bufferScale = 1; int bufferScale = 1;
} m_pending, m_committed; } m_pending, m_committed;
QVector<DoubleBufferedState *> m_commits; QList<DoubleBufferedState *> m_commits;
QVector<Callback *> m_waitingFrameCallbacks; QList<Callback *> m_waitingFrameCallbacks;
QVector<Output *> m_outputs; QList<Output *> m_outputs;
SurfaceRole *m_role = nullptr; SurfaceRole *m_role = nullptr;
signals: signals:
@ -149,7 +149,7 @@ public:
{} {}
bool isClean() override; bool isClean() override;
QString dirtyMessage() override; QString dirtyMessage() override;
QVector<Surface *> m_surfaces; QList<Surface *> m_surfaces;
CoreCompositor *m_compositor = nullptr; CoreCompositor *m_compositor = nullptr;
signals: signals:
@ -181,7 +181,7 @@ public:
explicit SubCompositor(CoreCompositor *compositor, int version = 1) explicit SubCompositor(CoreCompositor *compositor, int version = 1)
: QtWaylandServer::wl_subcompositor(compositor->m_display, version) : QtWaylandServer::wl_subcompositor(compositor->m_display, version)
{} {}
QVector<Subsurface *> m_subsurfaces; QList<Subsurface *> m_subsurfaces;
signals: signals:
void subsurfaceCreated(Subsurface *subsurface); void subsurfaceCreated(Subsurface *subsurface);
@ -270,13 +270,13 @@ public:
CoreCompositor *m_compositor = nullptr; CoreCompositor *m_compositor = nullptr;
Pointer* m_pointer = nullptr; Pointer* m_pointer = nullptr;
QVector<Pointer *> m_oldPointers; QList<Pointer *> m_oldPointers;
Touch* m_touch = nullptr; Touch* m_touch = nullptr;
QVector<Touch *> m_oldTouchs; QList<Touch *> m_oldTouchs;
Keyboard* m_keyboard = nullptr; Keyboard* m_keyboard = nullptr;
QVector<Keyboard *> m_oldKeyboards; QList<Keyboard *> m_oldKeyboards;
uint m_capabilities = 0; uint m_capabilities = 0;
@ -313,7 +313,7 @@ public:
void sendFrame(wl_client *client); void sendFrame(wl_client *client);
Seat *m_seat = nullptr; Seat *m_seat = nullptr;
QVector<uint> m_enterSerials; QList<uint> m_enterSerials;
QPoint m_hotspot; QPoint m_hotspot;
signals: signals:
@ -365,11 +365,11 @@ class Shm : public Global, public QtWaylandServer::wl_shm
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit Shm(CoreCompositor *compositor, QVector<format> formats = {format_argb8888, format_xrgb8888, format_rgb888}, int version = 1); explicit Shm(CoreCompositor *compositor, QList<format> formats = {format_argb8888, format_xrgb8888, format_rgb888}, int version = 1);
bool isClean() override; bool isClean() override;
CoreCompositor *m_compositor = nullptr; CoreCompositor *m_compositor = nullptr;
QVector<ShmPool *> m_pools; QList<ShmPool *> m_pools;
const QVector<format> m_formats; const QList<format> m_formats;
protected: protected:
void shm_create_pool(Resource *resource, uint32_t id, int32_t fd, int32_t size) override; void shm_create_pool(Resource *resource, uint32_t id, int32_t fd, int32_t size) override;
@ -386,7 +386,7 @@ class ShmPool : QObject, public QtWaylandServer::wl_shm_pool
public: public:
explicit ShmPool(Shm *shm, wl_client *client, int id, int version = 1); explicit ShmPool(Shm *shm, wl_client *client, int id, int version = 1);
Shm *m_shm = nullptr; Shm *m_shm = nullptr;
QVector<ShmBuffer *> m_buffers; QList<ShmBuffer *> m_buffers;
protected: protected:
void shm_pool_create_buffer(Resource *resource, uint32_t id, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format) override; void shm_pool_create_buffer(Resource *resource, uint32_t id, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format) override;

View File

@ -71,7 +71,7 @@ public:
DataDeviceManager *m_manager = nullptr; DataDeviceManager *m_manager = nullptr;
Seat *m_seat = nullptr; Seat *m_seat = nullptr;
QVector<DataOffer *> m_sentSelectionOffers; QList<DataOffer *> m_sentSelectionOffers;
protected: protected:
void data_device_release(Resource *resource) override void data_device_release(Resource *resource) override

View File

@ -168,12 +168,12 @@ XdgToplevel::XdgToplevel(XdgSurface *xdgSurface, int id, int version)
connect(surface(), &Surface::commit, this, [this] { m_committed = m_pending; }); connect(surface(), &Surface::commit, this, [this] { m_committed = m_pending; });
} }
void XdgToplevel::sendConfigure(const QSize &size, const QVector<uint> &states) void XdgToplevel::sendConfigure(const QSize &size, const QList<uint> &states)
{ {
send_configure(size.width(), size.height(), toByteArray(states)); send_configure(size.width(), size.height(), toByteArray(states));
} }
uint XdgToplevel::sendCompleteConfigure(const QSize &size, const QVector<uint> &states) uint XdgToplevel::sendCompleteConfigure(const QSize &size, const QList<uint> &states)
{ {
sendConfigure(size, states); sendConfigure(size, states);
return m_xdgSurface->sendConfigure(); return m_xdgSurface->sendConfigure();

View File

@ -48,7 +48,7 @@ public:
void send_ping(uint32_t) = delete; // It's a global, use resource specific instead void send_ping(uint32_t) = delete; // It's a global, use resource specific instead
bool isClean() override { return m_xdgSurfaces.empty(); } bool isClean() override { return m_xdgSurfaces.empty(); }
QString dirtyMessage() override { return m_xdgSurfaces.empty() ? "clean" : "remaining xdg surfaces"; } QString dirtyMessage() override { return m_xdgSurfaces.empty() ? "clean" : "remaining xdg surfaces"; }
QVector<XdgSurface *> m_xdgSurfaces; QList<XdgSurface *> m_xdgSurfaces;
XdgToplevel *toplevel(int i = 0); XdgToplevel *toplevel(int i = 0);
XdgPopup *popup(int i = 0); XdgPopup *popup(int i = 0);
XdgPopup *m_topmostGrabbingPopup = nullptr; XdgPopup *m_topmostGrabbingPopup = nullptr;
@ -86,13 +86,13 @@ public:
XdgWmBase *m_xdgWmBase = nullptr; XdgWmBase *m_xdgWmBase = nullptr;
Surface *m_surface = nullptr; Surface *m_surface = nullptr;
bool m_configureSent = false; bool m_configureSent = false;
QVector<uint> m_pendingConfigureSerials; QList<uint> m_pendingConfigureSerials;
uint m_ackedConfigureSerial = 0; uint m_ackedConfigureSerial = 0;
uint m_committedConfigureSerial = 0; uint m_committedConfigureSerial = 0;
struct DoubleBufferedState { struct DoubleBufferedState {
QRect windowGeometry = {0, 0, 0, 0}; QRect windowGeometry = {0, 0, 0, 0};
} m_pending, m_committed; } m_pending, m_committed;
QVector<XdgPopup *> m_popups; QList<XdgPopup *> m_popups;
public slots: public slots:
void verifyConfigured() { QVERIFY(m_configureSent); } void verifyConfigured() { QVERIFY(m_configureSent); }
@ -115,8 +115,8 @@ class XdgToplevel : public QObject, public QtWaylandServer::xdg_toplevel
Q_OBJECT Q_OBJECT
public: public:
explicit XdgToplevel(XdgSurface *xdgSurface, int id, int version = 1); explicit XdgToplevel(XdgSurface *xdgSurface, int id, int version = 1);
void sendConfigure(const QSize &size = {0, 0}, const QVector<uint> &states = {}); void sendConfigure(const QSize &size = {0, 0}, const QList<uint> &states = {});
uint sendCompleteConfigure(const QSize &size = {0, 0}, const QVector<uint> &states = {}); uint sendCompleteConfigure(const QSize &size = {0, 0}, const QList<uint> &states = {});
Surface *surface() { return m_xdgSurface->m_surface; } Surface *surface() { return m_xdgSurface->m_surface; }
XdgSurface *m_xdgSurface = nullptr; XdgSurface *m_xdgSurface = nullptr;

View File

@ -199,7 +199,7 @@ void MockCompositor::sendIviSurfaceConfigure(const QSharedPointer<MockIviSurface
processCommand(command); processCommand(command);
} }
void MockCompositor::sendXdgToplevelV6Configure(const QSharedPointer<MockXdgToplevelV6> toplevel, const QSize &size, const QVector<uint> &states) void MockCompositor::sendXdgToplevelV6Configure(const QSharedPointer<MockXdgToplevelV6> toplevel, const QSize &size, const QList<uint> &states)
{ {
Command command = makeCommand(Impl::Compositor::sendXdgToplevelV6Configure, m_compositor); Command command = makeCommand(Impl::Compositor::sendXdgToplevelV6Configure, m_compositor);
command.parameters << QVariant::fromValue(toplevel); command.parameters << QVariant::fromValue(toplevel);
@ -221,7 +221,7 @@ QSharedPointer<MockSurface> MockCompositor::surface()
QSharedPointer<MockSurface> result; QSharedPointer<MockSurface> result;
lock(); lock();
{ {
const QVector<Impl::Surface *> surfaces = m_compositor->surfaces(); const QList<Impl::Surface *> surfaces = m_compositor->surfaces();
for (Impl::Surface *surface : surfaces) { for (Impl::Surface *surface : surfaces) {
// we don't want to mistake the cursor surface for a window surface // we don't want to mistake the cursor surface for a window surface
if (surface->isMapped()) { if (surface->isMapped()) {
@ -415,12 +415,12 @@ void registerResource(wl_list *list, wl_resource *resource)
wl_resource_add_destroy_listener(resource, listener); wl_resource_add_destroy_listener(resource, listener);
} }
QVector<Surface *> Compositor::surfaces() const QList<Surface *> Compositor::surfaces() const
{ {
return m_surfaces; return m_surfaces;
} }
QVector<Output *> Compositor::outputs() const QList<Output *> Compositor::outputs() const
{ {
return m_outputs; return m_outputs;
} }

View File

@ -38,11 +38,11 @@
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <QImage> #include <QImage>
#include <QList>
#include <QMutex> #include <QMutex>
#include <QRect> #include <QRect>
#include <QSharedPointer> #include <QSharedPointer>
#include <QVariant> #include <QVariant>
#include <QVector>
#include <QWaitCondition> #include <QWaitCondition>
class MockCompositor; class MockCompositor;
@ -74,8 +74,8 @@ public:
uint32_t nextSerial(); uint32_t nextSerial();
uint32_t time() { return ++m_time; } uint32_t time() { return ++m_time; }
QVector<Surface *> surfaces() const; QList<Surface *> surfaces() const;
QVector<Output *> outputs() const; QList<Output *> outputs() const;
IviApplication *iviApplication() const; IviApplication *iviApplication() const;
XdgShellV6 *xdgShellV6() const; XdgShellV6 *xdgShellV6() const;
@ -130,8 +130,8 @@ private:
Keyboard *m_keyboard = nullptr; Keyboard *m_keyboard = nullptr;
Touch *m_touch = nullptr; Touch *m_touch = nullptr;
QScopedPointer<DataDeviceManager> m_data_device_manager; QScopedPointer<DataDeviceManager> m_data_device_manager;
QVector<Surface *> m_surfaces; QList<Surface *> m_surfaces;
QVector<Output *> m_outputs; QList<Output *> m_outputs;
QScopedPointer<IviApplication> m_iviApplication; QScopedPointer<IviApplication> m_iviApplication;
QScopedPointer<WlShell> m_wlShell; QScopedPointer<WlShell> m_wlShell;
QScopedPointer<XdgShellV6> m_xdgShellV6; QScopedPointer<XdgShellV6> m_xdgShellV6;
@ -242,7 +242,7 @@ public:
void sendShellSurfaceConfigure(const QSharedPointer<MockSurface> surface, const QSize &size = QSize(0, 0)); void sendShellSurfaceConfigure(const QSharedPointer<MockSurface> surface, const QSize &size = QSize(0, 0));
void sendIviSurfaceConfigure(const QSharedPointer<MockIviSurface> iviSurface, const QSize &size); void sendIviSurfaceConfigure(const QSharedPointer<MockIviSurface> iviSurface, const QSize &size);
void sendXdgToplevelV6Configure(const QSharedPointer<MockXdgToplevelV6> toplevel, const QSize &size = QSize(0, 0), void sendXdgToplevelV6Configure(const QSharedPointer<MockXdgToplevelV6> toplevel, const QSize &size = QSize(0, 0),
const QVector<uint> &states = { ZXDG_TOPLEVEL_V6_STATE_ACTIVATED }); const QList<uint> &states = { ZXDG_TOPLEVEL_V6_STATE_ACTIVATED });
void waitForStartDrag(); void waitForStartDrag();
QSharedPointer<MockSurface> surface(); QSharedPointer<MockSurface> surface();

View File

@ -31,7 +31,7 @@
#include <qwayland-server-fullscreen-shell-unstable-v1.h> #include <qwayland-server-fullscreen-shell-unstable-v1.h>
#include <QVector> #include <QList>
namespace Impl { namespace Impl {
@ -43,14 +43,14 @@ class FullScreenShellV1 : public QtWaylandServer::zwp_fullscreen_shell_v1
public: public:
explicit FullScreenShellV1(::wl_display *display) : zwp_fullscreen_shell_v1(display, 1) {} explicit FullScreenShellV1(::wl_display *display) : zwp_fullscreen_shell_v1(display, 1) {}
QVector<Surface *> surfaces() const { return m_surfaces; } QList<Surface *> surfaces() const { return m_surfaces; }
void removeSurface(Surface *surface) { m_surfaces.removeOne(surface); } void removeSurface(Surface *surface) { m_surfaces.removeOne(surface); }
protected: protected:
void zwp_fullscreen_shell_v1_present_surface(Resource *resource, struct ::wl_resource *surface, uint32_t method, struct ::wl_resource *output) override; void zwp_fullscreen_shell_v1_present_surface(Resource *resource, struct ::wl_resource *surface, uint32_t method, struct ::wl_resource *output) override;
private: private:
QVector<Surface *> m_surfaces; QList<Surface *> m_surfaces;
}; };
} // namespace Impl } // namespace Impl

View File

@ -31,8 +31,8 @@
#include <qwayland-server-ivi-application.h> #include <qwayland-server-ivi-application.h>
#include <QList>
#include <QSharedPointer> #include <QSharedPointer>
#include <QVector>
class MockIviSurface; class MockIviSurface;
@ -67,7 +67,7 @@ class IviApplication : public QtWaylandServer::ivi_application
{ {
public: public:
explicit IviApplication(::wl_display *display) : ivi_application(display, 1) {} explicit IviApplication(::wl_display *display) : ivi_application(display, 1) {}
QVector<IviSurface *> iviSurfaces() const { return m_iviSurfaces; } QList<IviSurface *> iviSurfaces() const { return m_iviSurfaces; }
protected: protected:
void ivi_application_surface_create(Resource *resource, uint32_t ivi_id, ::wl_resource *surface, uint32_t id) override; void ivi_application_surface_create(Resource *resource, uint32_t ivi_id, ::wl_resource *surface, uint32_t id) override;
@ -75,7 +75,7 @@ protected:
private: private:
void addIviSurface(IviSurface *iviSurface) { m_iviSurfaces.append(iviSurface); } void addIviSurface(IviSurface *iviSurface) { m_iviSurfaces.append(iviSurface); }
void removeIviSurface(IviSurface *iviSurface) { m_iviSurfaces.removeOne(iviSurface); } void removeIviSurface(IviSurface *iviSurface) { m_iviSurfaces.removeOne(iviSurface); }
QVector<IviSurface *> m_iviSurfaces; QList<IviSurface *> m_iviSurfaces;
friend class IviSurface; friend class IviSurface;
}; };

View File

@ -42,7 +42,7 @@ void Compositor::sendShellSurfaceConfigure(void *data, const QList<QVariant> &pa
QSize size = parameters.at(1).toSize(); QSize size = parameters.at(1).toSize();
Q_ASSERT(size.isValid()); Q_ASSERT(size.isValid());
if (auto toplevel = surface->xdgToplevelV6()) { if (auto toplevel = surface->xdgToplevelV6()) {
QVector<uint> states = { ZXDG_TOPLEVEL_V6_STATE_ACTIVATED }; QList<uint> states = { ZXDG_TOPLEVEL_V6_STATE_ACTIVATED };
auto statesBytes = QByteArray::fromRawData(reinterpret_cast<const char *>(states.data()), auto statesBytes = QByteArray::fromRawData(reinterpret_cast<const char *>(states.data()),
states.size() * static_cast<int>(sizeof(uint))); states.size() * static_cast<int>(sizeof(uint)));
toplevel->send_configure(size.width(), size.height(), statesBytes); toplevel->send_configure(size.width(), size.height(), statesBytes);

View File

@ -28,8 +28,8 @@
#include <qwayland-server-xdg-shell-unstable-v6.h> #include <qwayland-server-xdg-shell-unstable-v6.h>
#include <QList>
#include <QSharedPointer> #include <QSharedPointer>
#include <QVector>
#ifndef MOCKXDGSHELLV6_H #ifndef MOCKXDGSHELLV6_H
#define MOCKXDGSHELLV6_H #define MOCKXDGSHELLV6_H
@ -96,7 +96,7 @@ class XdgShellV6 : public QtWaylandServer::zxdg_shell_v6
{ {
public: public:
explicit XdgShellV6(::wl_display *display) : zxdg_shell_v6(display, 1) {} explicit XdgShellV6(::wl_display *display) : zxdg_shell_v6(display, 1) {}
QVector<XdgToplevelV6 *> toplevels() const { return m_toplevels; } QList<XdgToplevelV6 *> toplevels() const { return m_toplevels; }
protected: protected:
void zxdg_shell_v6_get_xdg_surface(Resource *resource, uint32_t id, ::wl_resource *surface) override; void zxdg_shell_v6_get_xdg_surface(Resource *resource, uint32_t id, ::wl_resource *surface) override;
@ -104,7 +104,7 @@ protected:
private: private:
void addToplevel(XdgToplevelV6 *toplevel) { m_toplevels.append(toplevel); } void addToplevel(XdgToplevelV6 *toplevel) { m_toplevels.append(toplevel); }
void removeToplevel(XdgToplevelV6 *toplevel) { m_toplevels.removeOne(toplevel); } void removeToplevel(XdgToplevelV6 *toplevel) { m_toplevels.removeOne(toplevel); }
QVector<XdgToplevelV6 *> m_toplevels; QList<XdgToplevelV6 *> m_toplevels;
friend class XdgToplevelV6; friend class XdgToplevelV6;
}; };

View File

@ -208,12 +208,12 @@ public:
TabletManagerV2 *m_manager = nullptr; TabletManagerV2 *m_manager = nullptr;
Seat *m_seat = nullptr; Seat *m_seat = nullptr;
QVector<TabletV2 *> m_tablets; QList<TabletV2 *> m_tablets;
QVector<TabletV2 *> m_tabletsWaitingForDestroy; QList<TabletV2 *> m_tabletsWaitingForDestroy;
QVector<TabletToolV2 *> m_tools; QList<TabletToolV2 *> m_tools;
QVector<TabletToolV2 *> m_toolsWaitingForDestroy; QList<TabletToolV2 *> m_toolsWaitingForDestroy;
QVector<TabletPadV2 *> m_pads; QList<TabletPadV2 *> m_pads;
QVector<TabletPadV2 *> m_padsWaitingForDestroy; QList<TabletPadV2 *> m_padsWaitingForDestroy;
protected: protected:
void zwp_tablet_seat_v2_bind_resource(Resource *resource) void zwp_tablet_seat_v2_bind_resource(Resource *resource)
@ -445,7 +445,7 @@ class ProximityFilter : public QObject {
public: public:
ProximityFilter() { qApp->installEventFilter(this); } ProximityFilter() { qApp->installEventFilter(this); }
~ProximityFilter() override { qDeleteAll(m_events); } ~ProximityFilter() override { qDeleteAll(m_events); }
QVector<QTabletEvent *> m_events; QList<QTabletEvent *> m_events;
int nextEventIndex = 0; int nextEventIndex = 0;
int numEvents() const { return m_events.size() - nextEventIndex; } int numEvents() const { return m_events.size() - nextEventIndex; }
@ -621,7 +621,7 @@ signals:
void tabletEventReceived(QTabletEvent *event); void tabletEventReceived(QTabletEvent *event);
private: private:
QVector<QTabletEvent *> m_events; QList<QTabletEvent *> m_events;
}; };
void tst_tabletv2::moveEvent() void tst_tabletv2::moveEvent()

View File

@ -370,7 +370,7 @@ void tst_xdgshell::switchPopups()
m_popups << new Popup(this); m_popups << new Popup(this);
} }
~Window() override { qDeleteAll(m_popups); } ~Window() override { qDeleteAll(m_popups); }
QVector<Popup *> m_popups; QList<Popup *> m_popups;
}; };
Window window; Window window;