From f27f2e0d3b3fe08e68534676a58aab8e1eeea676 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 29 Sep 2022 10:18:11 -0400 Subject: [PATCH] Welcome: Use StandardPaths to load README.md --- Userland/Applications/Welcome/WelcomeWidget.cpp | 8 ++------ Userland/Applications/Welcome/WelcomeWidget.h | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Userland/Applications/Welcome/WelcomeWidget.cpp b/Userland/Applications/Welcome/WelcomeWidget.cpp index 56b6d4ce3e6..5769cc5f4cb 100644 --- a/Userland/Applications/Welcome/WelcomeWidget.cpp +++ b/Userland/Applications/Welcome/WelcomeWidget.cpp @@ -25,6 +25,8 @@ WelcomeWidget::WelcomeWidget() load_from_gml(welcome_window_gml); m_web_view = find_descendant_of_type_named("web_view"); + m_web_view->load(URL::create_with_file_scheme(String::formatted("{}/README.md", Core::StandardPaths::home_directory()))); + m_tip_label = find_descendant_of_type_named("tip_label"); m_tip_frame = find_descendant_of_type_named("tip_frame"); @@ -66,7 +68,6 @@ WelcomeWidget::WelcomeWidget() Config::remove_group("SystemServer"sv, "Welcome"sv); }; - open_and_parse_readme_file(); if (auto result = open_and_parse_tips_file(); result.is_error()) { auto error = String::formatted("Opening \"{}/tips.txt\" failed: {}", Core::StandardPaths::documents_directory(), result.error()); m_tip_label->set_text(error); @@ -93,11 +94,6 @@ ErrorOr WelcomeWidget::open_and_parse_tips_file() return {}; } -void WelcomeWidget::open_and_parse_readme_file() -{ - m_web_view->load(URL::create_with_file_scheme("/home/anon/README.md")); -} - void WelcomeWidget::set_random_tip() { if (m_tips.is_empty()) diff --git a/Userland/Applications/Welcome/WelcomeWidget.h b/Userland/Applications/Welcome/WelcomeWidget.h index 361f224672b..ecb278f28c2 100644 --- a/Userland/Applications/Welcome/WelcomeWidget.h +++ b/Userland/Applications/Welcome/WelcomeWidget.h @@ -22,7 +22,6 @@ private: void set_random_tip(); ErrorOr open_and_parse_tips_file(); - void open_and_parse_readme_file(); RefPtr m_close_button; RefPtr m_next_button;