Skip to content

Commit 340dc3c

Browse files
committed
clear obsolete code from Flow.Launcher.Plugin
1 parent a48f060 commit 340dc3c

File tree

6 files changed

+10
-57
lines changed

6 files changed

+10
-57
lines changed

Flow.Launcher.Core/Plugin/QueryBuilder.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using Flow.Launcher.Plugin;
44

@@ -33,9 +33,13 @@ public static Query Build(string text, Dictionary<string, PluginPair> nonGlobalP
3333
searchTerms = terms;
3434
}
3535

36-
var query = new Query(rawQuery, search,terms, searchTerms, actionKeyword);
37-
38-
return query;
36+
return new Query ()
37+
{
38+
Search = search,
39+
RawQuery = rawQuery,
40+
SearchTerms = searchTerms,
41+
ActionKeyword = actionKeyword
42+
};
3943
}
4044
}
4145
}

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,6 @@ public interface IPublicAPI
133133
/// <returns></returns>
134134
List<PluginPair> GetAllPlugins();
135135

136-
/// <summary>
137-
/// Fired after global keyboard events
138-
/// if you want to hook something like Ctrl+R, you should use this event
139-
/// </summary>
140-
[Obsolete("Unable to Retrieve correct return value")]
141-
event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
142-
143136
/// <summary>
144137
/// Register a callback for Global Keyboard Event
145138
/// </summary>

Flow.Launcher.Plugin/Query.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ public class Query
66
{
77
public Query() { }
88

9-
/// <summary>
10-
/// to allow unit tests for plug ins
11-
/// </summary>
9+
[Obsolete("Use the default Query constructor.")]
1210
public Query(string rawQuery, string search, string[] terms, string[] searchTerms, string actionKeyword = "")
1311
{
1412
Search = search;
1513
RawQuery = rawQuery;
16-
#pragma warning disable CS0618
17-
Terms = terms;
18-
#pragma warning restore CS0618
1914
SearchTerms = searchTerms;
2015
ActionKeyword = actionKeyword;
2116
}
@@ -47,28 +42,16 @@ public Query(string rawQuery, string search, string[] terms, string[] searchTerm
4742
/// </summary>
4843
public string[] SearchTerms { get; init; }
4944

50-
/// <summary>
51-
/// The raw query split into a string array
52-
/// </summary>
53-
[Obsolete("It may or may not include action keyword, which can be confusing. Use SearchTerms instead")]
54-
public string[] Terms { get; init; }
55-
5645
/// <summary>
5746
/// Query can be splited into multiple terms by whitespace
5847
/// </summary>
5948
public const string TermSeparator = " ";
6049

61-
[Obsolete("Typo")]
62-
public const string TermSeperater = TermSeparator;
63-
6450
/// <summary>
6551
/// User can set multiple action keywords seperated by ';'
6652
/// </summary>
6753
public const string ActionKeywordSeparator = ";";
6854

69-
[Obsolete("Typo")]
70-
public const string ActionKeywordSeperater = ActionKeywordSeparator;
71-
7255

7356
/// <summary>
7457
/// Wildcard action keyword. Plugins using this value will be queried on every search.

Flow.Launcher.Plugin/Result.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,6 @@ public string IcoPath
133133
/// </summary>
134134
public IList<int> TitleHighlightData { get; set; }
135135

136-
/// <summary>
137-
/// Deprecated as of Flow Launcher v1.9.1. Subtitle highlighting is no longer offered
138-
/// </summary>
139-
[Obsolete("Deprecated as of Flow Launcher v1.9.1. Subtitle highlighting is no longer offered")]
140-
public IList<int> SubTitleHighlightData { get; set; }
141-
142136
/// <summary>
143137
/// Query information associated with the result
144138
/// </summary>

Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Win32;
1+
using Microsoft.Win32;
22
using System;
33
using System.Diagnostics;
44
using System.IO;
@@ -71,12 +71,6 @@ public static void OpenInBrowserWindow(this string url, string browserPath = "",
7171
}
7272
}
7373

74-
[Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")]
75-
public static void NewBrowserWindow(this string url, string browserPath = "")
76-
{
77-
OpenInBrowserWindow(url, browserPath);
78-
}
79-
8074
/// <summary>
8175
/// Opens search as a tab in the default browser chosen in Windows settings.
8276
/// </summary>
@@ -111,11 +105,5 @@ public static void OpenInBrowserTab(this string url, string browserPath = "", bo
111105
});
112106
}
113107
}
114-
115-
[Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")]
116-
public static void NewTabInBrowser(this string url, string browserPath = "")
117-
{
118-
OpenInBrowserTab(url, browserPath);
119-
}
120108
}
121109
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ public void RestartApp()
6969
UpdateManager.RestartApp(Constant.ApplicationFileName);
7070
}
7171

72-
[Obsolete("Typo")]
73-
public void RestarApp() => RestartApp();
74-
7572
public void ShowMainWindow() => _mainVM.Show();
7673

7774
public void HideMainWindow() => _mainVM.Hide();
@@ -295,8 +292,6 @@ public void OpenAppUri(Uri appUri)
295292
OpenUri(appUri);
296293
}
297294

298-
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
299-
300295
private readonly List<Func<int, int, SpecialKeyState, bool>> _globalKeyboardHandlers = new();
301296

302297
public void RegisterGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) => _globalKeyboardHandlers.Add(callback);
@@ -309,10 +304,6 @@ public void OpenAppUri(Uri appUri)
309304
private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state)
310305
{
311306
var continueHook = true;
312-
if (GlobalKeyboardEvent != null)
313-
{
314-
continueHook = GlobalKeyboardEvent((int)keyevent, vkcode, state);
315-
}
316307
foreach (var x in _globalKeyboardHandlers)
317308
{
318309
continueHook &= x((int)keyevent, vkcode, state);

0 commit comments

Comments
 (0)