mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 18:49:19 +02:00
IDE: file filters: if buggy xml, use defaults, bug #20933
git-svn-id: trunk@34288 -
This commit is contained in:
parent
d0e7e290ce
commit
7bd5c4360f
@ -77,24 +77,18 @@ begin
|
|||||||
cfg := GetIDEConfigStorage(FileDialogFilterConfigFile, True);
|
cfg := GetIDEConfigStorage(FileDialogFilterConfigFile, True);
|
||||||
try
|
try
|
||||||
cnt := cfg.GetValue(KeyFilterCount, 0);
|
cnt := cfg.GetValue(KeyFilterCount, 0);
|
||||||
if cnt = 0 then
|
// read values
|
||||||
|
for i := 1 to cnt do
|
||||||
begin
|
begin
|
||||||
// create default values
|
lName := cfg.GetValue(KeyFilter+IntToStr(i) + '/' + KeyFilterName, '');
|
||||||
Filter:=GetDefaultFileDialogFilter;
|
lMask := cfg.GetValue(KeyFilter+IntToStr(i) + '/' + KeyFilterMask, '*');
|
||||||
end
|
if (lName='') or (lMask='') then continue;
|
||||||
else
|
if Filter<>'' then
|
||||||
begin
|
Filter:=Filter+'|';
|
||||||
// read values
|
Filter:=Filter+lName+'|'+lMask;
|
||||||
for i := 1 to cnt do
|
|
||||||
begin
|
|
||||||
lName := cfg.GetValue(KeyFilter+IntToStr(i) + '/' + KeyFilterName, '');
|
|
||||||
lMask := cfg.GetValue(KeyFilter+IntToStr(i) + '/' + KeyFilterMask, '*');
|
|
||||||
if (lName='') or (lMask='') then continue;
|
|
||||||
if Filter<>'' then
|
|
||||||
Filter:=Filter+'|';
|
|
||||||
Filter:=Filter+lName+'|'+lMask;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
if Filter='' then
|
||||||
|
Filter:=GetDefaultFileDialogFilter;
|
||||||
finally
|
finally
|
||||||
cfg.Free;
|
cfg.Free;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user