summaryrefslogtreecommitdiff
path: root/examples/apps
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-09-18 17:57:47 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-09-18 17:57:47 +0200
commita90ff661379d884072bccfd59acc627c23743874 (patch)
treeea58506cc00681ac52eb50f3eaeec99d7345a697 /examples/apps
parent555ff94fb5416cb20b9167c877c6d44dca8a56a8 (diff)
downloadfpGUI-a90ff661379d884072bccfd59acc627c23743874.tar.xz
Implemented RemoveFile() in FileMonitor
Diffstat (limited to 'examples/apps')
-rw-r--r--examples/apps/ide/src/filemonitor.pas20
1 files changed, 19 insertions, 1 deletions
diff --git a/examples/apps/ide/src/filemonitor.pas b/examples/apps/ide/src/filemonitor.pas
index 2a6c6113..45c6f524 100644
--- a/examples/apps/ide/src/filemonitor.pas
+++ b/examples/apps/ide/src/filemonitor.pas
@@ -239,8 +239,26 @@ begin
end;
procedure TFileMonitor.RemoveFile(const AFilename: TfpgString);
+var
+ i: integer;
+ lFile: TMonitoredFile;
+ lst: TList;
begin
- //
+ lst := FFileList.LockList;
+ try
+ for i := 0 to lst.Count-1 do
+ begin
+ if AFilename = TMonitoredFile(lst[i]).Name then
+ begin
+ lFile := TMonitoredFile(lst[i]);
+ lst.Delete(i);
+ lFile.Free;
+ break;
+ end;
+ end;
+ finally
+ FFileList.UnlockList;
+ end;
end;
end.