diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-09-18 17:57:47 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-09-18 17:57:47 +0200 |
commit | a90ff661379d884072bccfd59acc627c23743874 (patch) | |
tree | ea58506cc00681ac52eb50f3eaeec99d7345a697 /examples/apps/ide | |
parent | 555ff94fb5416cb20b9167c877c6d44dca8a56a8 (diff) | |
download | fpGUI-a90ff661379d884072bccfd59acc627c23743874.tar.xz |
Implemented RemoveFile() in FileMonitor
Diffstat (limited to 'examples/apps/ide')
-rw-r--r-- | examples/apps/ide/src/filemonitor.pas | 20 |
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. |