kscreenintegration: don't access optionals that may be missing a value
This commit is contained in:
parent
f70be829c6
commit
4f48258269
1 changed files with 2 additions and 2 deletions
|
@ -242,14 +242,14 @@ std::optional<std::pair<OutputConfiguration, QVector<Output *>>> readOutputConfi
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allDisabled = std::all_of(outputs.begin(), outputs.end(), [&cfg](const auto &output) {
|
bool allDisabled = std::all_of(outputs.begin(), outputs.end(), [&cfg](const auto &output) {
|
||||||
return !cfg.changeSet(output)->enabled;
|
return !cfg.changeSet(output)->enabled.value_or(output->isEnabled());
|
||||||
});
|
});
|
||||||
if (allDisabled) {
|
if (allDisabled) {
|
||||||
qCWarning(KWIN_CORE) << "KScreen config would disable all outputs!";
|
qCWarning(KWIN_CORE) << "KScreen config would disable all outputs!";
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
std::erase_if(outputOrder, [&cfg](const auto &pair) {
|
std::erase_if(outputOrder, [&cfg](const auto &pair) {
|
||||||
return !cfg.constChangeSet(pair.second)->enabled;
|
return !cfg.constChangeSet(pair.second)->enabled.value_or(pair.second->isEnabled());
|
||||||
});
|
});
|
||||||
std::sort(outputOrder.begin(), outputOrder.end(), [](const auto &left, const auto &right) {
|
std::sort(outputOrder.begin(), outputOrder.end(), [](const auto &left, const auto &right) {
|
||||||
if (left.first == right.first) {
|
if (left.first == right.first) {
|
||||||
|
|
Loading…
Reference in a new issue