mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #132 from Flow-Launcher/remove_obsolete_code
Remove obsolete methods, properties and classes
This commit is contained in:
commit
3c85c03381
16 changed files with 6 additions and 257 deletions
|
|
@ -29,7 +29,6 @@ namespace Flow.Launcher.Core.Plugin
|
|||
else
|
||||
{ // non action keyword
|
||||
actionKeyword = string.Empty;
|
||||
actionParameters = terms.ToList();
|
||||
search = rawQuery;
|
||||
}
|
||||
|
||||
|
|
@ -38,10 +37,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
Terms = terms,
|
||||
RawQuery = rawQuery,
|
||||
ActionKeyword = actionKeyword,
|
||||
Search = search,
|
||||
// Obsolete value initialisation
|
||||
ActionName = actionKeyword,
|
||||
ActionParameters = actionParameters
|
||||
Search = search
|
||||
};
|
||||
|
||||
return query;
|
||||
|
|
|
|||
|
|
@ -95,27 +95,6 @@ namespace Flow.Launcher.Infrastructure
|
|||
private static string[] EmptyStringArray = new string[0];
|
||||
private static string[][] Empty2DStringArray = new string[0][];
|
||||
|
||||
[Obsolete("Not accurate, eg 音乐 will not return yinyue but returns yinle ")]
|
||||
/// <summary>
|
||||
/// replace chinese character with pinyin, non chinese character won't be modified
|
||||
/// <param name="word"> should be word or sentence, instead of single character. e.g. 微软 </param>
|
||||
/// </summary>
|
||||
public string[] Pinyin(string word)
|
||||
{
|
||||
if (!_settings.ShouldUsePinyin)
|
||||
{
|
||||
return EmptyStringArray;
|
||||
}
|
||||
|
||||
var pinyin = word.Select(c =>
|
||||
{
|
||||
var pinyins = PinyinHelper.toHanyuPinyinStringArray(c);
|
||||
var result = pinyins == null ? c.ToString() : pinyins[0];
|
||||
return result;
|
||||
}).ToArray();
|
||||
return pinyin;
|
||||
}
|
||||
|
||||
/// <summmary>
|
||||
/// replace chinese character with pinyin, non chinese character won't be modified
|
||||
/// Because we don't have words dictionary, so we can only return all possiblie pinyin combination
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Flow.Launcher.Infrastructure
|
||||
{
|
||||
[Obsolete("This class is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
|
||||
public class FuzzyMatcher
|
||||
{
|
||||
private string query;
|
||||
private MatchOption opt;
|
||||
|
||||
private FuzzyMatcher(string query, MatchOption opt)
|
||||
{
|
||||
this.query = query.Trim();
|
||||
this.opt = opt;
|
||||
}
|
||||
|
||||
public static FuzzyMatcher Create(string query)
|
||||
{
|
||||
return new FuzzyMatcher(query, new MatchOption());
|
||||
}
|
||||
|
||||
public static FuzzyMatcher Create(string query, MatchOption opt)
|
||||
{
|
||||
return new FuzzyMatcher(query, opt);
|
||||
}
|
||||
|
||||
public MatchResult Evaluate(string str)
|
||||
{
|
||||
return StringMatcher.Instance.FuzzyMatch(query, str, opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,18 +21,6 @@ namespace Flow.Launcher.Infrastructure
|
|||
|
||||
public static StringMatcher Instance { get; internal set; }
|
||||
|
||||
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
|
||||
public static int Score(string source, string target)
|
||||
{
|
||||
return FuzzySearch(target, source).Score;
|
||||
}
|
||||
|
||||
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
|
||||
public static bool IsMatch(string source, string target)
|
||||
{
|
||||
return Score(source, target) > 0;
|
||||
}
|
||||
|
||||
public static MatchResult FuzzySearch(string query, string stringToCompare)
|
||||
{
|
||||
return Instance.FuzzyMatch(query, stringToCompare);
|
||||
|
|
@ -323,18 +311,6 @@ namespace Flow.Launcher.Infrastructure
|
|||
|
||||
public class MatchOption
|
||||
{
|
||||
/// <summary>
|
||||
/// prefix of match char, use for highlight
|
||||
/// </summary>
|
||||
[Obsolete("this is never used")]
|
||||
public string Prefix { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// suffix of match char, use for highlight
|
||||
/// </summary>
|
||||
[Obsolete("this is never used")]
|
||||
public string Suffix { get; set; } = "";
|
||||
|
||||
public bool IgnoreCase { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,12 +70,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
|
||||
public ObservableCollection<CustomPluginHotkey> CustomPluginHotkeys { get; set; } = new ObservableCollection<CustomPluginHotkey>();
|
||||
|
||||
[Obsolete]
|
||||
public double Opacity { get; set; } = 1;
|
||||
|
||||
[Obsolete]
|
||||
public OpacityMode OpacityMode { get; set; } = OpacityMode.Normal;
|
||||
|
||||
public bool DontPromptUpdateMsg { get; set; }
|
||||
public bool EnableUpdateLog { get; set; }
|
||||
|
||||
|
|
@ -108,12 +102,4 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
Empty,
|
||||
Preserved
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public enum OpacityMode
|
||||
{
|
||||
Normal = 0,
|
||||
LayeredWindow = 1,
|
||||
DWM = 2
|
||||
}
|
||||
}
|
||||
|
|
@ -11,23 +11,6 @@ namespace Flow.Launcher.Plugin
|
|||
List<Result> LoadContextMenus(Result selectedResult);
|
||||
}
|
||||
|
||||
[Obsolete("If a plugin has a action keyword, then it is exclusive. This interface will be remove in v1.3.0")]
|
||||
public interface IExclusiveQuery : IFeatures
|
||||
{
|
||||
[Obsolete("If a plugin has a action keyword, then it is exclusive. This method will be remove in v1.3.0")]
|
||||
bool IsExclusiveQuery(Query query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface
|
||||
/// <remarks>This will improve the performance of instant search like websearch or cmd plugin</remarks>
|
||||
/// </summary>
|
||||
[Obsolete("Flow Launcher is fast enough now, executed on ui thread is no longer needed")]
|
||||
public interface IInstantQuery : IFeatures
|
||||
{
|
||||
bool IsInstantQuery(string query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represent plugins that support internationalization
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Flow.Launcher.Plugin.Features
|
||||
{
|
||||
[Obsolete("Delete Flow.Launcher.Plugin.Features using directive, " +
|
||||
"and use Flow.Launcher.Plugin.Feature.IContextMenu instead, " +
|
||||
"this method will be removed in v1.3.0")]
|
||||
public interface IContextMenu { }
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Flow.Launcher.Plugin.Features
|
||||
{
|
||||
[Obsolete("Delete Flow.Launcher.Plugin.Features using directive, " +
|
||||
"and use Flow.Launcher.Plugin.Feature.IInstantQuery instead, " +
|
||||
"this method will be removed in v1.3.0")]
|
||||
public interface IExclusiveQuery { }
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Flow.Launcher.Plugin.Features
|
||||
{
|
||||
[Obsolete("Delete Flow.Launcher.Plugin.Features using directive, " +
|
||||
"and use Flow.Launcher.Plugin.Feature.IInstantQuery instead, " +
|
||||
"this method will be removed in v1.3.0")]
|
||||
public interface IInstantQuery { }
|
||||
}
|
||||
|
|
@ -14,10 +14,10 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.1.0</Version>
|
||||
<PackageVersion>1.1.0</PackageVersion>
|
||||
<AssemblyVersion>1.1.0</AssemblyVersion>
|
||||
<FileVersion>1.1.0</FileVersion>
|
||||
<Version>1.2.0</Version>
|
||||
<PackageVersion>1.2.0</PackageVersion>
|
||||
<AssemblyVersion>1.2.0</AssemblyVersion>
|
||||
<FileVersion>1.2.0</FileVersion>
|
||||
<PackageId>Flow.Launcher.Plugin</PackageId>
|
||||
<Authors>Flow-Launcher</Authors>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,6 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
public interface IPublicAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// Push result to query box
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <param name="plugin"></param>
|
||||
/// <param name="results"></param>
|
||||
[Obsolete("This method will be removed in Flow Launcher 1.3")]
|
||||
void PushResults(Query query, PluginMetadata plugin, List<Result> results);
|
||||
|
||||
/// <summary>
|
||||
/// Change Flow.Launcher query
|
||||
/// </summary>
|
||||
|
|
@ -27,42 +18,11 @@ namespace Flow.Launcher.Plugin
|
|||
/// </param>
|
||||
void ChangeQuery(string query, bool requery = false);
|
||||
|
||||
/// <summary>
|
||||
/// Just change the query text, this won't raise search
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
[Obsolete]
|
||||
void ChangeQueryText(string query, bool selectAll = false);
|
||||
|
||||
/// <summary>
|
||||
/// Close Flow Launcher
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
void CloseApp();
|
||||
|
||||
/// <summary>
|
||||
/// Restart Flow Launcher
|
||||
/// </summary>
|
||||
void RestartApp();
|
||||
|
||||
/// <summary>
|
||||
/// Restart Flow Launcher
|
||||
/// </summary>
|
||||
[Obsolete("Use RestartApp instead. This method will be removed in Flow Launcher 1.3")]
|
||||
void RestarApp();
|
||||
|
||||
/// <summary>
|
||||
/// Hide Flow Launcher
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
void HideApp();
|
||||
|
||||
/// <summary>
|
||||
/// Show Flow Launcher
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
void ShowApp();
|
||||
|
||||
/// <summary>
|
||||
/// Save all Flow Launcher settings
|
||||
/// </summary>
|
||||
|
|
@ -103,18 +63,6 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
void OpenSettingDialog();
|
||||
|
||||
/// <summary>
|
||||
/// Show loading animation
|
||||
/// </summary>
|
||||
[Obsolete("automatically start")]
|
||||
void StartLoadingBar();
|
||||
|
||||
/// <summary>
|
||||
/// Stop loading animation
|
||||
/// </summary>
|
||||
[Obsolete("automatically stop")]
|
||||
void StopLoadingBar();
|
||||
|
||||
/// <summary>
|
||||
/// Install Flow Launcher plugin
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -43,9 +43,6 @@ namespace Flow.Launcher.Plugin
|
|||
return Name;
|
||||
}
|
||||
|
||||
[Obsolete("Use IcoPath")]
|
||||
public string FullIcoPath => IcoPath;
|
||||
|
||||
/// <summary>
|
||||
/// Init time include both plugin load time and init time
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -94,14 +94,5 @@ namespace Flow.Launcher.Plugin
|
|||
}
|
||||
|
||||
public override string ToString() => RawQuery;
|
||||
|
||||
[Obsolete("Use ActionKeyword, this property will be removed in v1.3.0")]
|
||||
public string ActionName { get; internal set; }
|
||||
|
||||
[Obsolete("Use Search instead, this property will be removed in v1.3.0")]
|
||||
public List<string> ActionParameters { get; internal set; }
|
||||
|
||||
[Obsolete("Use Search instead, this method will be removed in v1.3.0")]
|
||||
public string GetAllRemainingParameter() => Search;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,21 +104,6 @@ namespace Flow.Launcher.Plugin
|
|||
return Title + SubTitle;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Context menus associate with this result
|
||||
/// </summary>
|
||||
[Obsolete("Use IContextMenu instead")]
|
||||
public List<Result> ContextMenu { get; set; }
|
||||
|
||||
[Obsolete("Use Object initializer instead")]
|
||||
public Result(string Title, string IcoPath, string SubTitle = null)
|
||||
{
|
||||
this.Title = Title;
|
||||
this.IcoPath = IcoPath;
|
||||
this.SubTitle = SubTitle;
|
||||
}
|
||||
|
||||
public Result() { }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -48,12 +48,6 @@ namespace Flow.Launcher
|
|||
_mainVM.ChangeQueryText(query);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public void CloseApp()
|
||||
{
|
||||
Application.Current.MainWindow.Close();
|
||||
}
|
||||
|
||||
public void RestartApp()
|
||||
{
|
||||
_mainVM.MainWindowVisibility = Visibility.Hidden;
|
||||
|
|
@ -90,18 +84,6 @@ namespace Flow.Launcher
|
|||
PluginManager.ReloadData();
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public void HideApp()
|
||||
{
|
||||
_mainVM.MainWindowVisibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public void ShowApp()
|
||||
{
|
||||
_mainVM.MainWindowVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
public void ShowMsg(string title, string subTitle = "", string iconPath = "")
|
||||
{
|
||||
ShowMsg(title, subTitle, iconPath, true);
|
||||
|
|
@ -151,21 +133,6 @@ namespace Flow.Launcher
|
|||
|
||||
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
|
||||
|
||||
[Obsolete("This will be removed in Flow Launcher 1.3")]
|
||||
public void PushResults(Query query, PluginMetadata plugin, List<Result> results)
|
||||
{
|
||||
results.ForEach(o =>
|
||||
{
|
||||
o.PluginDirectory = plugin.PluginDirectory;
|
||||
o.PluginID = plugin.ID;
|
||||
o.OriginQuery = query;
|
||||
});
|
||||
Task.Run(() =>
|
||||
{
|
||||
_mainVM.UpdateResultView(results, plugin, query);
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
|
|||
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
string param = query.GetAllRemainingParameter().TrimStart();
|
||||
string param = query.Search.TrimStart();
|
||||
|
||||
// Should top results be returned? (true if no search parameters have been passed)
|
||||
var topResults = string.IsNullOrEmpty(param);
|
||||
|
|
|
|||
Loading…
Reference in a new issue