@@ -396,7 +396,8 @@ private static IEnumerable<Win32> UnregisteredPrograms(List<string> directories,
396
396
. SelectMany ( s => EnmuerateProgramsInDir ( s , suffixes ) ) ;
397
397
398
398
// Remove disabled programs in DisabledProgramSources
399
- var programs = ExceptDisabledSource ( paths ) . Select ( x => GetProgramFromPath ( x , protocols ) ) ;
399
+ var programs = ExceptDisabledSource ( paths )
400
+ . Select ( x => GetProgramFromPath ( x , protocols ) ) ;
400
401
return programs ;
401
402
}
402
403
@@ -660,13 +661,16 @@ public static void WatchProgramUpdate(Settings settings)
660
661
if ( settings . EnableStartMenuSource )
661
662
paths . AddRange ( GetStartMenuPaths ( ) ) ;
662
663
663
- paths . AddRange ( from source in settings . ProgramSources where source . Enabled select source . Location ) ;
664
-
665
664
foreach ( var directory in from path in paths where Directory . Exists ( path ) select path )
666
665
{
667
666
WatchDirectory ( directory ) ;
668
667
}
669
668
669
+ foreach ( var directory in from source in settings . ProgramSources where Directory . Exists ( source . Location ) select source . Location )
670
+ {
671
+ WatchDirectory ( directory , false ) ;
672
+ }
673
+
670
674
_ = Task . Run ( MonitorDirectoryChangeAsync ) ;
671
675
}
672
676
@@ -685,7 +689,7 @@ public static async Task MonitorDirectoryChangeAsync()
685
689
}
686
690
}
687
691
688
- public static void WatchDirectory ( string directory )
692
+ public static void WatchDirectory ( string directory , bool recursive = true )
689
693
{
690
694
if ( ! Directory . Exists ( directory ) )
691
695
{
@@ -696,7 +700,7 @@ public static void WatchDirectory(string directory)
696
700
watcher . Created += static ( _ , _ ) => indexQueue . Writer . TryWrite ( default ) ;
697
701
watcher . Deleted += static ( _ , _ ) => indexQueue . Writer . TryWrite ( default ) ;
698
702
watcher . EnableRaisingEvents = true ;
699
- watcher . IncludeSubdirectories = true ;
703
+ watcher . IncludeSubdirectories = recursive ;
700
704
701
705
Watchers . Add ( watcher ) ;
702
706
}
0 commit comments