Skip to content

Commit 644be79

Browse files
committed
use ISavable and add obsolete message
1 parent 0387bfb commit 644be79

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
using System.Threading.Tasks;
88
using Flow.Launcher.Infrastructure;
99
using Flow.Launcher.Infrastructure.Logger;
10-
using Flow.Launcher.Infrastructure.Storage;
1110
using Flow.Launcher.Infrastructure.UserSettings;
1211
using Flow.Launcher.Plugin;
12+
using ISavable = Flow.Launcher.Plugin.ISavable;
1313

1414
namespace Flow.Launcher.Core.Plugin
1515
{
@@ -48,7 +48,7 @@ public static void Save()
4848
{
4949
foreach (var plugin in AllPlugins)
5050
{
51-
var savable = plugin.Plugin as ISettingsSavable;
51+
var savable = plugin.Plugin as ISavable;
5252
savable?.Save();
5353
}
5454

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

33
namespace Flow.Launcher.Infrastructure.Storage
44
{
5-
/// <summary>
6-
/// Save plugin settings/cache,
7-
/// todo should be merged into a abstract class intead of seperate interface
8-
/// </summary>
9-
public interface ISavable : ISettingsSavable { }
5+
[Obsolete("Deprecated as of Flow Launcher v1.8.0, on 2021.06.21. " +
6+
"This is used only for Everything plugin v1.4.9 or below backwards compatibility")]
7+
public interface ISavable : Plugin.ISavable { }
108
}

Flow.Launcher.Infrastructure/Storage/JsonStorage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ public void Save()
8888
}
8989
}
9090

91+
[Obsolete("Deprecated as of Flow Launcher v1.8.0, on 2021.06.21. " +
92+
"This is used only for Everything plugin v1.4.9 or below backwards compatibility")]
9193
public class JsonStrorage<T> : JsonStorage<T> where T : new() { }
9294
}

Flow.Launcher.Plugin/Interfaces/ISettingsSavable.cs renamed to Flow.Launcher.Plugin/Interfaces/ISavable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/// Otherwise if LoadSettingJsonStorage or SaveSettingJsonStorage has been callded,
66
/// plugin settings will be automatically saved (see Flow.Launcher/PublicAPIInstance.SavePluginSettings) by Flow
77
/// </summary>
8-
public interface ISettingsSavable
8+
public interface ISavable
99
{
1010
void Save();
1111
}

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
using Flow.Launcher.Storage;
2121
using Flow.Launcher.Infrastructure.Logger;
2222
using System.Threading.Channels;
23+
using ISavable = Flow.Launcher.Plugin.ISavable;
2324

2425
namespace Flow.Launcher.ViewModel
2526
{
26-
public class MainViewModel : BaseModel, ISettingsSavable
27+
public class MainViewModel : BaseModel, ISavable
2728
{
2829
#region Private Fields
2930

Plugins/Flow.Launcher.Plugin.Program/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Flow.Launcher.Plugin.Program
1515
{
16-
public class Main : ISettingProvider, IAsyncPlugin, IPluginI18n, IContextMenu, ISettingsSavable, IAsyncReloadable
16+
public class Main : ISettingProvider, IAsyncPlugin, IPluginI18n, IContextMenu, ISavable, IAsyncReloadable
1717
{
1818
internal static Win32[] _win32s { get; set; }
1919
internal static UWP.Application[] _uwps { get; set; }

0 commit comments

Comments
 (0)