Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 62d334eb authored by David Edmundson's avatar David Edmundson

[wayland] Move AbstractClient::desktops from QList to QVector

Summary:
Doesn't have any meaningful impact. It's the same performance when T is a pointer,
but it'll bring it consistent with VirtualDesktopManager::desktops

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16736
parent c42d1607
......@@ -602,10 +602,10 @@ void AbstractClient::setOnAllDesktops(bool b)
setDesktop(VirtualDesktopManager::self()->current());
}
QList<int> AbstractClient::x11DesktopIds() const
QVector<int> AbstractClient::x11DesktopIds() const
{
const auto desks = desktops();
QList<int> x11Ids;
QVector<int> x11Ids;
x11Ids.reserve(desks.count());
std::transform(desks.constBegin(), desks.constEnd(),
std::back_inserter(x11Ids),
......
......@@ -94,7 +94,7 @@ class KWIN_EXPORT AbstractClient : public Toplevel
/**
* The x11 ids for all desktops this client is in. On X11 this list will always have a length of 1
**/
Q_PROPERTY(QList<int> x11DesktopIds READ x11DesktopIds NOTIFY x11DesktopIdsChanged)
Q_PROPERTY(QVector<int> x11DesktopIds READ x11DesktopIds NOTIFY x11DesktopIdsChanged)
/**
* Indicates that the window should not be included on a taskbar.
**/
......@@ -432,13 +432,13 @@ public:
int desktop() const override {
return m_desktops.isEmpty() ? (int)NET::OnAllDesktops : m_desktops.last()->x11DesktopNumber();
}
virtual QList<VirtualDesktop *> desktops() const {
virtual QVector<VirtualDesktop *> desktops() const {
return m_desktops;
}
void removeDesktop(VirtualDesktop *desktop) {
m_desktops.removeAll(desktop);
}
QList<int> x11DesktopIds() const;
QVector<int> x11DesktopIds() const;
void setMinimized(bool set);
/**
......@@ -1122,7 +1122,7 @@ private:
bool m_demandsAttention = false;
bool m_minimized = false;
QTimer *m_autoRaiseTimer = nullptr;
QList <VirtualDesktop *> m_desktops;
QVector <VirtualDesktop *> m_desktops;
QString m_colorScheme;
std::shared_ptr<Decoration::DecorationPalette> m_palette;
......
......@@ -165,7 +165,7 @@ QStringList Deleted::activities() const
return activityList;
}
QList<VirtualDesktop *> Deleted::desktops() const
QVector<VirtualDesktop *> Deleted::desktops() const
{
return m_desktops;
}
......
......@@ -52,7 +52,7 @@ public:
void discard();
virtual int desktop() const;
virtual QStringList activities() const;
virtual QList<VirtualDesktop *> desktops() const;
virtual QVector<VirtualDesktop *> desktops() const;
virtual QPoint clientPos() const;
virtual QSize clientSize() const;
QPoint clientContentPos() const override {
......@@ -196,7 +196,7 @@ private:
QPoint m_contentPos;
QRect transparent_rect;
xcb_window_t m_frame;
QList <VirtualDesktop *> m_desktops;
QVector <VirtualDesktop *> m_desktops;
bool no_border;
QRect decoration_left;
......
......@@ -290,7 +290,7 @@ public:
* isOnDesktop() instead.
*/
virtual int desktop() const = 0;
virtual QList<VirtualDesktop *> desktops() const = 0;
virtual QVector<VirtualDesktop *> desktops() const = 0;
virtual QStringList activities() const = 0;
bool isOnDesktop(int d) const;
bool isOnActivity(const QString &activity) const;
......
......@@ -123,9 +123,9 @@ QStringList Unmanaged::activities() const
return QStringList();
}
QList<VirtualDesktop *> Unmanaged::desktops() const
QVector<VirtualDesktop *> Unmanaged::desktops() const
{
return QList<VirtualDesktop *>();
return QVector<VirtualDesktop *>();
}
QPoint Unmanaged::clientPos() const
......
......@@ -39,7 +39,7 @@ public:
static void deleteUnmanaged(Unmanaged* c);
virtual int desktop() const;
virtual QStringList activities() const;
virtual QList<VirtualDesktop *> desktops() const override;
virtual QVector<VirtualDesktop *> desktops() const override;
virtual QPoint clientPos() const;
virtual QSize clientSize() const;
virtual QRect transparentRect() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment