mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
fixing all warnings and info for infra (#5891)
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Wox.Infrastructure.Storage
|
||||
public class BinaryStorage<T> : IStorage<T>
|
||||
{
|
||||
// This storage helper returns whether or not to delete the binary storage items
|
||||
private static readonly int BINARY_STORAGE = 0;
|
||||
private static readonly int _binaryStorage = 0;
|
||||
private StoragePowerToysVersionInfo _storageHelper;
|
||||
|
||||
public BinaryStorage(string filename)
|
||||
@@ -36,10 +36,10 @@ namespace Wox.Infrastructure.Storage
|
||||
|
||||
public T TryLoad(T defaultData)
|
||||
{
|
||||
_storageHelper = new StoragePowerToysVersionInfo(FilePath, BINARY_STORAGE);
|
||||
_storageHelper = new StoragePowerToysVersionInfo(FilePath, _binaryStorage);
|
||||
|
||||
// Depending on the version number of the previously installed PT Run, delete the cache if it is found to be incompatible
|
||||
if (_storageHelper.clearCache)
|
||||
if (_storageHelper.ClearCache)
|
||||
{
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Wox.Infrastructure.Storage
|
||||
public string DirectoryPath { get; set; }
|
||||
|
||||
// This storage helper returns whether or not to delete the json storage items
|
||||
private static readonly int JSON_STORAGE = 1;
|
||||
private static readonly int _jsonStorage = 1;
|
||||
private StoragePowerToysVersionInfo _storageHelper;
|
||||
|
||||
internal JsonStorage()
|
||||
@@ -43,10 +43,10 @@ namespace Wox.Infrastructure.Storage
|
||||
|
||||
public T Load()
|
||||
{
|
||||
_storageHelper = new StoragePowerToysVersionInfo(FilePath, JSON_STORAGE);
|
||||
_storageHelper = new StoragePowerToysVersionInfo(FilePath, _jsonStorage);
|
||||
|
||||
// Depending on the version number of the previously installed PT Run, delete the cache if it is found to be incompatible
|
||||
if (_storageHelper.clearCache)
|
||||
if (_storageHelper.ClearCache)
|
||||
{
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Wox.Infrastructure.Storage
|
||||
public class StoragePowerToysVersionInfo
|
||||
{
|
||||
// This detail is accessed by the storage items and is used to decide if the cache must be deleted or not
|
||||
public bool clearCache = false;
|
||||
public bool ClearCache { get; set; } = false;
|
||||
|
||||
private string currentPowerToysVersion = string.Empty;
|
||||
private readonly string currentPowerToysVersion = string.Empty;
|
||||
|
||||
private string FilePath { get; set; } = string.Empty;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Wox.Infrastructure.Storage
|
||||
}
|
||||
}
|
||||
|
||||
private string GetFilePath(string AssociatedFilePath, int type)
|
||||
private string GetFilePath(string associatedFilePath, int type)
|
||||
{
|
||||
string suffix = string.Empty;
|
||||
string cacheSuffix = ".cache";
|
||||
@@ -96,13 +96,13 @@ namespace Wox.Infrastructure.Storage
|
||||
suffix = jsonSuffix;
|
||||
}
|
||||
|
||||
string filePath = AssociatedFilePath.Substring(0, AssociatedFilePath.Length - suffix.Length) + "_version.txt";
|
||||
string filePath = associatedFilePath.Substring(0, associatedFilePath.Length - suffix.Length) + "_version.txt";
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public StoragePowerToysVersionInfo(string AssociatedFilePath, int type)
|
||||
public StoragePowerToysVersionInfo(string associatedFilePath, int type)
|
||||
{
|
||||
FilePath = GetFilePath(AssociatedFilePath, type);
|
||||
FilePath = GetFilePath(associatedFilePath, type);
|
||||
|
||||
// Get the previous version of PowerToys and cache Storage details from the CacheDetails.json storage file
|
||||
string previousVersion = GetPreviousVersion();
|
||||
@@ -112,7 +112,7 @@ namespace Wox.Infrastructure.Storage
|
||||
// However, we do not want to delete the cache if the same version of powerToys is being launched
|
||||
if (Lessthan(previousVersion, currentPowerToysVersion))
|
||||
{
|
||||
clearCache = true;
|
||||
ClearCache = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user