1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

LibGUI: Start working on a GFileSystemModel and hook that up in FileManager.

This is a read-only model for the tree view, at least initially. We'll see
where we take it from there once it's more polished.
This commit is contained in:
Andreas Kling 2019-03-29 17:03:30 +01:00
parent f249c40aaa
commit 4d3c5fd83e
7 changed files with 205 additions and 6 deletions

View file

@ -5,7 +5,7 @@ OBJS = \
APP = FileManager
STANDARD_FLAGS = -std=c++17
STANDARD_FLAGS = -std=c++17 -Wno-sized-deallocation
WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
FLAVOR_FLAGS = -fno-exceptions -fno-rtti
OPTIMIZATION_FLAGS = -Os

View file

@ -12,6 +12,7 @@
#include <LibGUI/GMessageBox.h>
#include <LibGUI/GProgressBar.h>
#include <LibGUI/GTreeView.h>
#include <LibGUI/GFileSystemModel.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
@ -53,6 +54,7 @@ int main(int argc, char** argv)
auto* splitter = new GWidget(widget);
splitter->set_layout(make<GBoxLayout>(Orientation::Horizontal));
auto* tree_view = new GTreeView(splitter);
tree_view->set_model(GFileSystemModel::create("/"));
tree_view->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
tree_view->set_preferred_size({ 200, 0 });
auto* directory_view = new DirectoryView(splitter);