Properly show the header title when started with non-QML KCMs
Calling KTitleWidget::setVisible(true)
, i.e. QWidget::setVisble(true)
,
does not necessarily mean that isVisible()
will return true as well.
It can still be false if its ancestors are invisible.
When starting System Settings with a QWidgets-based KCM as starting page (e.g. via KRunner or CLI), this resulted in the module name not showing up as header title.
This commit decides whether or not to set the custom header text
based on the original boolean condition, as opposed to checking
isVisible()
after setVisible()
with that boolean.
Can be tested with KCMs such as Touchpad or Keyboard. Unfortunately unrelated to Bug 471942 which is what I was actually trying to fix. I'll find that one too, sooner or later.