Merge pull request #2204 from Flow-Launcher/clear_obsolete

Remove obsolete and unused code
This commit is contained in:
Jeremy Wu 2023-06-27 21:09:59 +09:30 committed by GitHub
commit a7fc5b3dc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 33 additions and 233 deletions

View file

@ -1,4 +0,0 @@
New-Alias nuget.exe ".\packages\NuGet.CommandLine.*\tools\NuGet.exe"
$env:APPVEYOR_BUILD_FOLDER = Convert-Path .
$env:APPVEYOR_BUILD_VERSION = "1.2.0"
& .\Deploy\squirrel_installer.ps1

5
Directory.Build.props Normal file
View file

@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>
</Project>

View file

@ -41,18 +41,6 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments
if (!PluginMetadataList.Any(o => o.Language.Equals(Language, StringComparison.OrdinalIgnoreCase)))
return new List<PluginPair>();
// TODO: Remove. This is backwards compatibility for 1.10.0 release- changed PythonEmbeded to Environments/Python
if (Language.Equals(AllowedLanguage.Python, StringComparison.OrdinalIgnoreCase))
{
FilesFolders.RemoveFolderIfExists(Path.Combine(DataLocation.DataDirectory(), "PythonEmbeddable"));
if (!string.IsNullOrEmpty(PluginSettings.PythonDirectory) && PluginSettings.PythonDirectory.StartsWith(Path.Combine(DataLocation.DataDirectory(), "PythonEmbeddable")))
{
InstallEnvironment();
PluginSettings.PythonDirectory = string.Empty;
}
}
if (!string.IsNullOrEmpty(PluginsSettingsFilePath) && FilesFolders.FileExists(PluginsSettingsFilePath))
{
// Ensure latest only if user is using Flow's environment setup.

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Flow.Launcher.Plugin;
@ -33,9 +33,13 @@ namespace Flow.Launcher.Core.Plugin
searchTerms = terms;
}
var query = new Query(rawQuery, search,terms, searchTerms, actionKeyword);
return query;
return new Query ()
{
Search = search,
RawQuery = rawQuery,
SearchTerms = searchTerms,
ActionKeyword = actionKeyword
};
}
}
}

View file

@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2FEB2298-7653-4009-B1EA-FFFB1A768BCC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Flow.Launcher.CrashReporter</RootNamespace>
<AssemblyName>Flow.Launcher.CrashReporter</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Output\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Output\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Exceptionless, Version=1.5.2121.0, Culture=neutral, PublicKeyToken=fc181f0a46f65747, processorArchitecture=MSIL">
<HintPath>..\packages\Exceptionless.1.5.2121\lib\net45\Exceptionless.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exceptionless.Models, Version=1.5.2121.0, Culture=neutral, PublicKeyToken=fc181f0a46f65747, processorArchitecture=MSIL">
<HintPath>..\packages\Exceptionless.1.5.2121\lib\net45\Exceptionless.Models.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="JetBrains.Annotations, Version=10.1.4.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.10.1.4\lib\net20\JetBrains.Annotations.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs">
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CrashReporter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReportWindow.xaml.cs">
<DependentUpon>ReportWindow.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Include="ReportWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Flow.Launcher.Core\Flow.Launcher.Core.csproj">
<Project>{B749F0DB-8E75-47DB-9E5E-265D16D0C0D2}</Project>
<Name>Flow.Launcher.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj">
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
<Name>Flow.Launcher.Infrastructure</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\crash_warning.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\crash_go.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\crash_stop.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\app_error.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

View file

@ -1,5 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Flow.Launcher.CrashReporter")]
[assembly: Guid("0ea3743c-2c0d-4b13-b9ce-e5e1f85aea23")]

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Exceptionless" version="1.5.2121" targetFramework="net452" />
<package id="JetBrains.Annotations" version="10.1.4" targetFramework="net452" />
<package id="System.Runtime" version="4.0.0" targetFramework="net452" />
</packages>

View file

