mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibGUI+FileManager: Merge GDirectoryModel into GFileSystemModel
We used to have two different models for displaying file system contents: the FileManager-grade table-like directory model, which exposed rich data (such as file icons with integrated image previews) about contents of a single directory, and the tree-like GFileSystemModel, which only exposed a tree of file names with very basic info about them. This commit unifies the two. The new GFileSystemModel can be used both as a tree-like and as a table-like model, or in fact in both ways simultaneously. It exposes rich data about a file system subtree rooted at the given root. The users of the two previous models are all ported to use this new model.
This commit is contained in:
parent
0f18a16e2c
commit
fdeb91e000
12 changed files with 597 additions and 700 deletions
|
@ -4,7 +4,7 @@
|
|||
#include <LibCore/CFile.h>
|
||||
#include <LibGUI/GButton.h>
|
||||
#include <LibGUI/GDialog.h>
|
||||
#include <LibGUI/GDirectoryModel.h>
|
||||
#include <LibGUI/GFileSystemModel.h>
|
||||
#include <LibGUI/GLabel.h>
|
||||
#include <LibGUI/GTextBox.h>
|
||||
|
||||
|
@ -14,7 +14,7 @@ public:
|
|||
virtual ~PropertiesDialog() override;
|
||||
|
||||
private:
|
||||
explicit PropertiesDialog(GDirectoryModel&, String, bool disable_rename, CObject* parent = nullptr);
|
||||
PropertiesDialog(GFileSystemModel&, String, bool disable_rename, CObject* parent = nullptr);
|
||||
|
||||
struct PropertyValuePair {
|
||||
String property;
|
||||
|
@ -58,7 +58,7 @@ private:
|
|||
void update();
|
||||
String make_full_path(String name);
|
||||
|
||||
GDirectoryModel& m_model;
|
||||
GFileSystemModel& m_model;
|
||||
RefPtr<GButton> m_apply_button;
|
||||
RefPtr<GTextBox> m_name_box;
|
||||
RefPtr<GLabel> m_icon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue