27
27
using System . Collections . Specialized ;
28
28
using CommunityToolkit . Mvvm . DependencyInjection ;
29
29
using Flow . Launcher . Core ;
30
+ using Flow . Launcher . Infrastructure . UserSettings ;
30
31
31
32
namespace Flow . Launcher
32
33
{
33
34
public class PublicAPIInstance : IPublicAPI
34
35
{
36
+ private readonly Settings _settings ;
35
37
private readonly SettingWindowViewModel _settingsVM ;
36
38
private readonly MainViewModel _mainVM ;
37
39
38
40
#region Constructor
39
41
40
42
public PublicAPIInstance ( )
41
43
{
44
+ _settings = Ioc . Default . GetRequiredService < Settings > ( ) ;
42
45
_settingsVM = Ioc . Default . GetRequiredService < SettingWindowViewModel > ( ) ;
43
46
_mainVM = Ioc . Default . GetRequiredService < MainViewModel > ( ) ;
44
47
GlobalHotkey . hookedKeyboardCallback = KListener_hookedKeyboardCallback ;
@@ -247,7 +250,7 @@ public void SavePluginSettings()
247
250
public void OpenDirectory ( string DirectoryPath , string FileNameOrFilePath = null )
248
251
{
249
252
using var explorer = new Process ( ) ;
250
- var explorerInfo = _settingsVM . _settings . CustomExplorer ;
253
+ var explorerInfo = _settings . CustomExplorer ;
251
254
252
255
explorer . StartInfo = new ProcessStartInfo
253
256
{
@@ -268,7 +271,7 @@ private void OpenUri(Uri uri, bool? inPrivate = null)
268
271
{
269
272
if ( uri . Scheme == Uri . UriSchemeHttp || uri . Scheme == Uri . UriSchemeHttps )
270
273
{
271
- var browserInfo = _settingsVM . _settings . CustomBrowser ;
274
+ var browserInfo = _settings . CustomBrowser ;
272
275
273
276
var path = browserInfo . Path == "*" ? "" : browserInfo . Path ;
274
277
0 commit comments