Преглед на файлове

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 преди 1 година
родител
ревизия
5635eeddf0
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  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);