From 13ca1ee8dc56014dc42a66d1f86c8bbe8a086d16 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 12 Sep 2019 18:58:52 +0200 Subject: [PATCH] GDirectoryModel: Allow retrieving an item's full path via Role::Custom --- Libraries/LibGUI/GDirectoryModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibGUI/GDirectoryModel.cpp b/Libraries/LibGUI/GDirectoryModel.cpp index 5104199886..7724efef0e 100644 --- a/Libraries/LibGUI/GDirectoryModel.cpp +++ b/Libraries/LibGUI/GDirectoryModel.cpp @@ -238,6 +238,10 @@ GVariant GDirectoryModel::data(const GModelIndex& index, Role role) const { ASSERT(is_valid(index)); auto& entry = this->entry(index.row()); + if (role == Role::Custom) { + ASSERT(index.column() == Column::Name); + return entry.full_path(*this); + } if (role == Role::Sort) { switch (index.column()) { case Column::Icon: