Commit 226118e3 authored by Juha Manninen's avatar Juha Manninen
Browse files

IDE: Allow to replace a path in PathEditor if a new path differs only by...

IDE: Allow to replace a path in PathEditor if a new path differs only by character case. Issue #33902.

git-svn-id: trunk@58815 -
parent a4a0be6c
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment