From 9b05174a97005bba1997c260c69764efc8049e8a Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Fri, 30 Dec 2022 20:56:30 +0800
Subject: [PATCH 01/25] Use localized name for shell link programs
---
.../Programs/ShellLocalization.cs | 92 +++++++++++++++++++
.../Programs/Win32.cs | 20 ++--
2 files changed, 106 insertions(+), 6 deletions(-)
create mode 100644 Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLocalization.cs
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLocalization.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLocalization.cs
new file mode 100644
index 000000000..4f344d89e
--- /dev/null
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLocalization.cs
@@ -0,0 +1,92 @@
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+
+
+namespace Flow.Launcher.Plugin.Program.Programs
+{
+ // From PT Run
+ ///
+ /// Class to get localized name of shell items like 'My computer'. The localization is based on the 'windows display language'.
+ /// Reused code from https://stackoverflow.com/questions/41423491/how-to-get-localized-name-of-known-folder for the method
+ ///
+ public static class ShellLocalization
+ {
+ internal const uint DONTRESOLVEDLLREFERENCES = 0x00000001;
+ internal const uint LOADLIBRARYASDATAFILE = 0x00000002;
+
+ [DllImport("shell32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
+ internal static extern int SHGetLocalizedName(string pszPath, StringBuilder pszResModule, ref int cch, out int pidsRes);
+
+ [DllImport("user32.dll", EntryPoint = "LoadStringW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
+ internal static extern int LoadString(IntPtr hModule, int resourceID, StringBuilder resourceValue, int len);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, EntryPoint = "LoadLibraryExW")]
+ internal static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hFile, uint dwFlags);
+
+ [DllImport("kernel32.dll", ExactSpelling = true)]
+ internal static extern int FreeLibrary(IntPtr hModule);
+
+ [DllImport("kernel32.dll", EntryPoint = "ExpandEnvironmentStringsW", CharSet = CharSet.Unicode, ExactSpelling = true)]
+ internal static extern uint ExpandEnvironmentStrings(string lpSrc, StringBuilder lpDst, int nSize);
+
+ ///
+ /// Returns the localized name of a shell item.
+ ///
+ /// Path to the shell item (e. g. shortcut 'File Explorer.lnk').
+ /// The localized name as string or .
+ public static string GetLocalizedName(string path)
+ {
+ StringBuilder resourcePath = new StringBuilder(1024);
+ StringBuilder localizedName = new StringBuilder(1024);
+ int len, id;
+ len = resourcePath.Capacity;
+
+ // If there is no resource to localize a file name the method returns a non zero value.
+ if (SHGetLocalizedName(path, resourcePath, ref len, out id) == 0)
+ {
+ _ = ExpandEnvironmentStrings(resourcePath.ToString(), resourcePath, resourcePath.Capacity);
+ IntPtr hMod = LoadLibraryEx(resourcePath.ToString(), IntPtr.Zero, DONTRESOLVEDLLREFERENCES | LOADLIBRARYASDATAFILE);
+ if (hMod != IntPtr.Zero)
+ {
+ if (LoadString(hMod, id, localizedName, localizedName.Capacity) != 0)
+ {
+ string lString = localizedName.ToString();
+ _ = FreeLibrary(hMod);
+ return lString;
+ }
+
+ _ = FreeLibrary(hMod);
+ }
+ }
+
+ return string.Empty;
+ }
+
+ ///
+ /// This method returns the localized path to a shell item (folder or file)
+ ///
+ /// The path to localize
+ /// The localized path or the original path if localized version is not available
+ public static string GetLocalizedPath(string path)
+ {
+ path = Environment.ExpandEnvironmentVariables(path);
+ string ext = Path.GetExtension(path);
+ var pathParts = path.Split("\\");
+ string[] locPath = new string[pathParts.Length];
+
+ for (int i = 0; i < pathParts.Length; i++)
+ {
+ int iElements = i + 1;
+ string lName = GetLocalizedName(string.Join("\\", pathParts[..iElements]));
+ locPath[i] = !string.IsNullOrEmpty(lName) ? lName : pathParts[i];
+ }
+
+ string newPath = string.Join("\\", locPath);
+ newPath = !newPath.EndsWith(ext, StringComparison.InvariantCultureIgnoreCase) ? newPath + ext : newPath;
+
+ return newPath;
+ }
+ }
+}
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index f8c220610..3bbe55d38 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -44,6 +44,9 @@ namespace Flow.Launcher.Plugin.Program.Programs
public bool Enabled { get; set; }
public string Location => ParentDirectory;
+ // Localized name based on windows display language
+ public string LocalizedName { get; set; } = string.Empty;
+
private const string ShortcutExtension = "lnk";
private const string UrlExtension = "url";
private const string ExeExtension = "exe";
@@ -69,27 +72,30 @@ namespace Flow.Launcher.Plugin.Program.Programs
string title;
MatchResult matchResult;
+ // Name of the result
+ string resultName = string.IsNullOrEmpty(LocalizedName) ? Name : LocalizedName;
+
// We suppose Name won't be null
- if (!Main._settings.EnableDescription || Description == null || Name.StartsWith(Description))
+ if (!Main._settings.EnableDescription || Description == null || resultName.StartsWith(Description))
{
- title = Name;
+ title = resultName;
matchResult = StringMatcher.FuzzySearch(query, title);
}
- else if (Description.StartsWith(Name))
+ else if (Description.StartsWith(resultName))
{
title = Description;
matchResult = StringMatcher.FuzzySearch(query, Description);
}
else
{
- title = $"{Name}: {Description}";
- var nameMatch = StringMatcher.FuzzySearch(query, Name);
+ title = $"{resultName}: {Description}";
+ var nameMatch = StringMatcher.FuzzySearch(query, resultName);
var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
if (desciptionMatch.Score > nameMatch.Score)
{
for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
{
- desciptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
+ desciptionMatch.MatchData[i] += resultName.Length + 2; // 2 is ": "
}
matchResult = desciptionMatch;
}
@@ -297,6 +303,8 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
}
+ program.LocalizedName = ShellLocalization.GetLocalizedName(path);
+
return program;
}
catch (COMException e)
From f19d1d624df172fc0f3081e655c0a50825d538e2 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sat, 31 Dec 2022 17:23:45 +0930
Subject: [PATCH 02/25] allow plugin name to be searchable by Plugin Indicator
---
.../Languages/en.xaml | 6 ++-
.../Main.cs | 42 +++++++++----------
.../plugin.json | 2 +-
3 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Languages/en.xaml
index a6176a35f..3df1f468d 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Languages/en.xaml
@@ -2,7 +2,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
+ Activate {0} plugin action keyword
+
Plugin Indicator
Provides plugins action words suggestions
-
-
\ No newline at end of file
+
+
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
index b5377eb17..b0918d8c7 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
@@ -10,28 +10,26 @@ namespace Flow.Launcher.Plugin.PluginIndicator
public List Query(Query query)
{
- // if query contains more than one word, eg. github tips
- // user has decided to type something else rather than wanting to see the available action keywords
- if (query.SearchTerms.Length > 1)
- return new List();
-
- var results = from keyword in PluginManager.NonGlobalPlugins.Keys
- where keyword.StartsWith(query.Search)
- let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
- where !metadata.Disabled
- select new Result
- {
- Title = keyword,
- SubTitle = $"Activate {metadata.Name} plugin",
- Score = 100,
- IcoPath = metadata.IcoPath,
- AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}",
- Action = c =>
- {
- context.API.ChangeQuery($"{keyword}{Plugin.Query.TermSeparator}");
- return false;
- }
- };
+ var results =
+ from keyword in PluginManager.NonGlobalPlugins.Keys
+ let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
+ where (context.API.FuzzySearch(query.Search, keyword).IsSearchPrecisionScoreMet()
+ || context.API.FuzzySearch(query.Search, metadata.Name).IsSearchPrecisionScoreMet()
+ || string.IsNullOrEmpty(query.Search)) // To list all available action keywords
+ && !metadata.Disabled
+ select new Result
+ {
+ Title = keyword,
+ SubTitle = string.Format(context.API.GetTranslation("flowlauncher_plugin_pluginindicator_result_subtitle"), metadata.Name),
+ Score = 100,
+ IcoPath = metadata.IcoPath,
+ AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}",
+ Action = c =>
+ {
+ context.API.ChangeQuery($"{keyword}{Plugin.Query.TermSeparator}");
+ return false;
+ }
+ };
return results.ToList();
}
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
index fb527e3a8..68bf66085 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
@@ -4,7 +4,7 @@
"Name": "Plugin Indicator",
"Description": "Provide plugin actionword suggestion",
"Author": "qianlifeng",
- "Version": "2.0.0",
+ "Version": "2.0.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.PluginIndicator.dll",
From c6ff0a51131250b11743e9d9ce1d4ad53515dc76 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 17:49:38 +0800
Subject: [PATCH 03/25] Fix .lnk description logic
---
.../Flow.Launcher.Plugin.Program/Programs/Win32.cs | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index 3bbe55d38..4d3aecf58 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -273,14 +273,13 @@ namespace Flow.Launcher.Plugin.Program.Programs
ShellLinkHelper _helper = new ShellLinkHelper();
string target = _helper.retrieveTargetPath(path);
- if (!string.IsNullOrEmpty(target))
+ if (!string.IsNullOrEmpty(target) && File.Exists(target))
{
- var extension = Extension(target);
- if (extension == ExeExtension && File.Exists(target))
- {
- program.LnkResolvedPath = Path.GetFullPath(target);
- program.ExecutableName = Path.GetFileName(target);
+ program.LnkResolvedPath = Path.GetFullPath(target);
+ program.ExecutableName = Path.GetFileName(target);
+ if (Extension(target) == ExeExtension)
+ {
var args = _helper.arguments;
if(!string.IsNullOrEmpty(args))
{
From 207b29f816385408e3a4e72427d59db7a30eb0cb Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 17:42:42 +0800
Subject: [PATCH 04/25] Update comments
---
Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index 4d3aecf58..6b245d2c4 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -30,14 +30,17 @@ namespace Flow.Launcher.Plugin.Program.Programs
///
public string FullPath { get; set; }
///
- /// Path of the excutable for .lnk, or the URL for .url. Arguments are included if any.
+ /// Path of the executable for .lnk, or the URL for .url. Arguments are included if any.
///
public string LnkResolvedPath { get; set; }
///
- /// Path of the actual executable file.
+ /// Path of the actual executable file. Args are included.
///
public string ExecutablePath => LnkResolvedPath ?? FullPath;
public string ParentDirectory { get; set; }
+ ///
+ /// Name of the executable for .lnk files
+ ///
public string ExecutableName { get; set; }
public string Description { get; set; }
public bool Valid { get; set; }
@@ -584,7 +587,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
private static IEnumerable ProgramsHasher(IEnumerable programs)
{
- // TODO: Unable to distinguish multiple lnks to the same excutable but with different params
return programs.GroupBy(p => p.ExecutablePath.ToLowerInvariant())
.AsParallel()
.SelectMany(g =>
From e6b8a0dde2b477e53585a66cbf6469e269408217 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 21:02:27 +0800
Subject: [PATCH 05/25] Catch exception in ShellLinkHelper
---
.../Programs/ShellLinkHelper.cs | 17 ++++++++++++++---
.../Programs/Win32.cs | 9 ---------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs
index b93fb23c9..78c66d604 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs
@@ -3,6 +3,7 @@ using System.Text;
using System.Runtime.InteropServices;
using Accessibility;
using System.Runtime.InteropServices.ComTypes;
+using Flow.Launcher.Plugin.Program.Logger;
namespace Flow.Launcher.Plugin.Program.Programs
{
@@ -119,9 +120,19 @@ namespace Flow.Launcher.Plugin.Program.Programs
// To set the app description
if (!String.IsNullOrEmpty(target))
{
- buffer = new StringBuilder(MAX_PATH);
- ((IShellLinkW)link).GetDescription(buffer, MAX_PATH);
- description = buffer.ToString();
+ try
+ {
+ buffer = new StringBuilder(MAX_PATH);
+ ((IShellLinkW)link).GetDescription(buffer, MAX_PATH);
+ description = buffer.ToString();
+ }
+ catch (COMException e)
+ {
+ // C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\MiracastView.lnk always cause exception
+ ProgramLogger.LogException($"|IShellLinkW|retrieveTargetPath|{path}" +
+ "|Error caused likely due to trying to get the description of the program",
+ e);
+ }
buffer.Clear();
((IShellLinkW)link).GetArguments(buffer, MAX_PATH);
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index 6b245d2c4..019048295 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -309,15 +309,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
return program;
}
- catch (COMException e)
- {
- // C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\MiracastView.lnk always cause exception
- ProgramLogger.LogException($"|Win32|LnkProgram|{path}" +
- "|Error caused likely due to trying to get the description of the program",
- e);
-
- return Default;
- }
catch (FileNotFoundException e)
{
ProgramLogger.LogException($"|Win32|LnkProgram|{path}" +
From 617183b14a9c57d0966d6fbc3eda0e5b3d2d00be Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 17:59:46 +0800
Subject: [PATCH 06/25] Refactor result matching logic
---
.../Programs/Win32.cs | 100 +++++++++++++-----
1 file changed, 76 insertions(+), 24 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index 019048295..fafe7d5bf 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -69,6 +69,29 @@ namespace Flow.Launcher.Plugin.Program.Programs
Enabled = false
};
+ private static MatchResult Match(string query, List candidates)
+ {
+ if (candidates.Count == 0)
+ return null;
+
+ List matches = new List();
+ foreach(var candidate in candidates)
+ {
+ var match = StringMatcher.FuzzySearch(query, candidate);
+ if (match.IsSearchPrecisionScoreMet())
+ {
+ matches.Add(match);
+ }
+ }
+ if (matches.Count == 0)
+ {
+ return null;
+ }
+ else
+ {
+ return matches.MaxBy(match => match.Score);
+ }
+ }
public Result Result(string query, IPublicAPI api)
{
@@ -76,44 +99,73 @@ namespace Flow.Launcher.Plugin.Program.Programs
MatchResult matchResult;
// Name of the result
- string resultName = string.IsNullOrEmpty(LocalizedName) ? Name : LocalizedName;
+ // Check equality to avoid matching again in candidates
+ bool useLocalizedName = !string.IsNullOrEmpty(LocalizedName) && !Name.Equals(LocalizedName);
+ string resultName = useLocalizedName ? LocalizedName : Name;
- // We suppose Name won't be null
- if (!Main._settings.EnableDescription || Description == null || resultName.StartsWith(Description))
+ if (!Main._settings.EnableDescription)
{
title = resultName;
- matchResult = StringMatcher.FuzzySearch(query, title);
- }
- else if (Description.StartsWith(resultName))
- {
- title = Description;
- matchResult = StringMatcher.FuzzySearch(query, Description);
+ matchResult = StringMatcher.FuzzySearch(query, resultName);
}
else
{
- title = $"{resultName}: {Description}";
- var nameMatch = StringMatcher.FuzzySearch(query, resultName);
- var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
- if (desciptionMatch.Score > nameMatch.Score)
+ if (string.IsNullOrEmpty(Description) || resultName.StartsWith(Description))
{
- for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
- {
- desciptionMatch.MatchData[i] += resultName.Length + 2; // 2 is ": "
- }
- matchResult = desciptionMatch;
+ // Description is invalid or included in resultName
+ // Description is always localized, so Name.StartsWith(Description) is generally useless
+ title = resultName;
+ matchResult = StringMatcher.FuzzySearch(query, resultName);
+ }
+ else if (Description.StartsWith(resultName))
+ {
+ // resultName included in Description
+ title = Description;
+ matchResult = StringMatcher.FuzzySearch(query, Description);
+ }
+ else
+ {
+ // Search in both
+ title = $"{resultName}: {Description}";
+ var nameMatch = StringMatcher.FuzzySearch(query, resultName);
+ var descriptionMatch = StringMatcher.FuzzySearch(query, Description);
+ if (descriptionMatch.Score > nameMatch.Score)
+ {
+ for (int i = 0; i < descriptionMatch.MatchData.Count; i++)
+ {
+ descriptionMatch.MatchData[i] += resultName.Length + 2; // 2 is ": "
+ }
+ matchResult = descriptionMatch;
+ }
+ else
+ {
+ matchResult = nameMatch;
+ }
}
- else matchResult = nameMatch;
}
+ List candidates = new List();
+
if (!matchResult.IsSearchPrecisionScoreMet())
{
if (ExecutableName != null) // only lnk program will need this one
- matchResult = StringMatcher.FuzzySearch(query, ExecutableName);
-
- if (!matchResult.IsSearchPrecisionScoreMet())
+ {
+ candidates.Add(ExecutableName);
+ }
+ if (useLocalizedName)
+ {
+ candidates.Add(Name);
+ }
+ matchResult = Match(query, candidates);
+ if (matchResult == null)
+ {
return null;
-
- matchResult.MatchData = new List();
+ }
+ else
+ {
+ // Nothing to highlight in title in this case
+ matchResult.MatchData.Clear();
+ }
}
string subtitle = string.Empty;
From c5c6ae7b68dd0eaef0f8959c951947b735327db0 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 21:18:20 +0800
Subject: [PATCH 07/25] Fix exception message argument
---
Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
index d0070f833..b0e34b2a5 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
@@ -277,7 +277,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
catch (Exception e)
{
- ProgramLogger.LogException("UWP", "CurrentUserPackages", $"{id}", "An unexpected error occured and "
+ ProgramLogger.LogException("UWP", "CurrentUserPackages", $"{p.Id}", "An unexpected error occured and "
+ $"unable to verify if package is valid", e);
return false;
}
From 186f5f826e6a04896835ecfd202dd72dbd5aea20 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 21:24:50 +0800
Subject: [PATCH 08/25] Fix error message
---
Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
index b0e34b2a5..c05e36b8c 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
@@ -277,7 +277,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
catch (Exception e)
{
- ProgramLogger.LogException("UWP", "CurrentUserPackages", $"{p.Id}", "An unexpected error occured and "
+ ProgramLogger.LogException("UWP", "CurrentUserPackages", $"{p.Id.FullName}", "An unexpected error occured and "
+ $"unable to verify if package is valid", e);
return false;
}
From 4dbfe2d6a0b3577d1483f51c896986b63c080bf0 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 21:25:12 +0800
Subject: [PATCH 09/25] Rename variables for readability
---
.../Programs/UWP.cs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
index c05e36b8c..4c4a505f1 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
@@ -249,24 +249,24 @@ namespace Flow.Launcher.Plugin.Program.Programs
private static IEnumerable CurrentUserPackages()
{
- var u = WindowsIdentity.GetCurrent().User;
+ var user = WindowsIdentity.GetCurrent().User;
- if (u != null)
+ if (user != null)
{
- var id = u.Value;
- PackageManager m;
+ var userId = user.Value;
+ PackageManager packageManager;
try
{
- m = new PackageManager();
+ packageManager = new PackageManager();
}
catch
{
// Bug from https://github.com/microsoft/CsWinRT, using Microsoft.Windows.SDK.NET.Ref 10.0.19041.0.
// Only happens on the first time, so a try catch can fix it.
- m = new PackageManager();
+ packageManager = new PackageManager();
}
- var ps = m.FindPackagesForUser(id);
- ps = ps.Where(p =>
+ var packages = packageManager.FindPackagesForUser(userId);
+ packages = packages.Where(p =>
{
try
{
@@ -282,7 +282,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
return false;
}
});
- return ps;
+ return packages;
}
else
{
From ff4290c1925b478e135421ecf3d8e2e02e3bbb41 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sat, 31 Dec 2022 21:34:49 +0800
Subject: [PATCH 10/25] fix typo
---
Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
index 4c4a505f1..00e7927ec 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
@@ -277,7 +277,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
catch (Exception e)
{
- ProgramLogger.LogException("UWP", "CurrentUserPackages", $"{p.Id.FullName}", "An unexpected error occured and "
+ ProgramLogger.LogException("UWP", "CurrentUserPackages", $"{p.Id.FullName}", "An unexpected error occurred and "
+ $"unable to verify if package is valid", e);
return false;
}
From 35529a038641c4ea857156367c8416cc428a46e4 Mon Sep 17 00:00:00 2001
From: Hongtao Zhang
Date: Sat, 31 Dec 2022 10:43:07 -0500
Subject: [PATCH 11/25] fix some spelling
---
.github/actions/spelling/expect.txt | 20 +++++++++++++++++++
.github/actions/spelling/patterns.txt | 4 ++++
.../Languages/en.xaml | 2 +-
.../ProgramSuffixes.xaml | 2 +-
.../Programs/UWP.cs | 20 +++++++++----------
.../Programs/Win32.cs | 8 ++++----
Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 20 +++++++++----------
Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 4 ++--
.../Languages/en.xaml | 2 +-
Plugins/Flow.Launcher.Plugin.Url/Main.cs | 2 +-
.../SearchSourceSetting.xaml.cs | 6 +++---
.../Helper/ResultHelper.cs | 8 ++++----
12 files changed, 61 insertions(+), 37 deletions(-)
diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt
index ddb469517..7481cfff8 100644
--- a/.github/actions/spelling/expect.txt
+++ b/.github/actions/spelling/expect.txt
@@ -35,3 +35,23 @@ mscorlib
pythonw
dotnet
winget
+jjw24
+wolframalpha
+gmail
+duckduckgo
+facebook
+findicon
+baidu
+pls
+websearch
+qianlifeng
+userdata
+srchadmin
+EWX
+dlgtext
+CMD
+appref-ms
+appref
+TSource
+runas
+dpi
\ No newline at end of file
diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt
index 73095a638..0c1ac44cf 100644
--- a/.github/actions/spelling/patterns.txt
+++ b/.github/actions/spelling/patterns.txt
@@ -108,3 +108,7 @@
# Localization keys
#x:Key="[^"]+"
#{DynamicResource [^"]+}
+
+
+# html tag
+<\w+[^>]*>
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml
index a7b8bcb9c..39807db2c 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml
@@ -55,7 +55,7 @@
File suffixes can't be empty
Protocols can't be empty
- File Suffixes
+ File Suffixes
URL Protocols
Steam Games
Epic Games
diff --git a/Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml b/Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml
index e4467a8b6..71bc12a86 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml
@@ -162,7 +162,7 @@
Margin="0,0,0,8"
FontSize="16"
FontWeight="SemiBold"
- Text="{DynamicResource flowlauncher_plugin_program_suffixes_excutable_types}" />
+ Text="{DynamicResource flowlauncher_plugin_program_suffixes_executable_types}" />
();
+ var apps = new List();
// WinRT
var appListEntries = package.GetAppListEntries();
foreach (var app in appListEntries)
@@ -46,7 +46,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
try
{
var tmp = new Application(app, this);
- applist.Add(tmp);
+ apps.Add(tmp);
}
catch (Exception e)
{
@@ -55,7 +55,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
+ $"{FullName} from location {Location}", e);
}
}
- Apps = applist.ToArray();
+ Apps = apps.ToArray();
try
{
@@ -392,14 +392,14 @@ namespace Flow.Launcher.Plugin.Program.Programs
{
title = $"{Name}: {Description}";
var nameMatch = StringMatcher.FuzzySearch(query, Name);
- var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
- if (desciptionMatch.Score > nameMatch.Score)
+ var descriptionMatch = StringMatcher.FuzzySearch(query, Description);
+ if (descriptionMatch.Score > nameMatch.Score)
{
- for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
+ for (int i = 0; i < descriptionMatch.MatchData.Count; i++)
{
- desciptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
+ descriptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
}
- matchResult = desciptionMatch;
+ matchResult = descriptionMatch;
}
else matchResult = nameMatch;
}
@@ -658,8 +658,8 @@ namespace Flow.Launcher.Plugin.Program.Programs
// var brush = new SolidColorBrush(color);
// var pen = new Pen(brush, 1);
// var backgroundArea = new Rect(0, 0, width, width);
- // var rectabgle = new RectangleGeometry(backgroundArea);
- // var rectDrawing = new GeometryDrawing(brush, pen, rectabgle);
+ // var rectangle = new RectangleGeometry(backgroundArea);
+ // var rectDrawing = new GeometryDrawing(brush, pen, rectangle);
// group.Children.Add(rectDrawing);
// var imageArea = new Rect(x, y, image.Width, image.Height);
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index f8c220610..91841827e 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -30,7 +30,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
///
public string FullPath { get; set; }
///
- /// Path of the excutable for .lnk, or the URL for .url. Arguments are included if any.
+ /// Path of the executable for .lnk, or the URL for .url. Arguments are included if any.
///
public string LnkResolvedPath { get; set; }
///
@@ -495,12 +495,12 @@ namespace Flow.Launcher.Plugin.Program.Programs
.Distinct();
}
- private static string GetProgramPathFromRegistrySubKeys(RegistryKey root, string subkey)
+ private static string GetProgramPathFromRegistrySubKeys(RegistryKey root, string subKey)
{
var path = string.Empty;
try
{
- using (var key = root.OpenSubKey(subkey))
+ using (var key = root.OpenSubKey(subKey))
{
if (key == null)
return string.Empty;
@@ -577,7 +577,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
private static IEnumerable ProgramsHasher(IEnumerable programs)
{
- // TODO: Unable to distinguish multiple lnks to the same excutable but with different params
+ // TODO: Unable to distinguish multiple lnks to the same executable but with different params
return programs.GroupBy(p => p.ExecutablePath.ToLowerInvariant())
.AsParallel()
.SelectMany(g =>
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
index 7ce597b96..f64f5d376 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
@@ -33,7 +33,7 @@ namespace Flow.Launcher.Plugin.Shell
string cmd = query.Search;
if (string.IsNullOrEmpty(cmd))
{
- return ResultsFromlHistory();
+ return ResultsFromHistory();
}
else
{
@@ -55,8 +55,8 @@ namespace Flow.Launcher.Plugin.Shell
else if (Directory.Exists(Path.GetDirectoryName(excmd) ?? string.Empty))
{
basedir = Path.GetDirectoryName(excmd);
- var dirn = Path.GetDirectoryName(cmd);
- dir = (dirn.EndsWith("/") || dirn.EndsWith(@"\")) ? dirn : cmd.Substring(0, dirn.Length + 1);
+ var dirName = Path.GetDirectoryName(cmd);
+ dir = (dirName.EndsWith("/") || dirName.EndsWith(@"\")) ? dirName : cmd.Substring(0, dirName.Length + 1);
}
if (basedir != null)
@@ -158,7 +158,7 @@ namespace Flow.Launcher.Plugin.Shell
return result;
}
- private List ResultsFromlHistory()
+ private List ResultsFromHistory()
{
IEnumerable history = _settings.CommandHistory.OrderByDescending(o => o.Value)
.Select(m => new Result
@@ -204,7 +204,7 @@ namespace Flow.Launcher.Plugin.Shell
info.Arguments = $"{(_settings.LeaveShellOpen ? "/k" : "/c")} {command}";
//// Use info.Arguments instead of info.ArgumentList to enable users better control over the arguments they are writing.
- //// Previous code using ArgumentList, commands needed to be seperated correctly:
+ //// Previous code using ArgumentList, commands needed to be separated correctly:
//// Incorrect:
// info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
// info.ArgumentList.Add(command); //<== info.ArgumentList.Add("mkdir \"c:\\test new\"");
@@ -377,9 +377,9 @@ namespace Flow.Launcher.Plugin.Shell
public List LoadContextMenus(Result selectedResult)
{
- var resultlist = new List
+ var results = new List
{
- new Result
+ new()
{
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_different_user"),
AsyncAction = async c =>
@@ -390,7 +390,7 @@ namespace Flow.Launcher.Plugin.Shell
IcoPath = "Images/user.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe7ee")
},
- new Result
+ new()
{
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_administrator"),
Action = c =>
@@ -401,7 +401,7 @@ namespace Flow.Launcher.Plugin.Shell
IcoPath = "Images/admin.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe7ef")
},
- new Result
+ new()
{
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_copy"),
Action = c =>
@@ -414,7 +414,7 @@ namespace Flow.Launcher.Plugin.Shell
}
};
- return resultlist;
+ return results;
}
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
index 9e4a4ed1c..43f293f74 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
@@ -95,11 +95,11 @@ namespace Flow.Launcher.Plugin.Sys
IcoPath = "Images\\shutdown.png",
Action = c =>
{
- var reuslt = MessageBox.Show(
+ var result = MessageBox.Show(
context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_shutdown_computer"),
context.API.GetTranslation("flowlauncher_plugin_sys_shutdown_computer"),
MessageBoxButton.YesNo, MessageBoxImage.Warning);
- if (reuslt == MessageBoxResult.Yes)
+ if (result == MessageBoxResult.Yes)
{
Process.Start("shutdown", "/s /t 0");
}
diff --git a/Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml
index eff1ac263..461ccd197 100644
--- a/Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml
@@ -7,7 +7,7 @@
New Tab
Open url:{0}
- Can't open url:{0}
+ Can't open url:{0}
URL
Open the typed URL from Flow Launcher
diff --git a/Plugins/Flow.Launcher.Plugin.Url/Main.cs b/Plugins/Flow.Launcher.Plugin.Url/Main.cs
index c507f0b1c..4831bac1d 100644
--- a/Plugins/Flow.Launcher.Plugin.Url/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Url/Main.cs
@@ -74,7 +74,7 @@ namespace Flow.Launcher.Plugin.Url
}
catch(Exception)
{
- context.API.ShowMsg(string.Format(context.API.GetTranslation("flowlauncher_plugin_url_canot_open_url"), raw));
+ context.API.ShowMsg(string.Format(context.API.GetTranslation("flowlauncher_plugin_url_cannot_open_url"), raw));
return false;
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs
index c19396da0..60863ee82 100644
--- a/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs
@@ -21,16 +21,16 @@ namespace Flow.Launcher.Plugin.WebSearch
{
_oldSearchSource = old;
_viewModel = new SearchSourceViewModel {SearchSource = old.DeepCopy()};
- Initilize(sources, context, Action.Edit);
+ Initialize(sources, context, Action.Edit);
}
public SearchSourceSettingWindow(IList sources, PluginInitContext context)
{
_viewModel = new SearchSourceViewModel {SearchSource = new SearchSource()};
- Initilize(sources, context, Action.Add);
+ Initialize(sources, context, Action.Add);
}
- private async void Initilize(IList sources, PluginInitContext context, Action action)
+ private async void Initialize(IList sources, PluginInitContext context, Action action)
{
InitializeComponent();
DataContext = _viewModel;
diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs
index 38d06b2cb..0bfb00b34 100644
--- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs
+++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Helper/ResultHelper.cs
@@ -18,7 +18,7 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
public static void Init(IPublicAPI api) => _api = api;
- private static List GetDefaultReuslts(in IEnumerable list,
+ private static List GetDefaultResults(in IEnumerable list,
string windowsSettingIconPath,
string controlPanelIconPath)
{
@@ -45,7 +45,7 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
{
if (string.IsNullOrWhiteSpace(query.Search))
{
- return GetDefaultReuslts(list, windowsSettingIconPath, controlPanelIconPath);
+ return GetDefaultResults(list, windowsSettingIconPath, controlPanelIconPath);
}
var resultList = new List();
@@ -110,7 +110,7 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
return resultList;
}
- private const int TaskLinkScorePanelty = 50;
+ private const int TaskLinkScorePenalty = 50;
private static Result NewSettingResult(int score, string type, string windowsSettingIconPath, string controlPanelIconPath, WindowsSetting entry) => new()
{
@@ -120,7 +120,7 @@ namespace Flow.Launcher.Plugin.WindowsSettings.Helper
SubTitle = GetSubtitle(entry.Area, type),
Title = entry.Name,
ContextData = entry,
- Score = score - (type == "TaskLink" ? TaskLinkScorePanelty : 0),
+ Score = score - (type == "TaskLink" ? TaskLinkScorePenalty : 0),
};
private static string GetSubtitle(string section, string entryType)
From 8cc6fcfef0a5c318340e6f7596ed58e6496ff70c Mon Sep 17 00:00:00 2001
From: Kevin Zhang <45326534+taooceros@users.noreply.github.com>
Date: Sat, 31 Dec 2022 10:46:01 -0500
Subject: [PATCH 12/25] Update patterns.txt
---
.github/actions/spelling/patterns.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt
index 142cd475a..c0a008153 100644
--- a/.github/actions/spelling/patterns.txt
+++ b/.github/actions/spelling/patterns.txt
@@ -113,4 +113,4 @@
<\w+[^>]*>
#http/https
-(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]
\ No newline at end of file
+(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]
From 3992990ccb3cd26c00ee29e158eb4c0ba7c06a91 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sun, 1 Jan 2023 00:24:36 +0800
Subject: [PATCH 13/25] Remove redundant extension check
---
.../Programs/Win32.cs | 31 +++++++++----------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index fafe7d5bf..e9aeb03a8 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -333,26 +333,23 @@ namespace Flow.Launcher.Plugin.Program.Programs
program.LnkResolvedPath = Path.GetFullPath(target);
program.ExecutableName = Path.GetFileName(target);
- if (Extension(target) == ExeExtension)
+ var args = _helper.arguments;
+ if(!string.IsNullOrEmpty(args))
{
- var args = _helper.arguments;
- if(!string.IsNullOrEmpty(args))
- {
- program.LnkResolvedPath += " " + args;
- }
+ program.LnkResolvedPath += " " + args;
+ }
- var description = _helper.description;
- if (!string.IsNullOrEmpty(description))
+ var description = _helper.description;
+ if (!string.IsNullOrEmpty(description))
+ {
+ program.Description = description;
+ }
+ else
+ {
+ var info = FileVersionInfo.GetVersionInfo(target);
+ if (!string.IsNullOrEmpty(info.FileDescription))
{
- program.Description = description;
- }
- else
- {
- var info = FileVersionInfo.GetVersionInfo(target);
- if (!string.IsNullOrEmpty(info.FileDescription))
- {
- program.Description = info.FileDescription;
- }
+ program.Description = info.FileDescription;
}
}
}
From f7f82a746ee67efca57a79dedef25898623f30d5 Mon Sep 17 00:00:00 2001
From: Hongtao Zhang
Date: Sat, 31 Dec 2022 17:12:43 -0500
Subject: [PATCH 14/25] fix more spelling
---
.github/actions/spelling/expect.txt | 4 +++-
Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs | 4 ++--
Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 10 +++++-----
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt
index 7481cfff8..c969a00f8 100644
--- a/.github/actions/spelling/expect.txt
+++ b/.github/actions/spelling/expect.txt
@@ -54,4 +54,6 @@ appref-ms
appref
TSource
runas
-dpi
\ No newline at end of file
+dpi
+popup
+ptr
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
index 2149805f1..b1ec70068 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
@@ -147,7 +147,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
ProgramLogger.LogException($"|UWP|GetPackageVersionFromManifest|{Location}" +
- "|Trying to get the package version of the UWP program, but an unknown UWP appmanifest version in package "
+ "|Trying to get the package version of the UWP program, but an unknown UWP app-manifest version in package "
+ $"{FullName} from location {Location}", new FormatException());
return PackageVersion.Unknown;
}
@@ -633,7 +633,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
// }
// else
// {
- // ProgramLogger.LogException($"|UWP|ImageFromPath|{(string.IsNullOrEmpty(path) ? "Not Avaliable" : path)}" +
+ // ProgramLogger.LogException($"|UWP|ImageFromPath|{(string.IsNullOrEmpty(path) ? "Not Available" : path)}" +
// $"|Unable to get logo for {UserModelId} from {path} and" +
// $" located in {Location}", new FileNotFoundException());
// return new BitmapImage(new Uri(Constant.MissingImgIcon));
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
index 91841827e..3373948a3 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
@@ -84,14 +84,14 @@ namespace Flow.Launcher.Plugin.Program.Programs
{
title = $"{Name}: {Description}";
var nameMatch = StringMatcher.FuzzySearch(query, Name);
- var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
- if (desciptionMatch.Score > nameMatch.Score)
+ var descriptionMatch = StringMatcher.FuzzySearch(query, Description);
+ if (descriptionMatch.Score > nameMatch.Score)
{
- for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
+ for (int i = 0; i < descriptionMatch.MatchData.Count; i++)
{
- desciptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
+ descriptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
}
- matchResult = desciptionMatch;
+ matchResult = descriptionMatch;
}
else matchResult = nameMatch;
}
From 1d02f231a6e006d0cf271a997ff3a57af1692a16 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sun, 1 Jan 2023 12:27:27 +0930
Subject: [PATCH 15/25] update to use score from fuzzy search
---
.../Flow.Launcher.Plugin.PluginIndicator/Main.cs | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
index b0918d8c7..aea0d77a1 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/Main.cs
@@ -12,17 +12,19 @@ namespace Flow.Launcher.Plugin.PluginIndicator
{
var results =
from keyword in PluginManager.NonGlobalPlugins.Keys
- let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
- where (context.API.FuzzySearch(query.Search, keyword).IsSearchPrecisionScoreMet()
- || context.API.FuzzySearch(query.Search, metadata.Name).IsSearchPrecisionScoreMet()
+ let plugin = PluginManager.NonGlobalPlugins[keyword].Metadata
+ let keywordSearchResult = context.API.FuzzySearch(query.Search, keyword)
+ let searchResult = keywordSearchResult.IsSearchPrecisionScoreMet() ? keywordSearchResult : context.API.FuzzySearch(query.Search, plugin.Name)
+ let score = searchResult.Score
+ where (searchResult.IsSearchPrecisionScoreMet()
|| string.IsNullOrEmpty(query.Search)) // To list all available action keywords
- && !metadata.Disabled
+ && !plugin.Disabled
select new Result
{
Title = keyword,
- SubTitle = string.Format(context.API.GetTranslation("flowlauncher_plugin_pluginindicator_result_subtitle"), metadata.Name),
- Score = 100,
- IcoPath = metadata.IcoPath,
+ SubTitle = string.Format(context.API.GetTranslation("flowlauncher_plugin_pluginindicator_result_subtitle"), plugin.Name),
+ Score = score,
+ IcoPath = plugin.IcoPath,
AutoCompleteText = $"{keyword}{Plugin.Query.TermSeparator}",
Action = c =>
{
From 1d1af7263a49c2377ce307f117354940aa549793 Mon Sep 17 00:00:00 2001
From: Jeremy Wu
Date: Sun, 1 Jan 2023 12:36:03 +0930
Subject: [PATCH 16/25] fix typos
---
Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
index 68bf66085..084779ef9 100644
--- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json
@@ -2,7 +2,7 @@
"ID": "6A122269676E40EB86EB543B945932B9",
"ActionKeyword": "*",
"Name": "Plugin Indicator",
- "Description": "Provide plugin actionword suggestion",
+ "Description": "Provides plugin action keyword suggestions",
"Author": "qianlifeng",
"Version": "2.0.1",
"Language": "csharp",
From ff00c676c9bbb646957c6ddac69cabad42d108dc Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sun, 1 Jan 2023 13:36:10 +0800
Subject: [PATCH 17/25] Update expect.txt
---
.github/actions/spelling/expect.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt
index c969a00f8..51bcf83f5 100644
--- a/.github/actions/spelling/expect.txt
+++ b/.github/actions/spelling/expect.txt
@@ -56,4 +56,5 @@ TSource
runas
dpi
popup
-ptr
\ No newline at end of file
+ptr
+pluginindicator
\ No newline at end of file
From c53fdc1ed630f97034d65b8044e98384ef25bae5 Mon Sep 17 00:00:00 2001
From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Mon, 2 Jan 2023 17:05:37 +0800
Subject: [PATCH 18/25] Fix crowdin spell check action (#1756)
* Tweak file exclusion rule
* Exclude l10n_dev branch
* Disable cancel in progress
* Temporarily check all for test
* Fix checking head ref
* Stop checking Resources.resx
* Update texts
* Update regex
* update exclude list
* Test l10n_dev
* ignore resx
* update
* fix branch head
* update newline
* update regex
* test
* remove test code
* Exclude l10n_dev branch
---
.github/actions/spelling/excludes.txt | 10 +++++-----
.github/actions/spelling/expect.txt | 6 +++++-
.github/actions/spelling/patterns.txt | 1 +
.github/workflows/spelling.yml | 4 ++--
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt
index e1d95e773..224014eba 100644
--- a/.github/actions/spelling/excludes.txt
+++ b/.github/actions/spelling/excludes.txt
@@ -57,12 +57,12 @@
^\.github/actions/spelling/
^\Q.github/workflows/spelling.yml\E$
# Custom
-(?:^|/)Languages/(?!en.xaml)
+(?:^|/)Languages/(?!en\.xaml)
Scripts/
-Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/
-Plugins/Flow.Launcher.Plugin.WindowsSettings/WindowsSettings.json
-Plugins/Flow.Launcher.Plugin.WebSearch/setting.json
-(?:^|/)FodyWeavers.xml
+\.resx$
+^\QPlugins/Flow.Launcher.Plugin.WindowsSettings/WindowsSettings.json\E$
+^\QPlugins/Flow.Launcher.Plugin.WebSearch/setting.json\E$
+(?:^|/)FodyWeavers\.xml
.editorconfig
ignore$
\.ps1$
diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt
index 51bcf83f5..a91287cc0 100644
--- a/.github/actions/spelling/expect.txt
+++ b/.github/actions/spelling/expect.txt
@@ -57,4 +57,8 @@ runas
dpi
popup
ptr
-pluginindicator
\ No newline at end of file
+pluginindicator
+TobiasSekan
+Img
+img
+resx
diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt
index c0a008153..2f4ff418d 100644
--- a/.github/actions/spelling/patterns.txt
+++ b/.github/actions/spelling/patterns.txt
@@ -111,6 +111,7 @@
# html tag
<\w+[^>]*>
+\w+[^>]*>
#http/https
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]
diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml
index 7a7a48bcd..6037c100e 100644
--- a/.github/workflows/spelling.yml
+++ b/.github/workflows/spelling.yml
@@ -65,11 +65,11 @@ jobs:
outputs:
followup: ${{ steps.spelling.outputs.followup }}
runs-on: ubuntu-latest
- if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
+ if: (contains(github.event_name, 'pull_request') && github.head_ref != 'l10n_dev') || github.event_name == 'push'
concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
# note: If you use only_check_changed_files, you do not want cancel-in-progress
- cancel-in-progress: true
+ cancel-in-progress: false
steps:
- name: check-spelling
id: spelling
From 4d10089e3fb2284a3756c49292605d165f3e0691 Mon Sep 17 00:00:00 2001
From: Vic <10308169+VictoriousRaptor@users.noreply.github.com>
Date: Sun, 1 Jan 2023 23:22:16 +0800
Subject: [PATCH 19/25] Refactor clear log folder logic
Clear logs of all versions
Use binding for button text
Move open log dir to vm
---
Flow.Launcher/SettingWindow.xaml | 2 +-
Flow.Launcher/SettingWindow.xaml.cs | 4 +-
.../ViewModel/SettingWindowViewModel.cs | 45 +++++++++++++------
3 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml
index 320b6d9a3..81ced68a8 100644
--- a/Flow.Launcher/SettingWindow.xaml
+++ b/Flow.Launcher/SettingWindow.xaml
@@ -3041,7 +3041,7 @@
Name="ClearLogFolderBtn"
Margin="0,0,12,0"
Click="ClearLogFolder"
- Content="{Binding CheckLogFolder, UpdateSourceTrigger=PropertyChanged}" />
+ Content="{Binding CheckLogFolder, Mode=OneWay}" />