@@ -6,25 +6,31 @@ namespace Flow.Launcher.Plugin.Explorer.Search.FolderLinks
6
6
{
7
7
public class QuickFolderAccess
8
8
{
9
- internal List < Result > FolderListMatched ( Query query , List < FolderLink > folderLinks , PluginInitContext context )
9
+ private readonly ResultManager _resultManager ;
10
+
11
+ public QuickFolderAccess ( PluginInitContext context )
12
+ {
13
+ _resultManager = new ResultManager ( context ) ;
14
+ }
15
+
16
+ internal List < Result > FolderListMatched ( Query query , List < FolderLink > folderLinks )
10
17
{
11
18
if ( string . IsNullOrEmpty ( query . Search ) )
12
19
return new List < Result > ( ) ;
13
20
14
21
string search = query . Search . ToLower ( ) ;
15
-
16
- var queriedFolderLinks = folderLinks . Where ( x => x . Nickname . StartsWith ( search , StringComparison . OrdinalIgnoreCase ) ) ;
22
+
23
+ var queriedFolderLinks =
24
+ folderLinks . Where ( x => x . Nickname . StartsWith ( search , StringComparison . OrdinalIgnoreCase ) ) ;
17
25
18
26
return queriedFolderLinks . Select ( item =>
19
- new ResultManager ( context )
20
- . CreateFolderResult ( item . Nickname , item . Path , item . Path , query ) )
21
- . ToList ( ) ;
27
+ _resultManager . CreateFolderResult ( item . Nickname , item . Path , item . Path , query ) )
28
+ . ToList ( ) ;
22
29
}
23
30
24
- internal List < Result > FolderListAll ( Query query , List < FolderLink > folderLinks , PluginInitContext context )
31
+ internal List < Result > FolderListAll ( Query query , List < FolderLink > folderLinks )
25
32
=> folderLinks
26
- . Select ( item =>
27
- new ResultManager ( context ) . CreateFolderResult ( item . Nickname , item . Path , item . Path , query ) )
33
+ . Select ( item => _resultManager . CreateFolderResult ( item . Nickname , item . Path , item . Path , query ) )
28
34
. ToList ( ) ;
29
35
}
30
- }
36
+ }
0 commit comments