1
0
Эх сурвалжийг харах

Bug 1737: Do not scan unvisited network folders

https://winscp.net/tracker/1737

(and removing check for directory sharing)

Source commit: 1bd9b71e6246bb8866359c502097a2a50467a66f
Martin Prikryl 6 жил өмнө
parent
commit
77b33d68a4

+ 2 - 15
source/packages/filemng/DirView.pas

@@ -1795,21 +1795,8 @@ begin
             ShAttr := 0;
             FDesktopFolder.ParseDisplayName(ParentForm.Handle, nil,
               PChar(FPath + '\' + FileName), Eaten, PIDL, ShAttr);
-
-            {Retrieve the shell display attributes for directories:}
-            if IsDirectory and Assigned(PIDL) then
-            begin
-              shAttr := SFGAO_DISPLAYATTRMASK;
-              try
-                if Assigned(ParentFolder) and
-                   Succeeded(ParentFolder.GetAttributesOf(1, PIDL, shAttr)) then
-                begin
-                  if (shAttr and SFGAO_SHARE) <> 0 then
-                    Item.OverlayIndex := 0;
-                end;
-              except end;
-            end;
-          except end;
+          except
+          end;
         end;
 
         if IsDirectory then

+ 12 - 13
source/packages/filemng/DriveView.pas

@@ -1211,18 +1211,23 @@ begin
     if Assigned(NodeData.PIDL) then
     begin
       if ContentMask then
-        NodeData.shAttr := SFGAO_DISPLAYATTRMASK or SFGAO_CONTENTSMASK
-      else
-        NodeData.shAttr := SFGAO_DISPLAYATTRMASK;
+      begin
+        NodeData.shAttr := SFGAO_CONTENTSMASK;
 
-      if not Succeeded(ShellFolderGetAttributesOfWithTimeout(ParentFolder, 1, NodeData.PIDL, NodeData.shAttr, MSecsPerSec)) then
+        // Previously we would also make use of SFGAO_SHARE to display a share overlay.
+        // But for directories, Windows File Explorer does not display the overlay anymore (probably since Vista).
+        // And for drives (where Explorer does display the overlay), it did not work ever since we use "desktop"
+        // (and not "workspace" as before) to resolve drive interface (see Bug 1717).
+        if not Succeeded(ShellFolderGetAttributesOfWithTimeout(ParentFolder, 1, NodeData.PIDL, NodeData.shAttr, MSecsPerSec)) then
+        begin
+          NodeData.shAttr := 0;
+        end;
+      end
+        else
       begin
         NodeData.shAttr := 0;
       end;
 
-      if not ContentMask then
-        NodeData.shAttr := NodeData.shAttr or SFGAO_HASSUBFOLDER;
-
       if not Assigned(NodeData.ShellFolder) then
       begin
         ParentFolder.BindToObject(NodeData.PIDL, nil, IID_IShellFolder,
@@ -1338,9 +1343,6 @@ begin
               else
                 RootNode := Items.AddObject(nil, '', NodeData);
 
-              if (NodeData.shAttr and SFGAO_SHARE) <> 0 then
-                RootNode.OverlayIndex := 0;
-
               RootNode.Text := GetDisplayName(RootNode);
               RootNode.HasChildren := True;
 
@@ -1446,9 +1448,6 @@ begin
   NewNode := Self.Items.AddChildObject(ParentNode, '', NodeData);
   NewNode.Text := GetDisplayName(NewNode);
 
-  if (NodeData.shAttr and SFGAO_SHARE) <> 0 then
-    NewNode.OverlayIndex := 0;
-
   Result := NewNode;
 end; {AddChildNode}