mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-04 04:57:41 +01:00
IDE: Allow to replace a path in PathEditor if a new path differs only by character case. Issue #33902.
git-svn-id: trunk@58815 -
This commit is contained in:
parent
a4a0be6cb0
commit
226118e3dd
@ -42,9 +42,9 @@ var
|
||||
begin
|
||||
for i:=0 to List.Count-1 do begin
|
||||
case Cmp of
|
||||
cstCaseSensitive: if List[i]=s then exit(i);
|
||||
cstCaseSensitive: if List[i]=s then exit(i);
|
||||
cstCaseInsensitive: if UTF8CompareText(List[i],s)=0 then exit(i);
|
||||
cstFilename: if CompareFilenames(List[i],s)=0 then exit(i);
|
||||
cstFilename: if CompareFilenames(List[i],s)=0 then exit(i);
|
||||
end;
|
||||
end;
|
||||
Result:=-1;
|
||||
|
||||
@ -30,7 +30,7 @@ uses
|
||||
// LazControls
|
||||
ShortPathEdit,
|
||||
// IdeIntf
|
||||
MacroIntf, IDEImagesIntf,
|
||||
MacroIntf, IDEImagesIntf, IDEUtils,
|
||||
// IDE
|
||||
TransferMacros, GenericListSelect, LazarusIDEStrConsts;
|
||||
|
||||
@ -569,8 +569,10 @@ var
|
||||
InValidPathsExist: Boolean;
|
||||
begin
|
||||
// Replace / add / delete / Delete Invalid Paths
|
||||
AddButton.Enabled:=(DirectoryEdit.Text<>'') and (DirectoryEdit.Text<>FEffectiveBaseDirectory)
|
||||
and (PathListBox.Items.IndexOf(BaseRelative(DirectoryEdit.Text))=-1);
|
||||
AddButton.Enabled:=(DirectoryEdit.Text<>'')
|
||||
and (DirectoryEdit.Text<>FEffectiveBaseDirectory)
|
||||
and (IndexInStringList(PathListBox.Items,cstCaseSensitive,
|
||||
BaseRelative(DirectoryEdit.Text)) = -1);
|
||||
ReplaceButton.Enabled:=AddButton.Enabled and (PathListBox.ItemIndex>-1) ;
|
||||
DeleteButton.Enabled:=PathListBox.SelCount=1; // or ItemIndex>-1; ?
|
||||
// Delete non-existent paths button. Check if there are any.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user