Skip to content

Commit

Permalink
Address some code review
Browse files Browse the repository at this point in the history
  • Loading branch information
d2dyno1 committed Dec 3, 2024
1 parent 2f69954 commit 435035e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Files.App.CsWin32/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ IApplicationDocumentLists
ApplicationDocumentLists
IApplicationActivationManager
MENU_ITEM_TYPE
COMPRESSION_FORMAT
9 changes: 9 additions & 0 deletions src/Files.App/Data/Models/SelectedItemsPropertiesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,9 @@ public bool? IsHiddenEditedValue
}

private bool? isContentCompressed;
/// <remarks>
/// Applies to NTFS item compression.
/// </remarks>
public bool? IsContentCompressed
{
get => isContentCompressed;
Expand All @@ -730,13 +733,19 @@ public bool? IsContentCompressed
}

private bool? isContentCompressedEditedValue;
/// <remarks>
/// Applies to NTFS item compression.
/// </remarks>
public bool? IsContentCompressedEditedValue
{
get => isContentCompressedEditedValue;
set => SetProperty(ref isContentCompressedEditedValue, value);
}

private bool canCompressContent;
/// <remarks>
/// Applies to NTFS item compression.
/// </remarks>
public bool CanCompressContent
{
get => canCompressContent;
Expand Down
5 changes: 3 additions & 2 deletions src/Files.App/Helpers/Win32/Win32Helper.Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Windows.Win32.Storage.FileSystem;
using static Files.App.Constants.Widgets;
using static Vanara.PInvoke.Kernel32;
using COMPRESSION_FORMAT = Windows.Win32.Storage.FileSystem.COMPRESSION_FORMAT;
using HRESULT = Vanara.PInvoke.HRESULT;
using HWND = Vanara.PInvoke.HWND;

Expand Down Expand Up @@ -990,8 +991,8 @@ public static unsafe bool SetCompressionAttributeIoctl(string lpFileName, bool i

var bytesReturned = 0u;
var compressionFormat = isCompressed
? Win32PInvoke.COMPRESSION_FORMAT_DEFAULT
: Win32PInvoke.COMPRESSION_FORMAT_NONE;
? COMPRESSION_FORMAT.COMPRESSION_FORMAT_DEFAULT
: COMPRESSION_FORMAT.COMPRESSION_FORMAT_NONE;

var result = PInvoke.DeviceIoControl(
new(hFile.DangerousGetHandle()),
Expand Down

0 comments on commit 435035e

Please sign in to comment.