Introduce Platform::findOutput(int) overload

This can be useful if there is a need to look up an output by id.
master
Vlad Zahorodnii 2020-08-18 21:42:45 +03:00
parent 6cfee149ea
commit 578d34dba9
3 changed files with 7 additions and 1 deletions

View File

@ -113,7 +113,7 @@ int OutputScreens::number(const QPoint &pos) const
AbstractOutput *OutputScreens::findOutput(int screen) const
{
return m_platform->enabledOutputs().value(screen);
return m_platform->findOutput(screen);
}
} // namespace

View File

@ -163,6 +163,11 @@ void Platform::requestOutputsChange(KWaylandServer::OutputConfigurationInterface
config->setApplied();
}
AbstractOutput *Platform::findOutput(int screenId)
{
return enabledOutputs().value(screenId);
}
AbstractOutput *Platform::findOutput(const QByteArray &uuid)
{
const auto outs = outputs();

View File

@ -410,6 +410,7 @@ public:
virtual Outputs enabledOutputs() const {
return Outputs();
}
AbstractOutput *findOutput(int screenId);
AbstractOutput *findOutput(const QByteArray &uuid);
/**