@ -1,8 +0,0 @@
using System;
namespace Flow.Launcher.Infrastructure.Storage
{
[Obsolete("Deprecated as of Flow Launcher v1.8.0, on 2021.06.21. " +
"This is used only for Everything plugin v1.4.9 or below backwards compatibility")]
public interface ISavable : Plugin.ISavable { }
}

View file

@ -26,9 +26,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings
}
}
// TODO: Remove. This is backwards compatibility for 1.10.0 release.
public string PythonDirectory { get; set; }
public Dictionary<string, Plugin> Plugins { get; set; } = new Dictionary<string, Plugin>();
public void UpdatePluginSettings(List<PluginMetadata> metadatas)
@ -38,25 +35,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings
if (Plugins.ContainsKey(metadata.ID))
{
var settings = Plugins[metadata.ID];
if (metadata.ID == "572be03c74c642baae319fc283e561a8" && metadata.ActionKeywords.Count > settings.ActionKeywords.Count)
{
// TODO: Remove. This is backwards compatibility for Explorer 1.8.0 release.
// Introduced two new action keywords in Explorer, so need to update plugin setting in the UserData folder.
if (settings.Version.CompareTo("1.8.0") < 0)
{
settings.ActionKeywords.Add(Query.GlobalPluginWildcardSign); // for index search
settings.ActionKeywords.Add(Query.GlobalPluginWildcardSign); // for path search
settings.ActionKeywords.Add(Query.GlobalPluginWildcardSign); // for quick access action keyword
}
// TODO: Remove. This is backwards compatibility for Explorer 1.9.0 release.
// Introduced a new action keywords in Explorer since 1.8.0, so need to update plugin setting in the UserData folder.
if (settings.Version.CompareTo("1.8.0") > 0)
{
settings.ActionKeywords.Add(Query.GlobalPluginWildcardSign); // for quick access action keyword
}
}
if (string.IsNullOrEmpty(settings.Version))
settings.Version = metadata.Version;

View file

@ -133,13 +133,6 @@ namespace Flow.Launcher.Plugin
/// <returns></returns>
List<PluginPair> GetAllPlugins();
/// <summary>
/// Fired after global keyboard events
/// if you want to hook something like Ctrl+R, you should use this event
/// </summary>
[Obsolete("Unable to Retrieve correct return value")]
event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
/// <summary>
/// Register a callback for Global Keyboard Event
/// </summary>

View file

@ -6,16 +6,11 @@ namespace Flow.Launcher.Plugin
{
public Query() { }
/// <summary>
/// to allow unit tests for plug ins
/// </summary>
[Obsolete("Use the default Query constructor.")]
public Query(string rawQuery, string search, string[] terms, string[] searchTerms, string actionKeyword = "")
{
Search = search;
RawQuery = rawQuery;
#pragma warning disable CS0618
Terms = terms;
#pragma warning restore CS0618
SearchTerms = searchTerms;
ActionKeyword = actionKeyword;
}
@ -47,28 +42,16 @@ namespace Flow.Launcher.Plugin
/// </summary>
public string[] SearchTerms { get; init; }
/// <summary>
/// The raw query split into a string array
/// </summary>
[Obsolete("It may or may not include action keyword, which can be confusing. Use SearchTerms instead")]
public string[] Terms { get; init; }
/// <summary>
/// Query can be splited into multiple terms by whitespace
/// </summary>
public const string TermSeparator = " ";
[Obsolete("Typo")]
public const string TermSeperater = TermSeparator;
/// <summary>
/// User can set multiple action keywords seperated by ';'
/// </summary>
public const string ActionKeywordSeparator = ";";
[Obsolete("Typo")]
public const string ActionKeywordSeperater = ActionKeywordSeparator;
/// <summary>
/// Wildcard action keyword. Plugins using this value will be queried on every search.

View file

@ -134,12 +134,6 @@ namespace Flow.Launcher.Plugin
/// </summary>
public IList<int> TitleHighlightData { get; set; }
/// <summary>
/// Deprecated as of Flow Launcher v1.9.1. Subtitle highlighting is no longer offered
/// </summary>
[Obsolete("Deprecated as of Flow Launcher v1.9.1. Subtitle highlighting is no longer offered")]
public IList<int> SubTitleHighlightData { get; set; }
/// <summary>
/// Query information associated with the result
/// </summary>

View file

@ -1,4 +1,4 @@
using Microsoft.Win32;
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.IO;
@ -71,12 +71,6 @@ namespace Flow.Launcher.Plugin.SharedCommands
}
}
[Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")]
public static void NewBrowserWindow(this string url, string browserPath = "")
{
OpenInBrowserWindow(url, browserPath);
}
/// <summary>
/// Opens search as a tab in the default browser chosen in Windows settings.
/// </summary>
@ -111,11 +105,5 @@ namespace Flow.Launcher.Plugin.SharedCommands
});
}
}
[Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")]
public static void NewTabInBrowser(this string url, string browserPath = "")
{
OpenInBrowserTab(url, browserPath);
}
}
}

