ui: watch root_folder instead of every folder
parent
3790f68e3f
commit
a03bd80199
|
@ -159,25 +159,11 @@ impl MailBackend for MaildirType {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap();
|
let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap();
|
||||||
let root_path = self.path.to_path_buf();
|
let root_path = self.path.to_path_buf();
|
||||||
|
watcher.watch(&root_path, RecursiveMode::Recursive).unwrap();
|
||||||
let cache_dir = xdg::BaseDirectories::with_profile("meli", &self.name).unwrap();
|
let cache_dir = xdg::BaseDirectories::with_profile("meli", &self.name).unwrap();
|
||||||
for f in &self.folders {
|
if cfg!(debug_assertions) {
|
||||||
if f.is_valid().is_err() {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if cfg!(debug_assertions) {
|
|
||||||
eprint!("{}:{}_{}: ", file!(), line!(), column!());
|
|
||||||
eprintln!("watching {:?}", f);
|
|
||||||
}
|
|
||||||
let mut p = PathBuf::from(&f.path);
|
|
||||||
p.push("cur");
|
|
||||||
eprint!("{}:{}_{}: ", file!(), line!(), column!());
|
eprint!("{}:{}_{}: ", file!(), line!(), column!());
|
||||||
eprintln!("watching {:?}", p);
|
eprintln!("watching {:?}", root_path);
|
||||||
watcher.watch(&p, RecursiveMode::NonRecursive).unwrap();
|
|
||||||
p.pop();
|
|
||||||
p.push("new");
|
|
||||||
eprint!("{}:{}_{}: ", file!(), line!(), column!());
|
|
||||||
eprintln!("watching {:?}", p);
|
|
||||||
watcher.watch(&p, RecursiveMode::NonRecursive).unwrap();
|
|
||||||
}
|
}
|
||||||
let hash_indexes = self.hash_indexes.clone();
|
let hash_indexes = self.hash_indexes.clone();
|
||||||
thread::Builder::new()
|
thread::Builder::new()
|
||||||
|
|
Loading…
Reference in New Issue