Commit 51e9340a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Remove a Workspace::findAbstractClient() overload

Workspace::findAbstractClient(QUuid) overload is used only by the
windows krunner plugin.

This change fixes a potential null dereferencing and removes the
findAbstractClient() overload in favor of a more generic findToplevel()
overload.
parent 9ef882f3
Pipeline #173302 passed with stage
in 23 minutes and 2 seconds
......@@ -218,8 +218,11 @@ void WindowsRunner::Run(const QString &id, const QString &actionId)
return;
}
const auto uuid = QUuid::fromString(objectId);
const auto window = workspace()->findAbstractClient(uuid);
const auto window = workspace()->findToplevel(QUuid::fromString(objectId));
if (!window || !window->isClient()) {
return;
}
switch (action) {
case ActivateAction:
workspace()->activateWindow(window);
......
......@@ -1790,12 +1790,6 @@ Window *Workspace::findAbstractClient(std::function<bool(const Window *)> func)
return nullptr;
}
Window *Workspace::findAbstractClient(const QUuid &internalId) const
{
auto t = findToplevel(internalId);
return t && t->isClient() ? t : nullptr;
}
Unmanaged *Workspace::findUnmanaged(std::function<bool(const Unmanaged *)> func) const
{
return Window::findInList(m_unmanaged, func);
......
......@@ -103,7 +103,6 @@ public:
*/
X11Window *findClient(std::function<bool(const X11Window *)> func) const;
Window *findAbstractClient(std::function<bool(const Window *)> func) const;
Window *findAbstractClient(const QUuid &internalId) const;
/**
* @brief Finds the Client matching the given match @p predicate for the given window.
*
......
Supports Markdown
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