diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-13 21:43:23 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-13 21:43:23 +0200 |
commit | f1c4b65089805463abea187313ea89d74da31e12 (patch) | |
tree | 08dce3f2f6c1e5b19aec173e88430caff819c6f4 /Libraries/LibGUI | |
parent | bf23f1e8bc19451e41d0216bd90ff9eaace823dc (diff) | |
download | serenity-f1c4b65089805463abea187313ea89d74da31e12.zip |
GDirectoryModel: Add on_path_change hook
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r-- | Libraries/LibGUI/GDirectoryModel.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/GDirectoryModel.h | 1 |
2 files changed, 3 insertions, 0 deletions
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<void(int done, int total)> on_thumbnail_progress; + Function<void()> on_path_change; struct Entry { String name; |