Implemented a check to prevent KlamAV from being exited while a scan

is going on.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/24/head
Mavridis Philippe 4 years ago
parent 25c5545315
commit ec8fde9b34
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -168,10 +168,10 @@ void Klamav::shuttingDown(){
} }
bool Klamav::queryClose() { bool Klamav::queryClose() {
if ( freshklam->isFreshklamAlive() ){ if ( freshklam->isFreshklamAlive() || klamscan->scanGoingOn() ){
KMessageBox::information (this,i18n("<p>KlamAV will stay open in the system tray. <br><br>" KMessageBox::information (this,i18n("<p>KlamAV will stay open in the system tray. <br><br>"
" <b>Remember</b> - you can't close KlamAV while <br> " " <b>Remember</b> - you can't quit KlamAV while <br> "
" auto-updating is still running!</p>"),"KlamAV","dontshow"); " scanning or auto-updating!</p>"),"KlamAV","dontshow");
hide(); hide();
return false; return false;

@ -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<ScanViewer*>( tabBrowser->page(i) )->scanGoingOn() )
return true;
}
return false;
}
void Klamscan::scan( TQStringList filepattern ) { void Klamscan::scan( TQStringList filepattern ) {
ScanViewer* homepage = new ScanViewer(this, "page"); ScanViewer* homepage = new ScanViewer(this, "page");

@ -66,6 +66,7 @@ public:
void setDirName(TQString); void setDirName(TQString);
bool isMultiScan(); bool isMultiScan();
bool scanGoingOn();
protected: protected:
/** /**
* Overridden virtuals for TQt drag 'n drop (XDND) * Overridden virtuals for TQt drag 'n drop (XDND)

Loading…
Cancel
Save