mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
HackStudio: Remove storing a vector of opened files in Project class
It looks to me like this has the same purpose as m_open_files in the HackStudioWidget, so removing it shouldn't change anything.
This commit is contained in:
parent
5bb6936a2a
commit
4a1974b174
2 changed files with 1 additions and 8 deletions
|
@ -48,13 +48,7 @@ void Project::for_each_text_file(Function<void(const ProjectFile&)> callback) co
|
||||||
NonnullRefPtr<ProjectFile> Project::get_file(const String& path) const
|
NonnullRefPtr<ProjectFile> Project::get_file(const String& path) const
|
||||||
{
|
{
|
||||||
auto full_path = to_absolute_path(path);
|
auto full_path = to_absolute_path(path);
|
||||||
for (auto& file : m_files) {
|
return ProjectFile::construct_with_name(full_path);
|
||||||
if (file.name() == full_path)
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
auto file = ProjectFile::construct_with_name(full_path);
|
|
||||||
m_files.append(file);
|
|
||||||
return file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String Project::to_absolute_path(const String& path) const
|
String Project::to_absolute_path(const String& path) const
|
||||||
|
|
|
@ -36,7 +36,6 @@ private:
|
||||||
String to_absolute_path(const String&) const;
|
String to_absolute_path(const String&) const;
|
||||||
|
|
||||||
RefPtr<GUI::FileSystemModel> m_model;
|
RefPtr<GUI::FileSystemModel> m_model;
|
||||||
mutable NonnullRefPtrVector<ProjectFile> m_files;
|
|
||||||
|
|
||||||
String m_root_path;
|
String m_root_path;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue