[net9] Rollup changes from master (#2193)

* feat: handle UNC paths in FileDialog (#2191)

* Remove command from assembly map when removed from command map (#2183)

---------

Co-authored-by: Alex Vallière <6031413+AlexValliere@users.noreply.github.com>
Co-authored-by: Blair <criticalimpact@gmail.com>
Co-authored-by: github-actions[bot] <noreply@github.com>
This commit is contained in:
bleatbot 2025-03-12 23:27:12 +01:00 committed by GitHub
parent 97add3fc90
commit 2e2c73f707
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View file

@ -10,6 +10,7 @@ using Dalamud.IoC.Internal;
using Dalamud.Logging.Internal; using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal.Types; using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
@ -149,6 +150,11 @@ internal sealed unsafe class CommandManager : IInternalDisposableService, IComma
/// <inheritdoc/> /// <inheritdoc/>
public bool RemoveHandler(string command) public bool RemoveHandler(string command)
{ {
if (this.commandAssemblyNameMap.FindFirst(c => c.Key.Item1 == command, out var assemblyKeyValuePair))
{
this.commandAssemblyNameMap.TryRemove(assemblyKeyValuePair.Key, out _);
}
return this.commandMap.Remove(command, out _); return this.commandMap.Remove(command, out _);
} }

View file

@ -36,6 +36,20 @@ public partial class FileDialog
private static string ComposeNewPath(List<string> decomp) private static string ComposeNewPath(List<string> decomp)
{ {
// Handle UNC paths (network paths)
if (decomp.Count >= 2 && string.IsNullOrEmpty(decomp[0]) && string.IsNullOrEmpty(decomp[1]))
{
var pathParts = new List<string>(decomp);
pathParts.RemoveRange(0, 2);
// Can not access server level or UNC root
if (pathParts.Count <= 1)
{
return string.Empty;
}
return $"\\\\{string.Join('\\', pathParts)}";
}
if (decomp.Count == 1) if (decomp.Count == 1)
{ {
var drivePath = decomp[0]; var drivePath = decomp[0];