Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Explorer/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
internal static PluginInitContext Context { get; set; }

internal static Settings Settings { get; set; }

Check failure on line 20 in Plugins/Flow.Launcher.Plugin.Explorer/Main.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

` Settings Settings ` matches a line_forbidden.patterns entry: `\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s`. (forbidden-pattern)

private SettingsViewModel viewModel;

Expand Down Expand Up @@ -97,7 +97,7 @@
return Context.API.GetTranslation("plugin_explorer_plugin_description");
}

private void FillQuickAccessLinkNames()
private static void FillQuickAccessLinkNames()
{
// Legacy version does not have names for quick access links, so we fill them with the path name.
foreach (var link in Settings.QuickAccessLinks)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Forms;
Expand All @@ -14,6 +15,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views;
[INotifyPropertyChanged]
public partial class QuickAccessLinkSettings
{
private static readonly string ClassName = nameof(QuickAccessLinkSettings);

private string _selectedPath;
public string SelectedPath
{
Expand All @@ -27,6 +30,9 @@ public string SelectedPath
if (string.IsNullOrEmpty(_selectedName))
{
SelectedName = _selectedPath.GetPathName();
}
if (!string.IsNullOrEmpty(_selectedPath))
{
_accessLinkType = GetResultType(_selectedPath);
}
}
Expand Down Expand Up @@ -187,13 +193,13 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
private static ResultType GetResultType(string path)
{
// Check if the path is a file or folder
if (System.IO.File.Exists(path))
if (File.Exists(path))
{
return ResultType.File;
}
else if (System.IO.Directory.Exists(path))
else if (Directory.Exists(path))
{
if (string.Equals(System.IO.Path.GetPathRoot(path), path, StringComparison.OrdinalIgnoreCase))
if (string.Equals(Path.GetPathRoot(path), path, StringComparison.OrdinalIgnoreCase))
{
return ResultType.Volume;
}
Expand All @@ -205,6 +211,7 @@ private static ResultType GetResultType(string path)
else
{
// This should not happen, but just in case, we assume it's a folder
Main.Context.API.LogError(ClassName, $"The path '{path}' does not exist or is invalid. Defaulting to Folder type.");
return ResultType.Folder;
}
}
Expand Down
Loading