diff --git a/Flow.Launcher.Core/Plugin/QueryBuilder.cs b/Flow.Launcher.Core/Plugin/QueryBuilder.cs index 9ad6466e9f3..df336e14b69 100644 --- a/Flow.Launcher.Core/Plugin/QueryBuilder.cs +++ b/Flow.Launcher.Core/Plugin/QueryBuilder.cs @@ -29,7 +29,6 @@ public static Query Build(string text, Dictionary nonGlobalP else { // non action keyword actionKeyword = string.Empty; - actionParameters = terms.ToList(); search = rawQuery; } @@ -38,10 +37,7 @@ public static Query Build(string text, Dictionary nonGlobalP Terms = terms, RawQuery = rawQuery, ActionKeyword = actionKeyword, - Search = search, - // Obsolete value initialisation - ActionName = actionKeyword, - ActionParameters = actionParameters + Search = search }; return query; diff --git a/Flow.Launcher.Infrastructure/Alphabet.cs b/Flow.Launcher.Infrastructure/Alphabet.cs index e0eb60de40b..7e24a820673 100644 --- a/Flow.Launcher.Infrastructure/Alphabet.cs +++ b/Flow.Launcher.Infrastructure/Alphabet.cs @@ -95,27 +95,6 @@ public void Save() 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 ")] - /// - /// replace chinese character with pinyin, non chinese character won't be modified - /// should be word or sentence, instead of single character. e.g. 微软 - /// - 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; - } - /// /// 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 diff --git a/Flow.Launcher.Infrastructure/FuzzyMatcher.cs b/Flow.Launcher.Infrastructure/FuzzyMatcher.cs deleted file mode 100644 index 3df719b2886..00000000000 --- a/Flow.Launcher.Infrastructure/FuzzyMatcher.cs +++ /dev/null @@ -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); - } - } -} diff --git a/Flow.Launcher.Infrastructure/StringMatcher.cs b/Flow.Launcher.Infrastructure/StringMatcher.cs index 79ccfd7af44..2a4270fb4b2 100644 --- a/Flow.Launcher.Infrastructure/StringMatcher.cs +++ b/Flow.Launcher.Infrastructure/StringMatcher.cs @@ -21,18 +21,6 @@ public StringMatcher(IAlphabet alphabet = null) 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 @@ private int ScoreAfterSearchPrecisionFilter(int rawScore) public class MatchOption { - /// - /// prefix of match char, use for highlight - /// - [Obsolete("this is never used")] - public string Prefix { get; set; } = ""; - - /// - /// suffix of match char, use for highlight - /// - [Obsolete("this is never used")] - public string Suffix { get; set; } = ""; - public bool IgnoreCase { get; set; } = true; } } diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 4e1a8d7d86f..837fe3b7164 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -70,12 +70,6 @@ public string QuerySearchPrecisionString public PluginsSettings PluginSettings { get; set; } = new PluginsSettings(); public ObservableCollection CustomPluginHotkeys { get; set; } = new ObservableCollection(); - [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 @@ public enum LastQueryMode Empty, Preserved } - - [Obsolete] - public enum OpacityMode - { - Normal = 0, - LayeredWindow = 1, - DWM = 2 - } } \ No newline at end of file diff --git a/Flow.Launcher.Plugin/Feature.cs b/Flow.Launcher.Plugin/Feature.cs index 62da96c57cb..81839d81613 100644 --- a/Flow.Launcher.Plugin/Feature.cs +++ b/Flow.Launcher.Plugin/Feature.cs @@ -11,23 +11,6 @@ public interface IContextMenu : IFeatures List 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); - } - - /// - /// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface - /// This will improve the performance of instant search like websearch or cmd plugin - /// - [Obsolete("Flow Launcher is fast enough now, executed on ui thread is no longer needed")] - public interface IInstantQuery : IFeatures - { - bool IsInstantQuery(string query); - } - /// /// Represent plugins that support internationalization /// diff --git a/Flow.Launcher.Plugin/Features/IContextMenu.cs b/Flow.Launcher.Plugin/Features/IContextMenu.cs deleted file mode 100644 index f60e02a69ec..00000000000 --- a/Flow.Launcher.Plugin/Features/IContextMenu.cs +++ /dev/null @@ -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 { } -} \ No newline at end of file diff --git a/Flow.Launcher.Plugin/Features/IExclusiveQuery.cs b/Flow.Launcher.Plugin/Features/IExclusiveQuery.cs deleted file mode 100644 index 57eddd93e9c..00000000000 --- a/Flow.Launcher.Plugin/Features/IExclusiveQuery.cs +++ /dev/null @@ -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 { } -} diff --git a/Flow.Launcher.Plugin/Features/IInstantQuery.cs b/Flow.Launcher.Plugin/Features/IInstantQuery.cs deleted file mode 100644 index 465640ae9d0..00000000000 --- a/Flow.Launcher.Plugin/Features/IInstantQuery.cs +++ /dev/null @@ -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 { } -} \ No newline at end of file diff --git a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj index 0c69a6b9bb7..0aacc321b14 100644 --- a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj +++ b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj @@ -14,10 +14,10 @@ - 1.1.0 - 1.1.0 - 1.1.0 - 1.1.0 + 1.2.0 + 1.2.0 + 1.2.0 + 1.2.0 Flow.Launcher.Plugin Flow-Launcher MIT diff --git a/Flow.Launcher.Plugin/IPublicAPI.cs b/Flow.Launcher.Plugin/IPublicAPI.cs index 2e754a0ffa1..68197390509 100644 --- a/Flow.Launcher.Plugin/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/IPublicAPI.cs @@ -8,15 +8,6 @@ namespace Flow.Launcher.Plugin /// public interface IPublicAPI { - /// - /// Push result to query box - /// - /// - /// - /// - [Obsolete("This method will be removed in Flow Launcher 1.3")] - void PushResults(Query query, PluginMetadata plugin, List results); - /// /// Change Flow.Launcher query /// @@ -27,42 +18,11 @@ public interface IPublicAPI /// void ChangeQuery(string query, bool requery = false); - /// - /// Just change the query text, this won't raise search - /// - /// - [Obsolete] - void ChangeQueryText(string query, bool selectAll = false); - - /// - /// Close Flow Launcher - /// - [Obsolete] - void CloseApp(); - /// /// Restart Flow Launcher /// void RestartApp(); - /// - /// Restart Flow Launcher - /// - [Obsolete("Use RestartApp instead. This method will be removed in Flow Launcher 1.3")] - void RestarApp(); - - /// - /// Hide Flow Launcher - /// - [Obsolete] - void HideApp(); - - /// - /// Show Flow Launcher - /// - [Obsolete] - void ShowApp(); - /// /// Save all Flow Launcher settings /// @@ -103,18 +63,6 @@ public interface IPublicAPI /// void OpenSettingDialog(); - /// - /// Show loading animation - /// - [Obsolete("automatically start")] - void StartLoadingBar(); - - /// - /// Stop loading animation - /// - [Obsolete("automatically stop")] - void StopLoadingBar(); - /// /// Install Flow Launcher plugin /// diff --git a/Flow.Launcher.Plugin/PluginMetadata.cs b/Flow.Launcher.Plugin/PluginMetadata.cs index fb615459bae..d81b442e250 100644 --- a/Flow.Launcher.Plugin/PluginMetadata.cs +++ b/Flow.Launcher.Plugin/PluginMetadata.cs @@ -43,9 +43,6 @@ public override string ToString() return Name; } - [Obsolete("Use IcoPath")] - public string FullIcoPath => IcoPath; - /// /// Init time include both plugin load time and init time /// diff --git a/Flow.Launcher.Plugin/Query.cs b/Flow.Launcher.Plugin/Query.cs index 33310f2aa7c..1eb5c9c1437 100644 --- a/Flow.Launcher.Plugin/Query.cs +++ b/Flow.Launcher.Plugin/Query.cs @@ -94,14 +94,5 @@ private string SplitSearch(int index) } 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 ActionParameters { get; internal set; } - - [Obsolete("Use Search instead, this method will be removed in v1.3.0")] - public string GetAllRemainingParameter() => Search; } } diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index d210ba1d828..70be1e9dc05 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -104,21 +104,6 @@ public override string ToString() return Title + SubTitle; } - - /// - /// Context menus associate with this result - /// - [Obsolete("Use IContextMenu instead")] - public List 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() { } /// diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 530e6443cda..23f5d85b704 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -48,12 +48,6 @@ public void ChangeQueryText(string query, bool selectAll = false) _mainVM.ChangeQueryText(query); } - [Obsolete] - public void CloseApp() - { - Application.Current.MainWindow.Close(); - } - public void RestartApp() { _mainVM.MainWindowVisibility = Visibility.Hidden; @@ -90,18 +84,6 @@ public void ReloadAllPluginData() 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 @@ public List GetAllPlugins() public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent; - [Obsolete("This will be removed in Flow Launcher 1.3")] - public void PushResults(Query query, PluginMetadata plugin, List 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 diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index 5d74ed4adc4..67ee87f9428 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -33,7 +33,7 @@ public void Init(PluginInitContext context) public List 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);