Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/Files.App.Server/Cloud/ServerIconHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@

using System.Drawing;
using System.Drawing.Imaging;
using Windows.Win32;

namespace Files.App.Server.Cloud;

internal sealed record IconFileInfo(byte[] IconData, int Index);

internal static class ServerIconHelper
{
internal static IList<IconFileInfo> ExtractSelectedIconsFromDLL(string file, IList<int> indexes, int iconSize = 48)
{
var result = new List<IconFileInfo>();
foreach (var index in indexes)
{
var hr = PInvoke.SHDefExtractIcon(file, -index, 0, out var large, out var small, (uint)iconSize);
using var largeIcon = large;
using var smallIcon = small;
using var largeIcon = ShellImage.ExtractIconHandle(file, index, (uint)iconSize, out var hr);
if (hr.Failed || largeIcon.IsInvalid)
continue;

Expand Down
5 changes: 4 additions & 1 deletion src/Files.App.Server/Files.App.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@
<Manifest Include="app.manifest" />
<DirectPInvoke Include="ADVAPI32" />
<DirectPInvoke Include="USER32" />
<DirectPInvoke Include="GDI32" />
<DirectPInvoke Include="KERNEL32" />
<DirectPInvoke Include="OLE32" />
<DirectPInvoke Include="SHELL32" />
<NativeLibrary Include="shell32.lib" />
<NativeLibrary Include="gdi32.lib" />
<TrimmerRootAssembly Include="Files.App.Server" />
<PackageReference Include="Microsoft.Windows.CsWinRT" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" />
Expand All @@ -52,7 +56,6 @@
<ItemGroup>
<ProjectReference Include="..\Files.Storage\Files.Storage.csproj" />
<ProjectReference Include="..\Files.Shared\Files.Shared.csproj" />
<ProjectReference Include="..\Files.Core.SourceGenerator\Files.Core.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="False" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unrelated to sharing the helpers. Could you explain why it's removed, or split it out?


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server has no inputs requiring those generators currently.

</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions src/Files.App.Server/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Files Community
// Licensed under the MIT License.

global using Files.App.Data.Items;
global using Files.Storage;
global using Files.App.Utils.Shell;
global using Files.Shared;
global using Files.Shared.Cloud;
global using Files.Shared.Extensions;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App.Server/Initialization/InitializationCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal static class InitializationCache
{
using (item)
{
var isFolder = item is Files.App.Utils.Shell.ShellLink link
var isFolder = item is Files.Storage.ShellLink link
? link.StoredTargetIsFolder() ?? link.IsTargetFolder(Environment.ExpandEnvironmentVariables(link.TargetPath))
: item.IsFolder && !item.IsStream;
if (!isFolder)
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Data/Models/PinnedFoldersManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Files.App.Data.Models
{
public sealed class PinnedFoldersManager
public sealed partial class PinnedFoldersManager
{
private IUserSettingsService userSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>();
private IQuickAccessService QuickAccessService { get; } = Ioc.Default.GetRequiredService<IQuickAccessService>();
Expand All @@ -33,7 +33,7 @@ public IDisposable SuspendSync()
return new SyncSuspensionScope(this);
}

private sealed class SyncSuspensionScope(PinnedFoldersManager owner) : IDisposable
private sealed partial class SyncSuspensionScope(PinnedFoldersManager owner) : IDisposable
{
private int _disposed;

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Helpers/Win32/Win32Helper.Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static partial class Win32Helper
{
try
{
var shellFileItem = folderItem is Files.App.Utils.Shell.ShellLink link ?
var shellFileItem = folderItem is Files.Storage.ShellLink link ?
ShellFolderExtensions.GetShellLinkItem(link) :
ShellFolderExtensions.GetShellFileItem(folderItem);
if (shellFileItem is null)
Expand Down
Loading
Loading