Skip to content

Commit 4572068

Browse files
committed
Use api functions in plugin projects
1 parent f761108 commit 4572068

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Windows.Controls;
88
using System.Windows.Media;
99
using System.Windows.Media.Imaging;
10-
using Flow.Launcher.Infrastructure.Image;
1110
using Flow.Launcher.Plugin.Explorer.Search;
1211

1312
namespace Flow.Launcher.Plugin.Explorer.Views;
@@ -89,7 +88,7 @@ public PreviewPanel(Settings settings, string filePath)
8988

9089
private async Task LoadImageAsync()
9190
{
92-
PreviewImage = await ImageLoader.LoadAsync(FilePath, true).ConfigureAwait(false);
91+
PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false);
9392
}
9493

9594
public event PropertyChangedEventHandler? PropertyChanged;

Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceViewModel.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Flow.Launcher.Infrastructure.Image;
2-
using System;
1+
using System;
32
using System.IO;
43
using System.Threading.Tasks;
54
#pragma warning disable IDE0005
@@ -41,8 +40,8 @@ public void CopyNewImageToUserDataDirectoryIfRequired(
4140
#if DEBUG
4241
throw;
4342
#else
44-
Main._context.API.ShowMsgBox(string.Format("Copying the selected image file to {0} has failed, changes will now be reverted", destinationFileNameFullPath));
45-
UpdateIconAttributes(selectedSearchSource, fullPathToOriginalImage);
43+
Main._context.API.ShowMsgBox(string.Format("Copying the selected image file to {0} has failed, changes will now be reverted", destinationFileNameFullPath));
44+
UpdateIconAttributes(selectedSearchSource, fullPathToOriginalImage);
4645
#endif
4746
}
4847
}
@@ -61,7 +60,7 @@ internal bool ShouldProvideHint(string fullPathToSelectedImage)
6160

6261
internal async ValueTask<ImageSource> LoadPreviewIconAsync(string pathToPreviewIconImage)
6362
{
64-
return await ImageLoader.LoadAsync(pathToPreviewIconImage);
63+
return await Main._context.API.LoadImageAsync(pathToPreviewIconImage);
6564
}
6665
}
6766
}

0 commit comments

Comments
 (0)