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