Improve file operations, layout memory, and drive status.
Add a sequential file-operations queue with pause, reorder, and optional auto-clear; persist window size and tree width; show free space; and clear leftover indexing status. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
46
src/Explorer.Application/LocationVisibility.cs
Normal file
46
src/Explorer.Application/LocationVisibility.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Explorer.Domain;
|
||||
|
||||
namespace Explorer.Application;
|
||||
|
||||
public static class LocationVisibility
|
||||
{
|
||||
public static bool ShouldShow(LocationInfo info, UiPreferences preferences)
|
||||
{
|
||||
if (info.IsProtected)
|
||||
{
|
||||
return preferences.ShowProtectedSystemLocations;
|
||||
}
|
||||
|
||||
if (info.IsHidden)
|
||||
{
|
||||
return preferences.ShowHiddenFiles;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static SizeKnowledge ResolveSizeKnowledge(LocationInfo info, bool isDirectory, long sizeBytes, bool sizeFromIndex)
|
||||
{
|
||||
if (info.AccessDenied && sizeBytes <= 0)
|
||||
{
|
||||
return SizeKnowledge.Unknown;
|
||||
}
|
||||
|
||||
if (info.AccessDenied && sizeBytes > 0)
|
||||
{
|
||||
return SizeKnowledge.Partial;
|
||||
}
|
||||
|
||||
if (info.IsProtected && isDirectory && sizeBytes <= 0)
|
||||
{
|
||||
return SizeKnowledge.Unknown;
|
||||
}
|
||||
|
||||
if (isDirectory && !sizeFromIndex && sizeBytes <= 0)
|
||||
{
|
||||
return SizeKnowledge.Unknown;
|
||||
}
|
||||
|
||||
return SizeKnowledge.Calculated;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user