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

LibGUI: Use Core::FileWatcher in FileSystemModel

This replaces the manual watch_file and Notifier handling with the new
Core::FileWatcher wrapper, which reduces the manual handling and makes
the code easier to reason about :^)
This commit is contained in:
DexesTTP 2021-02-08 20:42:34 +01:00 committed by Andreas Kling
parent 2acbb811b1
commit c98ad27803
2 changed files with 18 additions and 24 deletions

View file

@ -29,7 +29,7 @@
#include <AK/HashMap.h>
#include <AK/NonnullOwnPtrVector.h>
#include <LibCore/DateTime.h>
#include <LibCore/Notifier.h>
#include <LibCore/FileWatcher.h>
#include <LibGUI/Model.h>
#include <string.h>
#include <sys/stat.h>
@ -63,7 +63,7 @@ public:
};
struct Node {
~Node() { close(m_watch_fd); }
~Node() { }
String name;
String symlink_target;
@ -106,8 +106,7 @@ public:
bool m_selected { false };
int m_watch_fd { -1 };
RefPtr<Core::Notifier> m_notifier;
RefPtr<Core::FileWatcher> m_file_watcher;
int m_error { 0 };
bool m_parent_of_root { false };