From ec8fde9b34aec386712343c829a121a21bc38b0a Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Thu, 14 Jan 2021 21:35:29 +0200 Subject: Implemented a check to prevent KlamAV from being exited while a scan is going on. Signed-off-by: Mavridis Philippe --- src/klamscan.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/klamscan.cpp') diff --git a/src/klamscan.cpp b/src/klamscan.cpp index bb60d0a..6c6663b 100644 --- a/src/klamscan.cpp +++ b/src/klamscan.cpp @@ -196,6 +196,15 @@ Klamscan::~Klamscan() { } +bool Klamscan::scanGoingOn() { + // Find any tab in which scanning hasn't finished yet + for( int i = 1; i < tabBrowser->count(); i++ ) { + if( dynamic_cast( tabBrowser->page(i) )->scanGoingOn() ) + return true; + } + return false; +} + void Klamscan::scan( TQStringList filepattern ) { ScanViewer* homepage = new ScanViewer(this, "page"); -- cgit v1.2.1