@@ -44,8 +44,8 @@ use cosmic::{
4444} ;
4545use mime_guess:: Mime ;
4646use notify_debouncer_full:: {
47- DebouncedEvent , Debouncer , FileIdMap , new_debouncer,
48- notify:: { self , RecommendedWatcher , Watcher } ,
47+ DebouncedEvent , Debouncer , RecommendedCache , new_debouncer,
48+ notify:: { self , RecommendedWatcher } ,
4949} ;
5050use slotmap:: Key as SlotMapKey ;
5151use std:: {
@@ -611,7 +611,7 @@ pub enum WindowKind {
611611}
612612
613613pub struct WatcherWrapper {
614- watcher_opt : Option < Debouncer < RecommendedWatcher , FileIdMap > > ,
614+ watcher_opt : Option < Debouncer < RecommendedWatcher , RecommendedCache > > ,
615615}
616616
617617impl Clone for WatcherWrapper {
@@ -673,7 +673,10 @@ pub struct App {
673673 #[ cfg( all( feature = "wayland" , feature = "desktop-applet" ) ) ]
674674 surface_names : HashMap < WindowId , String > ,
675675 toasts : widget:: toaster:: Toasts < Message > ,
676- watcher_opt : Option < ( Debouncer < RecommendedWatcher , FileIdMap > , HashSet < PathBuf > ) > ,
676+ watcher_opt : Option < (
677+ Debouncer < RecommendedWatcher , RecommendedCache > ,
678+ HashSet < PathBuf > ,
679+ ) > ,
677680 windows : HashMap < window:: Id , WindowKind > ,
678681 nav_dnd_hover : Option < ( Location , Instant ) > ,
679682 tab_dnd_hover : Option < ( Entity , Instant ) > ,
@@ -1583,7 +1586,7 @@ impl App {
15831586 // Unwatch paths no longer used
15841587 for path in old_paths. iter ( ) {
15851588 if !new_paths. contains ( path) {
1586- match watcher. watcher ( ) . unwatch ( path) {
1589+ match watcher. unwatch ( path) {
15871590 Ok ( ( ) ) => {
15881591 log:: debug!( "unwatching {:?}" , path) ;
15891592 }
@@ -1597,10 +1600,7 @@ impl App {
15971600 // Watch new paths
15981601 for path in new_paths. iter ( ) {
15991602 if !old_paths. contains ( path) {
1600- match watcher
1601- . watcher ( )
1602- . watch ( path, notify:: RecursiveMode :: NonRecursive )
1603- {
1603+ match watcher. watch ( path, notify:: RecursiveMode :: NonRecursive ) {
16041604 Ok ( ( ) ) => {
16051605 log:: debug!( "watching {:?}" , path) ;
16061606 }
@@ -5983,9 +5983,8 @@ impl Application for App {
59835983 . map( |path| [ path. join( "files" ) , path] )
59845984 . flatten( ) ;
59855985 for path in trash_paths {
5986- if let Err ( e) = watcher
5987- . watcher( )
5988- . watch( & path, notify:: RecursiveMode :: NonRecursive )
5986+ if let Err ( e) =
5987+ watcher. watch( & path, notify:: RecursiveMode :: NonRecursive )
59895988 {
59905989 log:: warn!(
59915990 "failed to add trash bin `{}` to watcher: {e:?}" ,
@@ -6055,9 +6054,8 @@ impl Application for App {
60556054
60566055 match watcher_res {
60576056 Ok ( mut watcher) => {
6058- if let Err ( e) = watcher
6059- . watcher( )
6060- . watch( & recents_path, notify:: RecursiveMode :: NonRecursive )
6057+ if let Err ( e) =
6058+ watcher. watch( & recents_path, notify:: RecursiveMode :: NonRecursive )
60616059 {
60626060 log:: warn!(
60636061 "failed to add recents file `{}` to watcher: {}" ,
0 commit comments