mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
HackStudio: Show the project name as the root in the project tree
This commit is contained in:
parent
6e27b14a4a
commit
5ff9ac1276
2 changed files with 4 additions and 0 deletions
|
@ -141,6 +141,8 @@ private:
|
||||||
Project::Project(const String& path, Vector<String>&& filenames)
|
Project::Project(const String& path, Vector<String>&& filenames)
|
||||||
: m_path(path)
|
: m_path(path)
|
||||||
{
|
{
|
||||||
|
m_name = FileSystemPath(m_path).basename();
|
||||||
|
|
||||||
m_file_icon = GIcon(GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"));
|
m_file_icon = GIcon(GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"));
|
||||||
m_cplusplus_icon = GIcon(GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-cplusplus.png"));
|
m_cplusplus_icon = GIcon(GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-cplusplus.png"));
|
||||||
m_header_icon = GIcon(GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-header.png"));
|
m_header_icon = GIcon(GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-header.png"));
|
||||||
|
@ -210,6 +212,7 @@ ProjectFile* Project::get_file(const String& filename)
|
||||||
void Project::rebuild_tree()
|
void Project::rebuild_tree()
|
||||||
{
|
{
|
||||||
auto root = adopt(*new ProjectTreeNode);
|
auto root = adopt(*new ProjectTreeNode);
|
||||||
|
root->name = m_name;
|
||||||
root->type = ProjectTreeNode::Type::Project;
|
root->type = ProjectTreeNode::Type::Project;
|
||||||
|
|
||||||
for (auto& file : m_files) {
|
for (auto& file : m_files) {
|
||||||
|
|
|
@ -37,6 +37,7 @@ private:
|
||||||
const ProjectTreeNode& root_node() const { return *m_root_node; }
|
const ProjectTreeNode& root_node() const { return *m_root_node; }
|
||||||
void rebuild_tree();
|
void rebuild_tree();
|
||||||
|
|
||||||
|
String m_name;
|
||||||
String m_path;
|
String m_path;
|
||||||
RefPtr<GModel> m_model;
|
RefPtr<GModel> m_model;
|
||||||
NonnullRefPtrVector<ProjectFile> m_files;
|
NonnullRefPtrVector<ProjectFile> m_files;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue