Add overload Workspace::hasClient(const AbstractClient*)

Delegates to hasClient(const Client*) if the AbstractClient is a
Client. Needs to be extended for other AbstractClient subclasses.
icc-effect-5.14.5
Martin Gräßlin 2015-03-05 12:41:15 +01:00
parent 792745c963
commit 1b02837d0b
2 changed files with 10 additions and 0 deletions

View File

@ -1654,6 +1654,15 @@ Toplevel *Workspace::findToplevel(std::function<bool (const Toplevel*)> func) co
return nullptr;
}
bool Workspace::hasClient(const AbstractClient *c)
{
if (auto cc = dynamic_cast<const Client*>(c)) {
return hasClient(cc);
}
// TODO: test for ShellClient
return false;
}
} // namespace
#include "workspace.moc"

View File

@ -74,6 +74,7 @@ public:
bool workspaceEvent(QEvent*);
bool hasClient(const Client*);
bool hasClient(const AbstractClient*);
/**
* @brief Finds the first Client matching the condition expressed by passed in @p func.