Skip to content

Commit 78cb45c

Browse files
author
TheBestPessimist
committed
Do not check if file/folder exists
1 parent 48ed1fe commit 78cb45c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
9292
return false;
9393
}
9494
}
95+
9596
// or make this folder the current query
9697
Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword));
9798

@@ -221,15 +222,14 @@ internal static Result CreateFileResult(string filePath, Query query, int score
221222
{
222223
try
223224
{
224-
// TODO Why do we check if file exists here, but not in the other if conditions?
225-
if (File.Exists(filePath) && c.SpecialKeyState.CtrlPressed && c.SpecialKeyState.ShiftPressed)
225+
if (c.SpecialKeyState.CtrlPressed && c.SpecialKeyState.ShiftPressed)
226226
{
227227
OpenFileAsAdmin(filePath);
228228
}
229229
else if (c.SpecialKeyState.CtrlPressed)
230230
{
231231
OpenFolder(filePath, filePath);
232-
}
232+
}
233233
else
234234
{
235235
OpenFile(filePath);
@@ -251,14 +251,9 @@ internal static Result CreateFileResult(string filePath, Query query, int score
251251

252252
private static bool IsMedia(string extension)
253253
{
254-
if (string.IsNullOrEmpty(extension))
255-
{
256-
return false;
257-
}
258-
else
259-
{
260-
return MediaExtensions.Contains(extension.ToLowerInvariant());
261-
}
254+
if (string.IsNullOrEmpty(extension)) { return false; }
255+
256+
return MediaExtensions.Contains(extension.ToLowerInvariant());
262257
}
263258

264259
private static void OpenFile(string filePath)

0 commit comments

Comments
 (0)