Remove instance logic for BinaryStorage and JsonStorage, part 1

1. part of #389
2. huge refactoring
This commit is contained in:
bao-qian
2016-04-21 01:53:21 +01:00
parent 0bcb76fa81
commit 8d10c9aa41
52 changed files with 502 additions and 584 deletions

View File

@@ -7,10 +7,9 @@ using Wox.Plugin;
namespace Wox.Storage
{
public class QueryHistoryStorage : JsonStrorage<QueryHistoryStorage>
public class QueryHistory
{
[JsonProperty]
private List<HistoryItem> History = new List<HistoryItem>();
public List<HistoryItem> History = new List<HistoryItem>();
private int MaxHistory = 300;
private int cursor;
@@ -18,8 +17,6 @@ namespace Wox.Storage
public static PluginMetadata MetaData { get; } = new PluginMetadata
{ ID = "Query history", Name = "Query history" };
protected override string FileName { get; } = "QueryHistory";
public HistoryItem Previous()
{
if (History.Count == 0 || cursor == 0) return null;
@@ -58,11 +55,6 @@ namespace Wox.Storage
});
}
if (History.Count % 5 == 0)
{
Save();
}
Reset();
}