summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/FileSystemModel.h
diff options
context:
space:
mode:
authorDexesTTP <dexes.ttp@gmail.com>2021-02-08 20:42:34 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-11 13:13:32 +0100
commitc98ad278032669cc009e0234aa6d91bf84f927db (patch)
tree222179fd0c8b5675cc3f96b1c301cd538adcfc33 /Userland/Libraries/LibGUI/FileSystemModel.h
parent2acbb811b1751233833f9ea89f7e76774262a706 (diff)
downloadserenity-c98ad278032669cc009e0234aa6d91bf84f927db.zip
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 :^)
Diffstat (limited to 'Userland/Libraries/LibGUI/FileSystemModel.h')
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h
index 2ef60bd708..5b10438a4a 100644
--- a/Userland/Libraries/LibGUI/FileSystemModel.h
+++ b/Userland/Libraries/LibGUI/FileSystemModel.h
@@ -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 };