diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 8e32357c2c..fb068f9c0f 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -262,7 +262,7 @@ bool HackStudioWidget::open_file(const String& full_filename, size_t line, size_ if (auto it = m_open_files.find(filename); it != m_open_files.end()) { new_project_file = it->value; } else { - new_project_file = m_project->get_file(filename); + new_project_file = m_project->create_file(filename); m_open_files.set(filename, *new_project_file); m_open_files_vector.append(filename); @@ -699,7 +699,7 @@ NonnullRefPtr HackStudioWidget::create_save_as_action() } current_editor_wrapper().save(); - auto new_project_file = m_project->get_file(relative_file_path); + auto new_project_file = m_project->create_file(relative_file_path); m_open_files.set(relative_file_path, *new_project_file); m_open_files_vector.append(relative_file_path); diff --git a/Userland/DevTools/HackStudio/Project.cpp b/Userland/DevTools/HackStudio/Project.cpp index a56a736dea..2e6a4f3b77 100644 --- a/Userland/DevTools/HackStudio/Project.cpp +++ b/Userland/DevTools/HackStudio/Project.cpp @@ -40,12 +40,12 @@ static void traverse_model(const GUI::FileSystemModel& model, const GUI::ModelIn void Project::for_each_text_file(Function callback) const { traverse_model(model(), {}, [&](auto& index) { - auto file = get_file(model().full_path(index)); + auto file = create_file(model().full_path(index)); callback(*file); }); } -NonnullRefPtr Project::get_file(const String& path) const +NonnullRefPtr Project::create_file(const String& path) const { auto full_path = to_absolute_path(path); return ProjectFile::construct_with_name(full_path); diff --git a/Userland/DevTools/HackStudio/Project.h b/Userland/DevTools/HackStudio/Project.h index 5071eff8d0..0e00ffdc13 100644 --- a/Userland/DevTools/HackStudio/Project.h +++ b/Userland/DevTools/HackStudio/Project.h @@ -26,7 +26,7 @@ public: String name() const { return LexicalPath::basename(m_root_path); } String root_path() const { return m_root_path; } - NonnullRefPtr get_file(const String& path) const; + NonnullRefPtr create_file(const String& path) const; void for_each_text_file(Function) const;