mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix some typo
This commit is contained in:
parent
25f6e664f2
commit
a9695e3119
3 changed files with 10 additions and 10 deletions
|
|
@ -8,7 +8,7 @@ using Flow.Launcher.Infrastructure.UserSettings;
|
|||
|
||||
namespace Flow.Launcher.Infrastructure.Storage
|
||||
{
|
||||
public class FlowLauncherJsonStorage<T> : JsonStrorage<T> where T : new()
|
||||
public class FlowLauncherJsonStorage<T> : JsonStorage<T> where T : new()
|
||||
{
|
||||
public FlowLauncherJsonStorage()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Flow.Launcher.Infrastructure.Storage
|
|||
/// <summary>
|
||||
/// Serialize object using json format.
|
||||
/// </summary>
|
||||
public class JsonStrorage<T> where T : new()
|
||||
public class JsonStorage<T> where T : new()
|
||||
{
|
||||
protected T _data;
|
||||
// need a new directory name
|
||||
|
|
@ -23,10 +23,10 @@ namespace Flow.Launcher.Infrastructure.Storage
|
|||
{
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
var searlized = File.ReadAllText(FilePath);
|
||||
if (!string.IsNullOrWhiteSpace(searlized))
|
||||
var serialized = File.ReadAllText(FilePath);
|
||||
if (!string.IsNullOrWhiteSpace(serialized))
|
||||
{
|
||||
Deserialize(searlized);
|
||||
Deserialize(serialized);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -40,16 +40,16 @@ namespace Flow.Launcher.Infrastructure.Storage
|
|||
return _data.NonNull();
|
||||
}
|
||||
|
||||
private void Deserialize(string searlized)
|
||||
private void Deserialize(string serialized)
|
||||
{
|
||||
try
|
||||
{
|
||||
_data = JsonSerializer.Deserialize<T>(searlized);
|
||||
_data = JsonSerializer.Deserialize<T>(serialized);
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
LoadDefault();
|
||||
Log.Exception($"|JsonStrorage.Deserialize|Deserialize error for json <{FilePath}>", e);
|
||||
Log.Exception($"|JsonStorage.Deserialize|Deserialize error for json <{FilePath}>", e);
|
||||
}
|
||||
|
||||
if (_data == null)
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ using Flow.Launcher.Infrastructure.UserSettings;
|
|||
|
||||
namespace Flow.Launcher.Infrastructure.Storage
|
||||
{
|
||||
public class PluginJsonStorage<T> :JsonStrorage<T> where T : new()
|
||||
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
|
||||
{
|
||||
public PluginJsonStorage()
|
||||
{
|
||||
// C# releated, add python releated below
|
||||
// C# related, add python related below
|
||||
var dataType = typeof(T);
|
||||
var assemblyName = typeof(T).Assembly.GetName().Name;
|
||||
DirectoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName, Constant.Plugins, assemblyName);
|
||||
|
|
|
|||
Loading…
Reference in a new issue