mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
Help: Ensure window title is updated when a subsection is selected
This commit is contained in:
parent
10700ca4c1
commit
2618639bdb
1 changed files with 8 additions and 7 deletions
|
@ -56,10 +56,10 @@ Optional<String> ManualModel::page_name(const GUI::ModelIndex& index) const
|
||||||
{
|
{
|
||||||
if (!index.is_valid())
|
if (!index.is_valid())
|
||||||
return {};
|
return {};
|
||||||
auto* node = static_cast<Manual::Node const*>(index.internal_data());
|
auto const* node = static_cast<Manual::Node const*>(index.internal_data());
|
||||||
if (!node->is_page())
|
auto const* page = node->document();
|
||||||
|
if (!page)
|
||||||
return {};
|
return {};
|
||||||
auto* page = static_cast<Manual::PageNode const*>(node);
|
|
||||||
auto path = page->name();
|
auto path = page->name();
|
||||||
if (path.is_error())
|
if (path.is_error())
|
||||||
return {};
|
return {};
|
||||||
|
@ -103,11 +103,12 @@ Optional<String> ManualModel::page_and_section(const GUI::ModelIndex& index) con
|
||||||
{
|
{
|
||||||
if (!index.is_valid())
|
if (!index.is_valid())
|
||||||
return {};
|
return {};
|
||||||
auto* node = static_cast<Manual::Node const*>(index.internal_data());
|
auto const* node = static_cast<Manual::Node const*>(index.internal_data());
|
||||||
if (!node->is_page())
|
auto const* page = node->document();
|
||||||
|
if (!page)
|
||||||
return {};
|
return {};
|
||||||
auto* page = static_cast<Manual::PageNode const*>(node);
|
|
||||||
auto* section = static_cast<Manual::SectionNode const*>(page->parent());
|
auto const* section = static_cast<Manual::SectionNode const*>(page->parent());
|
||||||
auto page_name = page->name();
|
auto page_name = page->name();
|
||||||
if (page_name.is_error())
|
if (page_name.is_error())
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue