diff options
author | DLFW <daniel@llin.info> | 2021-12-17 01:42:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 19:42:35 -0500 |
commit | ae77a0fa7594dcf1a61954d0b0e2de7aac6961ce (patch) | |
tree | b0d72ae427c43b1f4515ea1be02cb92351de0ffa /src/event | |
parent | 2f3b4423a9e9c6f57bdf9e83052bbcda9ad121c1 (diff) |
Update view on filesystem changes (#112)
* Update view on filesystem changes
AppContext owns an INotifyWatcher, which watches the visible directories
(max. three). The list of directories to watch is updated on every
event. If a filesystem change is announced, a "soft-update" of the
current view is issued.
* Specific "watchers" for Linux and MacOS
For supervision of filesystem changes, specific `notify::Watcher`
implementations are used for Linux and MacOS.
Builds will likely fail for other OSes as
`notify::recommended_watcher` may return some specific watcher
implementation but the code just expects a `NullWatcher`.
* remove dead code
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/app_event.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/event/app_event.rs b/src/event/app_event.rs index e62914d..d6b77cb 100644 --- a/src/event/app_event.rs +++ b/src/event/app_event.rs @@ -3,6 +3,8 @@ use std::path; use std::sync::mpsc; use std::thread; +use notify; + use signal_hook::consts::signal; use signal_hook::iterator::exfiltrator::SignalOnly; use signal_hook::iterator::SignalsInfo; @@ -26,7 +28,7 @@ pub enum AppEvent { PreviewFile(path::PathBuf, io::Result<FilePreview>), Signal(i32), - // Filesystem(notify::Result), + Filesystem(notify::Event), } #[derive(Debug, Clone, Copy)] |