mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
44
Libraries/LibGUI/GFileSystemModel.h
Normal file
44
Libraries/LibGUI/GFileSystemModel.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GModel.h>
|
||||
|
||||
class GFileSystemModel : public GModel {
|
||||
friend class Node;
|
||||
|
||||
public:
|
||||
enum Mode {
|
||||
Invalid,
|
||||
DirectoriesOnly,
|
||||
FilesAndDirectories
|
||||
};
|
||||
|
||||
static NonnullRefPtr<GFileSystemModel> create(const StringView& root_path = "/", Mode mode = Mode::FilesAndDirectories)
|
||||
{
|
||||
return adopt(*new GFileSystemModel(root_path, mode));
|
||||
}
|
||||
virtual ~GFileSystemModel() override;
|
||||
|
||||
String root_path() const { return m_root_path; }
|
||||
String path(const GModelIndex&) const;
|
||||
GModelIndex index(const StringView& path) const;
|
||||
|
||||
virtual int row_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual int column_count(const GModelIndex& = GModelIndex()) const override;
|
||||
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
||||
virtual void update() override;
|
||||
virtual GModelIndex parent_index(const GModelIndex&) const override;
|
||||
virtual GModelIndex index(int row, int column = 0, const GModelIndex& parent = GModelIndex()) const override;
|
||||
|
||||
private:
|
||||
GFileSystemModel(const StringView& root_path, Mode);
|
||||
|
||||
String m_root_path;
|
||||
Mode m_mode { Invalid };
|
||||
|
||||
struct Node;
|
||||
Node* m_root { nullptr };
|
||||
|
||||
GIcon m_open_folder_icon;
|
||||
GIcon m_closed_folder_icon;
|
||||
GIcon m_file_icon;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue