mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
mistake ...
This commit is contained in:
@@ -19,6 +19,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using QuickLook.Common.ExtensionMethods;
|
||||
using QuickLook.Common.Plugin;
|
||||
|
||||
namespace QuickLook.Plugin.PluginInstaller
|
||||
@@ -29,6 +30,7 @@ namespace QuickLook.Plugin.PluginInstaller
|
||||
|
||||
public void Init()
|
||||
{
|
||||
CleanupOldPlugins(App.UserPluginPath);
|
||||
}
|
||||
|
||||
public bool CanHandle(string path)
|
||||
@@ -58,5 +60,23 @@ namespace QuickLook.Plugin.PluginInstaller
|
||||
public void Cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
private static void CleanupOldPlugins(string folder)
|
||||
{
|
||||
if (!Directory.Exists(folder))
|
||||
return;
|
||||
|
||||
Directory.GetFiles(folder, "*.to_be_deleted", SearchOption.AllDirectories).ForEach(file =>
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user