mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-01-28 01:08:34 +08:00
Quote and prefix long paths when copying to clipboard
Paths copied to the clipboard are now quoted, and long paths (>= 260 characters) are prefixed with \\?\ to ensure compatibility. This improves reliability when handling long file paths.
This commit is contained in:
@@ -48,7 +48,7 @@ internal static class Helper
|
||||
uri.Append('/');
|
||||
else
|
||||
uri.Append($"%{(int)v:X2}");
|
||||
if (uri.Length >= 2 && uri[0] == '/' && uri[1] == '/') // UNC path
|
||||
if (uri.Length >= 2 && uri[0] == '/' && uri[1] == '/') // UNC path - Universal Naming Convention
|
||||
uri.Insert(0, "file:");
|
||||
else
|
||||
uri.Insert(0, "file:///");
|
||||
|
||||
@@ -115,7 +115,7 @@ public partial class ViewerWindow : Window
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(_path);
|
||||
Clipboard.SetText($"\"{(_path.Length >= 260 ? @"\\?\" + _path : _path)}\"");
|
||||
Toast.Success(TranslationHelper.Get("InfoPanelMoreItem_CopySucc"));
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user