1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

Help+LibManual: Move non-UI-specific manual handling to LibManual

This is a first step in deduplicating code within and across Help and
man.

Because LibManual also doesn't contain any DeprecatedString, some
adjustments to Help's string handling is included, just to interoperate
with LibManual better. Further work in this area mostly requires String
APIs in LibGUI.
This commit is contained in:
kleines Filmröllchen 2022-07-13 00:20:27 +02:00 committed by Linus Groh
parent 78353ec184
commit ad6a55e1f0
18 changed files with 339 additions and 265 deletions

View file

@ -6,10 +6,10 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/NonnullRefPtr.h>
#include <AK/Optional.h>
#include <AK/Result.h>
#include <AK/String.h>
#include <LibGUI/Model.h>
class ManualModel final : public GUI::Model {
@ -23,10 +23,10 @@ public:
Optional<GUI::ModelIndex> index_from_path(StringView) const;
DeprecatedString page_name(const GUI::ModelIndex&) const;
DeprecatedString page_path(const GUI::ModelIndex&) const;
DeprecatedString page_and_section(const GUI::ModelIndex&) const;
ErrorOr<StringView> page_view(DeprecatedString const& path) const;
Optional<String> page_name(const GUI::ModelIndex&) const;
Optional<String> page_path(const GUI::ModelIndex&) const;
Optional<String> page_and_section(const GUI::ModelIndex&) const;
ErrorOr<StringView> page_view(String const& path) const;
void update_section_node_on_toggle(const GUI::ModelIndex&, bool const);
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
@ -42,5 +42,5 @@ private:
GUI::Icon m_section_open_icon;
GUI::Icon m_section_icon;
GUI::Icon m_page_icon;
mutable HashMap<DeprecatedString, NonnullRefPtr<Core::MappedFile>> m_mapped_files;
mutable HashMap<String, NonnullRefPtr<Core::MappedFile>> m_mapped_files;
};