@@ -10,10 +10,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search
10
10
public static class ResultManager
11
11
{
12
12
private static PluginInitContext Context ;
13
+ private static Settings Settings { get ; set ; }
13
14
14
- public static void Init ( PluginInitContext context )
15
+ public static void Init ( PluginInitContext context , Settings settings )
15
16
{
16
17
Context = context ;
18
+ Settings = settings ;
17
19
}
18
20
19
21
internal static Result CreateFolderResult ( string title , string subtitle , string path , Query query , int score = 0 , bool showIndexState = false , bool windowsIndexed = false )
@@ -41,23 +43,32 @@ internal static Result CreateFolderResult(string title, string subtitle, string
41
43
}
42
44
43
45
string changeTo = path . EndsWith ( Constants . DirectorySeperator ) ? path : path + Constants . DirectorySeperator ;
44
- Context . API . ChangeQuery ( string . IsNullOrEmpty ( query . ActionKeyword ) ?
46
+ Context . API . ChangeQuery ( Settings . PathSearchActionKeyword == "*" ?
45
47
changeTo :
46
- query . ActionKeyword + " " + changeTo ) ;
48
+ $ " { Settings . PathSearchActionKeyword } { changeTo } " ) ;
47
49
return false ;
48
50
} ,
49
51
Score = score ,
50
52
TitleToolTip = Constants . ToolTipOpenDirectory ,
51
53
SubTitleToolTip = Constants . ToolTipOpenDirectory ,
52
- ContextData = new SearchResult { Type = ResultType . Folder , FullPath = path , ShowIndexState = showIndexState , WindowsIndexed = windowsIndexed }
54
+ ContextData = new SearchResult
55
+ {
56
+ Type = ResultType . Folder ,
57
+ FullPath = path ,
58
+ ShowIndexState = showIndexState ,
59
+ WindowsIndexed = windowsIndexed
60
+ }
53
61
} ;
54
62
}
55
63
56
64
internal static Result CreateOpenCurrentFolderResult ( string path , bool windowsIndexed = false )
57
65
{
58
66
var retrievedDirectoryPath = FilesFolders . ReturnPreviousDirectoryIfIncompleteString ( path ) ;
59
67
60
- var folderName = retrievedDirectoryPath . TrimEnd ( Constants . DirectorySeperator ) . Split ( new [ ] { Path . DirectorySeparatorChar } , StringSplitOptions . None ) . Last ( ) ;
68
+ var folderName = retrievedDirectoryPath . TrimEnd ( Constants . DirectorySeperator ) . Split ( new [ ]
69
+ {
70
+ Path . DirectorySeparatorChar
71
+ } , StringSplitOptions . None ) . Last ( ) ;
61
72
62
73
if ( retrievedDirectoryPath . EndsWith ( ":\\ " ) )
63
74
{
@@ -81,7 +92,7 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
81
92
{
82
93
Title = title ,
83
94
SubTitle = $ "Use > to search within { subtitleFolderName } , " +
84
- $ "* to search for file extensions or >* to combine both searches.",
95
+ $ "* to search for file extensions or >* to combine both searches.",
85
96
IcoPath = retrievedDirectoryPath ,
86
97
Score = 500 ,
87
98
Action = c =>
@@ -91,7 +102,13 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
91
102
} ,
92
103
TitleToolTip = retrievedDirectoryPath ,
93
104
SubTitleToolTip = retrievedDirectoryPath ,
94
- ContextData = new SearchResult { Type = ResultType . Folder , FullPath = retrievedDirectoryPath , ShowIndexState = true , WindowsIndexed = windowsIndexed }
105
+ ContextData = new SearchResult
106
+ {
107
+ Type = ResultType . Folder ,
108
+ FullPath = retrievedDirectoryPath ,
109
+ ShowIndexState = true ,
110
+ WindowsIndexed = windowsIndexed
111
+ }
95
112
} ;
96
113
}
97
114
@@ -126,7 +143,13 @@ internal static Result CreateFileResult(string filePath, Query query, int score
126
143
} ,
127
144
TitleToolTip = Constants . ToolTipOpenContainingFolder ,
128
145
SubTitleToolTip = Constants . ToolTipOpenContainingFolder ,
129
- ContextData = new SearchResult { Type = ResultType . File , FullPath = filePath , ShowIndexState = showIndexState , WindowsIndexed = windowsIndexed }
146
+ ContextData = new SearchResult
147
+ {
148
+ Type = ResultType . File ,
149
+ FullPath = filePath ,
150
+ ShowIndexState = showIndexState ,
151
+ WindowsIndexed = windowsIndexed
152
+ }
130
153
} ;
131
154
return result ;
132
155
}
@@ -148,4 +171,4 @@ public enum ResultType
148
171
Folder ,
149
172
File
150
173
}
151
- }
174
+ }
0 commit comments