Skip to content

Commit e6377d0

Browse files
committed
Fix old Program plugin constructor issue
1 parent 5c43dd4 commit e6377d0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Flow.Launcher.Infrastructure/Storage/BinaryStorage.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using System.Threading.Tasks;
34
using Flow.Launcher.Infrastructure.Logger;
45
using Flow.Launcher.Infrastructure.UserSettings;
@@ -40,6 +41,16 @@ public BinaryStorage(string filename)
4041
FilePath = Path.Combine(DirectoryPath, $"{filename}{FileSuffix}");
4142
}
4243

44+
// Let the old Program plugin get this constructor
45+
[Obsolete("This constructor is obsolete. Use BinaryStorage(string filename) instead.")]
46+
public BinaryStorage(string filename, string directoryPath = null!)
47+
{
48+
directoryPath ??= DataLocation.CacheDirectory;
49+
FilesFolders.ValidateDirectory(directoryPath);
50+
51+
FilePath = Path.Combine(directoryPath, $"{filename}{FileSuffix}");
52+
}
53+
4354
public async ValueTask<T> TryLoadAsync(T defaultData)
4455
{
4556
if (Data != null) return Data;

0 commit comments

Comments
 (0)