mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
HackStudio: Implement adding a new file to the project
You can now press Ctrl+N to create and add a new file to the project!
This commit is contained in:
parent
b513a787fb
commit
9129dbe0b9
3 changed files with 49 additions and 6 deletions
|
@ -12,6 +12,8 @@ class Project {
|
|||
public:
|
||||
static OwnPtr<Project> load_from_file(const String& path);
|
||||
|
||||
[[nodiscard]] bool add_file(const String& filename);
|
||||
|
||||
GModel& model() { return *m_model; }
|
||||
|
||||
template<typename Callback>
|
||||
|
@ -22,10 +24,12 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
friend class ProjectModel;
|
||||
explicit Project(Vector<String>&& files);
|
||||
explicit Project(const String& path, Vector<String>&& files);
|
||||
|
||||
String m_path;
|
||||
RefPtr<GModel> m_model;
|
||||
NonnullRefPtrVector<TextDocument> m_files;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue