Procházet zdrojové kódy

Bug fix: Browsing long paths was broken by 9a54ec5f (Using large fetch and not reading short names when reading directories for file panel)

Would add \\? prefix to tree and drive combobox

Source commit: 7b862e177adf09600a200921dec1d4f1e055b049
Martin Prikryl před 1 rokem
rodič
revize
5635eeddf0
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      source/packages/filemng/DirView.pas

+ 6 - 0
source/packages/filemng/DirView.pas

@@ -811,6 +811,8 @@ begin
 end;
 
 procedure TDirView.SetPath(Value: string);
+const
+  LongPathPrefix = '\\?\';
 var
   LongPath: string;
   Len: Integer;
@@ -831,7 +833,11 @@ begin
     SetLength(LongPath, Len);
     Len := GetLongPathName(PChar(ApiPath(Value)), PChar(LongPath), Len);
     if Len > 0 then
+    begin
       Value := Copy(LongPath, 1, Len);
+      if StartsStr(LongPathPrefix, Value) then
+        System.Delete(Value, 1, Length(LongPathPrefix));
+    end;
   end;
 
   CheckCanOpenDirectory(Value);