mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 03:05:07 +00:00
GFileSystemModel: Add a "DirectoriesOnly" mode.
This commit is contained in:
parent
4d3c5fd83e
commit
6b72c62c5f
3 changed files with 11 additions and 6 deletions
|
@ -5,9 +5,11 @@
|
|||
class GFileSystemModel : public GModel {
|
||||
friend class Node;
|
||||
public:
|
||||
static Retained<GFileSystemModel> create(const String& root_path = "/")
|
||||
enum Mode { Invalid, DirectoriesOnly, FilesAndDirectories };
|
||||
|
||||
static Retained<GFileSystemModel> create(const String& root_path = "/", Mode mode = Mode::FilesAndDirectories)
|
||||
{
|
||||
return adopt(*new GFileSystemModel(root_path));
|
||||
return adopt(*new GFileSystemModel(root_path, mode));
|
||||
}
|
||||
virtual ~GFileSystemModel() override;
|
||||
|
||||
|
@ -22,9 +24,10 @@ public:
|
|||
virtual void activate(const GModelIndex&) override;
|
||||
|
||||
private:
|
||||
explicit GFileSystemModel(const String& root_path);
|
||||
GFileSystemModel(const String& root_path, Mode);
|
||||
|
||||
String m_root_path;
|
||||
Mode m_mode { Invalid };
|
||||
|
||||
struct Node;
|
||||
Node* m_root { nullptr };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue