From 32a3def8092d7fcfccb171fb5432f26c336f2897 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 30 Jul 2023 18:29:19 +0000 Subject: [PATCH] plasma: replace QVarLengthArray with std::vector Signed-off-by: Ivailo Monev --- plasma/windoweffects.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plasma/windoweffects.cpp b/plasma/windoweffects.cpp index c00d608e..147c0290 100644 --- a/plasma/windoweffects.cpp +++ b/plasma/windoweffects.cpp @@ -18,17 +18,17 @@ */ #include "windoweffects.h" -#include +#include "theme.h" #include -#include "theme.h" +#include #ifdef Q_WS_X11 - #include - #include - #include - #include +# include +# include +# include +# include #endif namespace Plasma @@ -91,7 +91,7 @@ void slideWindow(WId id, Plasma::Location location, int offset) #ifdef Q_WS_X11 Display *dpy = QX11Info::display(); Atom atom = XInternAtom(dpy, "_KDE_SLIDE", False); - QVarLengthArray data(2); + std::vector data(2); data[0] = offset; @@ -159,7 +159,7 @@ void showWindowThumbnails(WId parent, const QList &windows, const QList data(1 + (6 * numWindows)); + std::vector data(1 + (6 * numWindows)); data[0] = numWindows; QList::const_iterator rectsIt = rects.constBegin(); @@ -188,11 +188,11 @@ void presentWindows(WId controller, const QList &ids) { #ifdef Q_WS_X11 const int numWindows = ids.count(); - QVarLengthArray data(numWindows); + std::vector data(numWindows); for (int i = 0; i < numWindows; ++i) { data[i] = ids.at(i); } - if (!data.isEmpty()) { + if (data.size() > 0) { Display *dpy = QX11Info::display(); Atom atom = XInternAtom(dpy, "_KDE_PRESENT_WINDOWS_GROUP", False); XChangeProperty(dpy, controller, atom, atom, 32, PropModeReplace, @@ -204,7 +204,7 @@ void presentWindows(WId controller, const QList &ids) void presentWindows(WId controller, int desktop) { #ifdef Q_WS_X11 - QVarLengthArray data(1); + std::vector data(1); data[0] = desktop; Display *dpy = QX11Info::display(); Atom atom = XInternAtom(dpy, "_KDE_PRESENT_WINDOWS_DESKTOP", False); @@ -225,12 +225,12 @@ void highlightWindows(WId controller, const QList &ids) return; } - QVarLengthArray data(numWindows); + std::vector data(numWindows); for (int i = 0; i < numWindows; ++i) { data[i] = ids.at(i); } - if (!data.isEmpty()) { + if (data.size() > 0) { XChangeProperty(dpy, controller, atom, atom, 32, PropModeReplace, reinterpret_cast(data.data()), data.size()); }