From 3a990b77f05a6084a0f27b2ef7027c90cdc70be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Valli=C3=A8re?= <6031413+AlexValliere@users.noreply.github.com> Date: Wed, 12 Mar 2025 22:51:33 +0100 Subject: [PATCH] feat: handle UNC paths in FileDialog (#2191) --- .../Interface/ImGuiFileDialog/FileDialog.Files.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs b/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs index 121ec8890..705c0f100 100644 --- a/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs +++ b/Dalamud/Interface/ImGuiFileDialog/FileDialog.Files.cs @@ -36,6 +36,20 @@ public partial class FileDialog private static string ComposeNewPath(List decomp) { + // Handle UNC paths (network paths) + if (decomp.Count >= 2 && string.IsNullOrEmpty(decomp[0]) && string.IsNullOrEmpty(decomp[1])) + { + var pathParts = new List(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) { var drivePath = decomp[0];