mirror of https://gitlab.com/basile.b/dexed.git
fix, prevented update burst when adding/removing many sources
This commit is contained in:
parent
6a8bcf083a
commit
75a9d12a57
|
@ -242,6 +242,7 @@ begin
|
||||||
else dir := '';
|
else dir := '';
|
||||||
if selectDirectory('sources', dir, dir, true, 0) then
|
if selectDirectory('sources', dir, dir, true, 0) then
|
||||||
begin
|
begin
|
||||||
|
fProject.beginUpdate;
|
||||||
lst := TStringList.Create;
|
lst := TStringList.Create;
|
||||||
try
|
try
|
||||||
listFiles(lst, dir, true);
|
listFiles(lst, dir, true);
|
||||||
|
@ -254,6 +255,7 @@ begin
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
lst.Free;
|
lst.Free;
|
||||||
|
fProject.endUpdate;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -274,9 +276,11 @@ begin
|
||||||
dir := extractFilePath(fname);
|
dir := extractFilePath(fname);
|
||||||
if not DirectoryExists(dir) then exit;
|
if not DirectoryExists(dir) then exit;
|
||||||
//
|
//
|
||||||
|
fProject.beginUpdate;
|
||||||
for i:= fProject.Sources.Count-1 downto 0 do
|
for i:= fProject.Sources.Count-1 downto 0 do
|
||||||
if extractFilePath(fProject.getAbsoluteSourceName(i)) = dir then
|
if extractFilePath(fProject.getAbsoluteSourceName(i)) = dir then
|
||||||
fProject.Sources.Delete(i);
|
fProject.Sources.Delete(i);
|
||||||
|
fProject.endUpdate;
|
||||||
UpdateByEvent;
|
UpdateByEvent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue