Port DebugConsole to Workspace::allClientList()

This simplifies the code by porting the debug console away from
Workspace::clientList() to Workspace::allClientList(). The main
difference between the two is that the former returns only all X11
windows and the latter returns both X11 and Wayland windows.
master
Vlad Zahorodnii 2020-10-01 14:28:14 +03:00
parent 56f159dded
commit 0f9722ad69
1 changed files with 2 additions and 9 deletions

View File

@ -15,7 +15,6 @@
#include "scene.h"
#include "unmanaged.h"
#include "waylandclient.h"
#include "wayland_server.h"
#include "workspace.h"
#include "keyboard_input.h"
#include "input_event.h"
@ -864,14 +863,8 @@ void DebugConsoleModel::remove(int parentRow, QVector<T*> &clients, T *client)
DebugConsoleModel::DebugConsoleModel(QObject *parent)
: QAbstractItemModel(parent)
{
if (waylandServer()) {
const auto clients = waylandServer()->clients();
for (auto c : clients) {
handleClientAdded(c);
}
}
const auto x11Clients = workspace()->clientList();
for (auto c : x11Clients) {
const auto clients = workspace()->allClientList();
for (auto c : clients) {
handleClientAdded(c);
}
connect(workspace(), &Workspace::clientAdded, this, &DebugConsoleModel::handleClientAdded);