Skip to content

Commit 3c85c03

Browse files
authored
Merge pull request #132 from Flow-Launcher/remove_obsolete_code
Remove obsolete methods, properties and classes
2 parents 3f0a766 + 48cbe9d commit 3c85c03

File tree

16 files changed

+6
-257
lines changed

16 files changed

+6
-257
lines changed

Flow.Launcher.Core/Plugin/QueryBuilder.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public static Query Build(string text, Dictionary<string, PluginPair> nonGlobalP
2929
else
3030
{ // non action keyword
3131
actionKeyword = string.Empty;
32-
actionParameters = terms.ToList();
3332
search = rawQuery;
3433
}
3534

@@ -38,10 +37,7 @@ public static Query Build(string text, Dictionary<string, PluginPair> nonGlobalP
3837
Terms = terms,
3938
RawQuery = rawQuery,
4039
ActionKeyword = actionKeyword,
41-
Search = search,
42-
// Obsolete value initialisation
43-
ActionName = actionKeyword,
44-
ActionParameters = actionParameters
40+
Search = search
4541
};
4642

4743
return query;

Flow.Launcher.Infrastructure/Alphabet.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,27 +95,6 @@ public void Save()
9595
private static string[] EmptyStringArray = new string[0];
9696
private static string[][] Empty2DStringArray = new string[0][];
9797

98-
[Obsolete("Not accurate, eg 音乐 will not return yinyue but returns yinle ")]
99-
/// <summary>
100-
/// replace chinese character with pinyin, non chinese character won't be modified
101-
/// <param name="word"> should be word or sentence, instead of single character. e.g. 微软 </param>
102-
/// </summary>
103-
public string[] Pinyin(string word)
104-
{
105-
if (!_settings.ShouldUsePinyin)
106-
{
107-
return EmptyStringArray;
108-
}
109-
110-
var pinyin = word.Select(c =>
111-
{
112-
var pinyins = PinyinHelper.toHanyuPinyinStringArray(c);
113-
var result = pinyins == null ? c.ToString() : pinyins[0];
114-
return result;
115-
}).ToArray();
116-
return pinyin;
117-
}
118-
11998
/// <summmary>
12099
/// replace chinese character with pinyin, non chinese character won't be modified
121100
/// Because we don't have words dictionary, so we can only return all possiblie pinyin combination

Flow.Launcher.Infrastructure/FuzzyMatcher.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

Flow.Launcher.Infrastructure/StringMatcher.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ public StringMatcher(IAlphabet alphabet = null)
2121

2222
public static StringMatcher Instance { get; internal set; }
2323

24-
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
25-
public static int Score(string source, string target)
26-
{
27-
return FuzzySearch(target, source).Score;
28-
}
29-
30-
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
31-
public static bool IsMatch(string source, string target)
32-
{
33-
return Score(source, target) > 0;
34-
}
35-
3624
public static MatchResult FuzzySearch(string query, string stringToCompare)
3725
{
3826
return Instance.FuzzyMatch(query, stringToCompare);
@@ -323,18 +311,6 @@ private int ScoreAfterSearchPrecisionFilter(int rawScore)
323311

324312
public class MatchOption
325313
{
326-
/// <summary>
327-
/// prefix of match char, use for highlight
328-
/// </summary>
329-
[Obsolete("this is never used")]
330-
public string Prefix { get; set; } = "";
331-
332-
/// <summary>
333-
/// suffix of match char, use for highlight
334-
/// </summary>
335-
[Obsolete("this is never used")]
336-
public string Suffix { get; set; } = "";
337-
338314
public bool IgnoreCase { get; set; } = true;
339315
}
340316
}

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ public string QuerySearchPrecisionString
7070
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
7171
public ObservableCollection<CustomPluginHotkey> CustomPluginHotkeys { get; set; } = new ObservableCollection<CustomPluginHotkey>();
7272

73-
[Obsolete]
74-
public double Opacity { get; set; } = 1;
75-
76-
[Obsolete]
77-
public OpacityMode OpacityMode { get; set; } = OpacityMode.Normal;
78-
7973
public bool DontPromptUpdateMsg { get; set; }
8074
public bool EnableUpdateLog { get; set; }
8175

@@ -108,12 +102,4 @@ public enum LastQueryMode
108102
Empty,
109103
Preserved
110104
}
111-
112-
[Obsolete]
113-
public enum OpacityMode
114-
{
115-
Normal = 0,
116-
LayeredWindow = 1,
117-
DWM = 2
118-
}
119105
}

Flow.Launcher.Plugin/Feature.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,6 @@ public interface IContextMenu : IFeatures
1111
List<Result> LoadContextMenus(Result selectedResult);
1212
}
1313

14-
[Obsolete("If a plugin has a action keyword, then it is exclusive. This interface will be remove in v1.3.0")]
15-
public interface IExclusiveQuery : IFeatures
16-
{
17-
[Obsolete("If a plugin has a action keyword, then it is exclusive. This method will be remove in v1.3.0")]
18-
bool IsExclusiveQuery(Query query);
19-
}
20-
21-
/// <summary>
22-
/// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface
23-
/// <remarks>This will improve the performance of instant search like websearch or cmd plugin</remarks>
24-
/// </summary>
25-
[Obsolete("Flow Launcher is fast enough now, executed on ui thread is no longer needed")]
26-
public interface IInstantQuery : IFeatures
27-
{
28-
bool IsInstantQuery(string query);
29-
}
30-
3114
/// <summary>
3215
/// Represent plugins that support internationalization
3316
/// </summary>

Flow.Launcher.Plugin/Features/IContextMenu.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

Flow.Launcher.Plugin/Features/IExclusiveQuery.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

Flow.Launcher.Plugin/Features/IInstantQuery.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<Version>1.1.0</Version>
18-
<PackageVersion>1.1.0</PackageVersion>
19-
<AssemblyVersion>1.1.0</AssemblyVersion>
20-
<FileVersion>1.1.0</FileVersion>
17+
<Version>1.2.0</Version>
18+
<PackageVersion>1.2.0</PackageVersion>
19+
<AssemblyVersion>1.2.0</AssemblyVersion>
20+
<FileVersion>1.2.0</FileVersion>
2121
<PackageId>Flow.Launcher.Plugin</PackageId>
2222
<Authors>Flow-Launcher</Authors>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>

0 commit comments

Comments
 (0)