From a90ff661379d884072bccfd59acc627c23743874 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Sun, 18 Sep 2011 17:57:47 +0200 Subject: Implemented RemoveFile() in FileMonitor --- examples/apps/ide/src/filemonitor.pas | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'examples/apps/ide') 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. -- cgit v1.2.3-70-g09d2