From f1c4b65089805463abea187313ea89d74da31e12 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 13 Sep 2019 21:43:23 +0200 Subject: [PATCH] GDirectoryModel: Add on_path_change hook --- Libraries/LibGUI/GDirectoryModel.cpp | 2 ++ Libraries/LibGUI/GDirectoryModel.h | 1 + 2 files changed, 3 insertions(+) diff --git a/Libraries/LibGUI/GDirectoryModel.cpp b/Libraries/LibGUI/GDirectoryModel.cpp index 7724efef0e..ac7abf59e9 100644 --- a/Libraries/LibGUI/GDirectoryModel.cpp +++ b/Libraries/LibGUI/GDirectoryModel.cpp @@ -351,5 +351,7 @@ void GDirectoryModel::open(const StringView& a_path) int rc = read(m_notifier->fd(), buffer, sizeof(buffer)); ASSERT(rc >= 0); }; + if (on_path_change) + on_path_change(); update(); } diff --git a/Libraries/LibGUI/GDirectoryModel.h b/Libraries/LibGUI/GDirectoryModel.h index 580454ec65..ec7fae7314 100644 --- a/Libraries/LibGUI/GDirectoryModel.h +++ b/Libraries/LibGUI/GDirectoryModel.h @@ -34,6 +34,7 @@ public: size_t bytes_in_files() const { return m_bytes_in_files; } Function on_thumbnail_progress; + Function on_path_change; struct Entry { String name;