View file

@ -15,10 +15,19 @@ namespace Flow.Launcher.Test
{">", new PluginPair {Metadata = new PluginMetadata {ActionKeywords = new List<string> {">"}}}}
};
Query q = QueryBuilder.Build("> file.txt file2 file3", nonGlobalPlugins);
Query q = QueryBuilder.Build("> ping google.com -n 20 -6", nonGlobalPlugins);
Assert.AreEqual("file.txt file2 file3", q.Search);
Assert.AreEqual("> ping google.com -n 20 -6", q.RawQuery);
Assert.AreEqual("ping google.com -n 20 -6", q.Search, "Search should not start with the ActionKeyword.");
Assert.AreEqual(">", q.ActionKeyword);
Assert.AreEqual(5, q.SearchTerms.Length, "The length of SearchTerms should match.");
Assert.AreEqual("ping", q.FirstSearch);
Assert.AreEqual("google.com", q.SecondSearch);
Assert.AreEqual("-n", q.ThirdSearch);
Assert.AreEqual("google.com -n 20 -6", q.SecondToEndSearch, "SecondToEndSearch should be trimmed of multiple whitespace characters");
}
[Test]
@ -29,9 +38,13 @@ namespace Flow.Launcher.Test
{">", new PluginPair {Metadata = new PluginMetadata {ActionKeywords = new List<string> {">"}, Disabled = true}}}
};
Query q = QueryBuilder.Build("> file.txt file2 file3", nonGlobalPlugins);
Query q = QueryBuilder.Build("> ping google.com -n 20 -6", nonGlobalPlugins);
Assert.AreEqual("> file.txt file2 file3", q.Search);
Assert.AreEqual("> ping google.com -n 20 -6", q.Search);
Assert.AreEqual(q.Search, q.RawQuery, "RawQuery should be equal to Search.");
Assert.AreEqual(6, q.SearchTerms.Length, "The length of SearchTerms should match.");
Assert.AreNotEqual(">", q.ActionKeyword, "ActionKeyword should not match that of a disabled plugin.");
Assert.AreEqual("ping google.com -n 20 -6", q.SecondToEndSearch, "SecondToEndSearch should be trimmed of multiple whitespace characters");
}
[Test]

View file

@ -47,6 +47,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Scripts\flowlauncher.nuspec = Scripts\flowlauncher.nuspec
LICENSE = LICENSE

View file

@ -69,9 +69,6 @@ namespace Flow.Launcher
UpdateManager.RestartApp(Constant.ApplicationFileName);
}
[Obsolete("Typo")]
public void RestarApp() => RestartApp();
public void ShowMainWindow() => _mainVM.Show();
public void HideMainWindow() => _mainVM.Hide();
@ -295,8 +292,6 @@ namespace Flow.Launcher
OpenUri(appUri);
}
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
private readonly List<Func<int, int, SpecialKeyState, bool>> _globalKeyboardHandlers = new();
public void RegisterGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) => _globalKeyboardHandlers.Add(callback);
@ -309,10 +304,6 @@ namespace Flow.Launcher
private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state)
{
var continueHook = true;
if (GlobalKeyboardEvent != null)
{
continueHook = GlobalKeyboardEvent((int)keyevent, vkcode, state);
}
foreach (var x in _globalKeyboardHandlers)
{
continueHook &= x((int)keyevent, vkcode, state);