mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 09:35:15 +00:00
GFileSystemModel: Add a "DirectoriesOnly" mode.
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user