Changeset 213
- Timestamp:
- Jun 13, 2007, 8:33:35 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/CustomFileControls.pas
r188 r213 350 350 Dialogs, 351 351 FileUtilsUnit, 352 ACLStringUtility,353 352 ACLUtility, 354 BitmapUtility; 353 BitmapUtility, 354 StringUtilsUnit; 355 355 356 356 var … … 465 465 While S<>'' Do 466 466 Begin 467 NextFilter:=Pos( ';',S);467 NextFilter:=Pos(PATH_SEPARATOR,S); 468 468 If NextFilter<>0 Then 469 469 Begin … … 477 477 End; 478 478 479 Status := SysUtils.FindFirst(FDirectory + '\'+ ThisFilter, Attr,Search);479 Status := SysUtils.FindFirst(FDirectory + DIRECTORY_SEPARATOR + ThisFilter, Attr,Search); 480 480 While Status = 0 Do 481 481 Begin … … 490 490 While S<>'' Do 491 491 Begin 492 If Pos( ';',S)<>0 Then492 If Pos(PATH_SEPARATOR,S)<>0 Then 493 493 Begin 494 494 s1:=S; 495 Delete(s1,1,Pos( ';',S));496 SetLength(S,Pos( ';',S)-1);495 Delete(s1,1,Pos(PATH_SEPARATOR,S)); 496 SetLength(S,Pos(PATH_SEPARATOR,S)-1); 497 497 End 498 498 Else s1:=''; 499 499 500 Status := SysUtils.FindFirst(FDirectory + '\'+ S, Attr,Search);500 Status := SysUtils.FindFirst(FDirectory + DIRECTORY_SEPARATOR + S, Attr,Search); 501 501 While Status = 0 Do 502 502 Begin … … 560 560 GetDir(Ord(UpCase(Drive))-Ord('A')+1,s); 561 561 {$I+} 562 If (s[length(s)])= '\'Then dec(s[0]);563 If not (NewDir[1] In ['/', '\']) Then s:=s+'\';562 If (s[length(s)])=DIRECTORY_SEPARATOR Then dec(s[0]); 563 If not (NewDir[1] In ['/',DIRECTORY_SEPARATOR]) Then s:=s+DIRECTORY_SEPARATOR; 564 564 NewDir:=s+NewDir; 565 565 End; 566 566 567 If NewDir[Length(NewDir)] = '\'Then SetLength(NewDir,Length(NewDir)-1);567 If NewDir[Length(NewDir)] = DIRECTORY_SEPARATOR Then SetLength(NewDir,Length(NewDir)-1); 568 568 If FDirectory=NewDir Then exit; 569 569 FDirectory := NewDir; … … 608 608 Else Result := Items[ idx ]; 609 609 s:=Directory; 610 If s[Length(s)] In [ '\','/'] Then dec(s[0]);611 If s<>'' Then If Result<>'' Then Result:=s+ '\'+Result;610 If s[Length(s)] In [DIRECTORY_SEPARATOR,'/'] Then dec(s[0]); 611 If s<>'' Then If Result<>'' Then Result:=s+DIRECTORY_SEPARATOR+Result; 612 612 End; 613 613 … … 888 888 IndentLevel: longint; 889 889 PathSoFar: string; 890 tmpPathElements : TStringList; 891 i : integer; 890 892 Begin 891 893 Screen.Cursor := crHourGlass; … … 903 905 Path := Copy( Directory, 4, 255 ); 904 906 PathSoFar := Copy( Directory, 1, 3 ); 905 While Path <> '' Do 906 Begin 907 908 tmpPathElements := TStringList.Create; 909 StrExtractStrings(tmpPathElements, Path, [DIRECTORY_SEPARATOR], #0); 910 911 for i := 0 to tmpPathElements.Count - 1 do 912 begin 907 913 inc( IndentLevel ); 908 S := ExtractNextValue( Path, '\' );914 S := tmpPathElements[i]; 909 915 910 916 if not DirectoryExists( PathSoFar + S ) then … … 915 921 end; 916 922 Items.AddObject( S, pointer( IndentLevel ) ); 917 PathSoFar := PathSoFar + S + '\';923 PathSoFar := PathSoFar + S + DIRECTORY_SEPARATOR; 918 924 End; 919 925 926 tmpPathElements.Destroy; 920 927 ItemIndex:= Items.Count - 1; 921 928
Note:
See TracChangeset
for help on using the changeset viewer.