Delete the actual thumbnail cache when requested
This commit is contained in:
parent
aa197e8a79
commit
3ad4efd950
1 changed files with 19 additions and 10 deletions
|
|
@ -194,20 +194,29 @@ namespace MatterHackers.MatterControl.ConfigurationPage
|
|||
{
|
||||
if (rebuildThumbnails)
|
||||
{
|
||||
string directoryToRemove = ApplicationController.CacheablePath("ItemThumbnails", "");
|
||||
try
|
||||
string[] thumbnails = new string[]
|
||||
{
|
||||
if (Directory.Exists(directoryToRemove))
|
||||
ApplicationController.CacheablePath(
|
||||
Path.Combine("Thumbnails", "Content"), ""),
|
||||
ApplicationController.CacheablePath(
|
||||
Path.Combine("Thumbnails", "Library"), "")
|
||||
};
|
||||
foreach (var directoryToRemove in thumbnails)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete(directoryToRemove, true);
|
||||
if (Directory.Exists(directoryToRemove))
|
||||
{
|
||||
Directory.Delete(directoryToRemove, true);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
GuiWidget.BreakInDebugger();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
GuiWidget.BreakInDebugger();
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(directoryToRemove);
|
||||
Directory.CreateDirectory(directoryToRemove);
|
||||
}
|
||||
|
||||
ApplicationController.Instance.Library.NotifyContainerChanged();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue