Ver código fonte

Revert "Bug 1891: Correct letter case variant of remote directory in directory tree was not always selected"

The problem was actually resolved already by 62277eb9 (Files with the same name except for a letter case are sorted deterministically) and ce46019d change had no effect.

This reverts commit ce46019d4851c2683b94f67cdc0aa8f25af473cf.

Source commit: 3c90d22d7d871f14b9aebcd0ebed782af2ee4c3f
Martin Prikryl 5 anos atrás
pai
commit
102cab5c04
1 arquivos alterados com 1 adições e 16 exclusões
  1. 1 16
      source/components/UnixDriveView.cpp

+ 1 - 16
source/components/UnixDriveView.cpp

@@ -777,8 +777,7 @@ TTreeNode * __fastcall TCustomUnixDriveView::FindNodeToPath(UnicodeString Path)
     {
       UnicodeString DirName = UnixExtractFileName(Path);
       int StartIndex = 0;
-      int LastIndex = Parent->Count - 1;
-      int EndIndex = LastIndex;
+      int EndIndex = Parent->Count - 1;
 
       while (true)
       {
@@ -787,20 +786,6 @@ TTreeNode * __fastcall TCustomUnixDriveView::FindNodeToPath(UnicodeString Path)
         int C = DoCompareText(DirName, NodeDir);
         if (C == 0)
         {
-          // In case there are more items that are case insensitivelly or logically equivalent,
-          // walk back to find the first such one and then walk forward through all such items,
-          // looking for an exact binary match.
-          // If so such match is found (can it even happen?), return the last equivalent item.
-          while ((Index > 0) && (DoCompareText(DirName, Parent->Item[Index - 1]->Text) == 0))
-          {
-            Index--;
-          }
-          while (!SameStr(DirName, Parent->Item[Index]->Text) &&
-                 (Index < LastIndex) &&
-                 (DoCompareText(DirName, Parent->Item[Index + 1]->Text) == 0))
-          {
-            Index++;
-          }
           Result = Parent->Item[Index];
           break;
         }