Ver código fonte

Bug fix: Going to root folder in the local panel does not update selection in the directory tree

(cherry picked from commit 1e12c52d9e54dbd3e2419a19157127d3678ab03e)

Source commit: e6152123fbf0403c9b13a63b2024a9d947c3fc64
Martin Prikryl 5 anos atrás
pai
commit
51a6690b54
1 arquivos alterados com 10 adições e 7 exclusões
  1. 10 7
      source/packages/filemng/DirView.pas

+ 10 - 7
source/packages/filemng/DirView.pas

@@ -150,6 +150,7 @@ type
     SelectNewFiles: Boolean;
     FHiddenCount: Integer;
     FFilteredCount: Integer;
+    FNotRelative: Boolean;
 
     {shFileOperation-shell component TFileOperator:}
     FFileOperator: TFileOperator;
@@ -813,6 +814,7 @@ begin
   DragOnDriveIsMove := True;
   FHiddenCount := 0;
   FFilteredCount := 0;
+  FNotRelative := False;
 
   FFileOperator := TFileOperator.Create(Self);
   FFileOperator.ProgressTitle := coFileOperatorTitle;
@@ -946,7 +948,7 @@ begin
   try
     while (Length(Value) > 0) and (Value[Length(Value)] = '\') do
       SetLength(Value, Length(Value) - 1);
-    PathChanging(True);
+    PathChanging(not FNotRelative);
     FPath := Value;
     Load(True);
   finally
@@ -2834,12 +2836,13 @@ end;
 procedure TDirView.ExecuteRootDirectory;
 begin
   if Valid then
-  try
-    PathChanging(False);
-    FPath := ExtractFileDrive(Path);
-    Load(True);
-  finally
-    PathChanged;
+  begin
+    FNotRelative := True;
+    try
+      Path := ExtractFileDrive(Path);
+    finally
+      FNotRelative := False;
+    end;
   end;
 end;