1
Fork 0
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:
Andreas Kling 2019-10-26 21:27:57 +02:00
parent b513a787fb
commit 9129dbe0b9
3 changed files with 49 additions and 6 deletions

View file

@ -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;
};