Commit 5fb14728 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Simplify code

parent 8f662d8e
......@@ -137,11 +137,7 @@ void Osd::onOsdActionSelected(int action)
void Osd::onOutputAvailabilityChanged()
{
if (m_output) {
if (!m_output->isConnected() || !m_output->isEnabled() || !m_output->currentMode()) {
hideOsd();
}
} else {
if (!m_output || !m_output->isConnected() || !m_output->isEnabled() || !m_output->currentMode()) {
hideOsd();
}
}
......
......@@ -108,10 +108,8 @@ void OsdManager::slotIdentifyOutputs(KScreen::ConfigOperation *op)
if (!output->isConnected() || !output->isEnabled() || !output->currentMode()) {
continue;
}
KScreen::Osd* osd = nullptr;
if (m_osds.keys().contains(output->name())) {
osd = m_osds.value(output->name());
} else {
auto osd = m_osds.value(output->name());
if (!osd) {
osd = new KScreen::Osd(output, this);
m_osds.insert(output->name(), osd);
}
......@@ -136,10 +134,8 @@ void OsdManager::showOsd(const QString& icon, const QString& text)
if (!output->isConnected() || !output->isEnabled() || !output->currentMode()) {
continue;
}
KScreen::Osd* osd = nullptr;
if (m_osds.keys().contains(output->name())) {
osd = m_osds.value(output->name());
} else {
auto osd = m_osds.value(output->name());
if (!osd) {
osd = new KScreen::Osd(output, this);
m_osds.insert(output->name(), osd);
}
......
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