fix, prevented update burst when adding/removing many sources

This commit is contained in:
Basile Burg 2015-01-05 04:59:15 +01:00
parent 6a8bcf083a
commit 75a9d12a57
1 changed files with 4 additions and 0 deletions

View File

@ -242,6 +242,7 @@ begin
else dir := '';
if selectDirectory('sources', dir, dir, true, 0) then
begin
fProject.beginUpdate;
lst := TStringList.Create;
try
listFiles(lst, dir, true);
@ -254,6 +255,7 @@ begin
end;
finally
lst.Free;
fProject.endUpdate;
end;
end;
end;
@ -274,9 +276,11 @@ begin
dir := extractFilePath(fname);
if not DirectoryExists(dir) then exit;
//
fProject.beginUpdate;
for i:= fProject.Sources.Count-1 downto 0 do
if extractFilePath(fProject.getAbsoluteSourceName(i)) = dir then
fProject.Sources.Delete(i);
fProject.endUpdate;
UpdateByEvent;
end;