mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 12:45:06 +00:00
LibGUI: Don't require passing model to FileSystemModel::Node APIs
The Node API was obnoxiously requiring you to pass the model into it all the time, simply because nodes could not find their way back to the containing model. This patch adds a back-reference to the model and simplifies the API.
This commit is contained in:
parent
38d8426f32
commit
f0349323c4
5 changed files with 47 additions and 40 deletions
|
@ -93,7 +93,7 @@ void DirectoryView::handle_activation(const GUI::ModelIndex& index)
|
|||
return;
|
||||
dbgprintf("on activation: %d,%d, this=%p, m_model=%p\n", index.row(), index.column(), this, m_model.ptr());
|
||||
auto& node = model().node(index);
|
||||
auto path = node.full_path(model());
|
||||
auto path = node.full_path();
|
||||
|
||||
struct stat st;
|
||||
if (stat(path.characters(), &st) < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue